Home

gsm_u2_library_user`s manual_v101_en

image

Contents

1. 1 GM_SMS_SendMsg Send a message must use GM_SYS_CheckCmdStatus to check status later Syntax int GM_SMS_SendMsg strEncode_Msg strMsg Parameters strMsg the message that will be sent Return values GM_NOERROR no error GM_NOREG not registered or can t service GM_BUSY modem busy 18 29 2 3 2 GM_SMS_ GetNewMsg Get a new sms message Syntax GSM_U2 Library User s Manual v1 0 1 int GM_SMS_GetNewMsg strEncode_Msg msg Parameters msg new sms message Return values 0 no new message 1 new message coming 19 29 GSM_U2 Library User s Manual v1 0 1 2 4 3G GPRS Data Transmission Function Function definition Description GM_NET_SetNet Set Net profile data GM_NET_InstallLink Built TCP UDP link GM_NET_CloseNet Close Network GM_NET GetLinkStatus GM_NET_GetNewPacket 20 29 2 4 1 GM_NET_SetNet Set Net profile data Syntax GSM_U2 Library User s Manual v1 0 1 int GM_NET_SetNet NetProfile netProfile Parameters netProfile Net profile data Return values GM_NOERROR no error GM_CMDERROR command error 21 29 GSM_U2 Library User s Manual v1 0 1 2 4 2 GM_NET_InstallLink Built TCP UDP link Syntax int GM_NET_InstallLink int n int tcp Char serverIP unsigned int serverPort Parameters link number 0 6 3G G 4513 series 0 6 2G G 4511 series 0 tcp clien
2. 4 GM SYS CloseModem ccccccccceeeceeeessseeeceeeeeeeseeeaeeeeeeeees 9 2 2 5 GM SYS CheckModemtats nna0aaanannnnnnnnnaaannnnnnnnnnnnnnne 10 2 2 6 GM SYS CheckCmdStatus 11 2 2 7 GM_SYS_CheckSign l E 12 2 2 8 GM_SYS_CheckReg EE 13 2 2 9 GM SYS EmableN ITZ 2 cers esi ee e tees dot Leas ech dees dee dea dees 14 2 2 10 GM_SYS_NITZUpdateRTC cccsccececceeeesssssssseeeeeeeeeeeseees 15 2 2 11 GM SYS E d IR E 16 2 3 SIMS PUNGCHON EE 17 2 3 1 GM_SMS_ GendMsg 18 2 3 2 GM SMS GetNewMsg sssnnsnessoneeeeeeeeeeeeeeeeeererereeeeeeeeeeeeene 19 2 4 3G GPRS Data Transmission Function a nnnnnnnennnaaannnnnnennnennnnnnnne 20 ERC CT TEE EN 2 4 2 GM_NET El le 22 2 4 3 GM NET eelere 23 2A 4AM NET _GetlP Ae ee et 24 2 4 5 GM_NET_CloseLink seen 25 2 4 6 GM NET GetLinkStatus 00000annnnnnnnnnaaannnannnnnnnnnnnnnnnnnnnnnnnnne 26 24 7 GM NET SeN EE 27 2 4 8 GM NET GelNewPackel cece ona oe Anas EN 28 3 REVISION HIStory cisi 29 GSM_U2 Library User s Manual v1 0 1 1 Introduction 1 1 2G 3G and PAC Embedded Controller 2G 3G is a service that allows information to be sent and received across a mobile telephone network It supports CSD Circuit Switched Data SMS Short Message Service and GPRS General Packet Radio Service GPRS is NOT related to GPS the Global Positioning System a similar acronym that is often used in mo
3. 8 29 GSM_U2 Library User s Manual v1 0 1 2 2 4 GM_SYS CloseModem Close the modem Please call GM_SYS_InitModem to wake GM_SYS_CloseModem 1 to shut down the modem Syntax int GM_SYS_CloseModem int mode Parameters mode 0 close modem but maintain it power on 1 close modem and set it power off Return values GM_NOERROR no error GM_CMDERROR command error 9 29 up modem after using GSM_U2 Library User s Manual v1 0 1 2 2 5 GM_SYS CheckModemStatus Check modem status and suggest you check it in your loop every time Syntax int GM_SYS_CheckModemStatus void Parameters None Return values GM_NOERROR modem register success can service GM_NOREG modem not registered can t service 10 29 GSM_U2 Library User s Manual v1 0 1 2 2 6 GM SYS CheckCmdStatus Get the status of the command you sent Syntax int GM_SYS_CheckCmdStatus void Parameters None Return values GM_BUSY modem busy you can t send other command GM_NOERROR success GM_TIMEOUT time out GM_CMDERROR command error Other please refer to error codes of GSM_U2 h 11 29 GSM_U2 Library User s Manual v1 0 1 2 2 7 GM_SYS_CheckSignal Check signal quality Syntax int GM_SYS_CheckSignal void Parameters None Return values signal quality 0 113 dBm or less 1 111 dBm 2 30 109 53 dBm 31 51 dBm or greater 12 29 GSM_U2 Library User s Manu
4. GSM_U2 Library for G 4511 G 4513 series User s Manual V1 0 1 COP High Quality Industrial Data Acquisition and Control Products GSM_U2 Library User s Manual v1 0 1 Warranty All products manufactured by ICP DAS are warranted against defective materials for a period of one year from the date of delivery to the original purchaser Warning ICP DAS assumes no liability for damages consequent to the use of this product ICP DAS reserves the right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use or for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 2014 by ICP DAS CO LTD All rights reserved worldwide Trademark The names used for identification only may be registered trademarks of their respective companies Contact us If you have any problem please feel free to contact us You can count on us for quick response Email service icpdas com GSM_U2 Library User s Manual v1 0 1 Table of Contents Ts INTOQUCION E 1 1 1 2G 3G and PAC Embedded CGontroler 1 1 2 Design Flowchart nn 2 2 GSM LTD EAN Sn iaaii 3 2 1 Data Structure Define EE 3 22 OVS FEM lee 5 2 2 1 GM_ SYS GetLibVersion 6 222 ON SYS RE 7 2 2 3 GM_SYS_lnitModem Lise sante naines 8 2 2
5. al v1 0 1 2 2 8 GM_SYS CheckReg Check register Syntax int GM_SYS_CheckReg void Parameters None Return values Register flag 0 not registered registered home network not registered and searching registration denied unknown registered roaming 0O A N 1 GSM_U2 Library User s Manual v1 0 1 2 2 9 GM_SYS_EnableNITZ Enable NITZ function NITZ function can auto adjust RTC of the system at the moment of the modem registering to GSM system Please Call GM_SYS_NITZUpdateRTC to update RTC after GM_SYS_EnableNITZ 1 Syntax void GM_SYS_EnableNITZ int nitz Parameters nitz 0 disable 1 enable Return values None 14 29 GSM_U2 Library User s Manual v1 0 1 2 2 10 GM_SYS_NITZUpdateRTC Update the RTC of the System by NITZ Notice this function will disable all 3G GSM function about 1 2 minutes Please use this function after you stop all 3G GSM function Syntax void GM_SYS_NITZUpdateRTC void Parameters None Return values None 15 29 GSM_U2 Library User s Manual v1 0 1 2 2 11 GM_SYS_CheckNITZ Check the status of NITZ Syntax void GM_SYS_CheckNITZ void Parameters None Return values 0 fail to update RTC 1 success 2 updating 16 29 GSM_U2 Library User s Manual v1 0 1 2 3 SMS Function Function definition Description 17 29 GSM_U2 Library User s Manual v1 0 1 2 3
6. bile contexts 2G 3G offers instant connections whereby information can be sent or received immediately as the need arises subject to radio coverage This is why 2G 3G users are sometimes referred to be as being always connected Immediacy is one of the advantages of 2G 3G and SMS when compared to Circuit Switched Data High immediacy is a very important feature for time critical applications ICP DAS provides the 2G 3G library for PAC embedded controller The library is an easy way to applying the 2G 3G service in the embedded controller Otherwise ICP DAS supports many IO modules and GPS modules for users Therefore there are many application architectures to apply in the system Or users can integrate other controller system with 2G 3G library The follows is a standard application architecture Solar Panel amp Lead Acid Battery GPS Satellite Flood Warning a 1729 GSM_U2 Library User s Manual v1 0 1 1 2 Design Flowchart SMS Design Flowchart GPRS Design Flowchart Program start GM_SYS_InitModem GM_SMS_GetNewMsg GM_SMS_SendMsg Program start GM NET Send GM_SYS_CheckCmdStatus 2 29 GSM_U2 Library User s Manual v1 0 1 2 GSM_U2 Library 2 1 Data Structure Define There are some data structure that is useful when you program with GSM_U2 library SMS structure for sending reading SMS typedef struct STRENCODE_MSG char phoneNumber 30 phone n
7. e Timer that installed by InstallUserTimer Please don t collide with it 4 29 GSM_U2 Library User s Manual v1 0 1 2 2 SYSTEM Function Function definition Description GM_SYS GetLibVersion GM_SYS_GetLibDate GM_SYS_CloseModem Check modem status and suggest you GM_SYS_CheckModemStatus check it in your loop every time GM_SYS_CheckCmdStatus Get the status of the command you sent GM_SYS_CheckSignal Check signal quality GM_SYS_CheckReg Check register GM_SYS_EnableNITZ Enable NITZ function GM_SYS_NITZUpdateRTC Update the RTC of the System by NITZ GM_SYS_CheckNITZ Check the status of NITZ 5 29 GSM_U2 Library User s Manual v1 0 1 2 2 1 GM SYS GetLibVersion Get library version Syntax int GM_SYS_GetLibVersion void Parameters None Return values Version format A BC 6 29 2 2 2 GM SYS GetLibDate Get library date Syntax void GM_SYS GetLibDate char libDate Parameters libDate a string of lib date format Jul 21 2014 Return values None 7 29 GSM_U2 Library User s Manual v1 0 1 GSM_U2 Library User s Manual v1 0 1 2 2 3 GM SYS InitModem Initialize Modem must use GM_SYS_CheckModemStatus to check modem status later Syntax int GM_SYS_InitModem SYSProfile sysProfile Parameters sysProfile set system profile Return values GM_NOERROR success GM_COMERROR comport error GM_INITERROR init fail error
8. must use GM_SYS_CheckCmdStatus to check status later Syntax int GM_NET_Send char link char data int dataLen Parameters link link number 3G G 4513 series 0 6 2G G 4511 series 0 data data that will be sent dataLen data length Max 1000 Return values GM_NOERROR no error GM_CMDERROR command error GM_BUSY modem busy 27 29 2 4 8 GM_NET_GetNewPacket Get the new packet Syntax GSM_U2 Library User s Manual v1 0 1 int GM_NET_GetNewPacket GPRSData gprsData Parameters gprsData new data packet Return values 0 no new packet 1 new packet coming 28 29 GSM_U2 Library User s Manual v1 0 1 3 Revision History Revision Date Author Description 2014 09 08 2015 02 16 Modify the description of GM_SYS_CheckReg 29 29
9. t type tcp 1 for TCP client tcp 0 for UDP client serverlP IP or Domain name of the server ex 61 111 222 333 test com tw serverPort TCP UDP Port of the server 1 65535 ex 1234 Return GM_NOERROR correct parameter to install TCP UDP link GM_CMDERROR command error 22 29 2 4 3 GM_NET_CloseNet Close Network Syntax GSM_U2 Library User s Manual v1 0 1 int GM_NET_CloseNet void Parameters None Return values GM_NOERROR no error GM_CMDERROR command error GM_BUSY modem busy 23 29 GSM_U2 Library User s Manual v1 0 1 2 4 4 GM_NET_GetIP Get local IP Syntax void GM_NET_GetIP Char ipaddr Parameters ipaddr IP string format char ipaddr 16 Return values None 24 29 2 4 5 GM_NET_CloseLink Close client link n Syntax GSM_U2 Library User s Manual v1 0 1 int GM_NET_CloseLink int n Parameters 3G G 4513 series 0 6 2G G 4511 series 0 Return values GM_NOERROR no error GM_CMDERROR command error GM_BUSY modem busy 25 29 2 4 6 GM_NET_GetLinkStatus Get status of Link n Syntax GSM_U2 Library User s Manual v1 0 1 int GM_NET_GetLinkStatus int n Parameters 3G G 4513 series 0 6 2G G 4511 series 0 Return values 0 not link 1 linked 26 29 GSM_U2 Library User s Manual v1 0 1 2 4 7 GM_NET_Send Send a packet
10. umber char time 20 sms_time_stamp char msg 161 message s content unsigned char datal en Messages length Max length 7 bit 160 words UCS2 70 words 140 bytes char mode encode style O0 GSM_7BIT 8 GSM_UCS2 uni code strEncode_Msg GPRS structure for reading GPRS sockets typedef struct GPRSDATA char data 1500 data int dataLen data length char fromIP 16 IP of the server gt 000 000 000 000 and 0x00 total 16 byte unsigned int port TCP UDP port of the server int link data of link n GPRSData structure for setting network typedef struct NET PROFILE char APN 60 APN for network provided by your cellular provider char user 32 username for network provided by your cellular provider char pw 32 password for network provided by your cellular provider char DnsServerlP 16 The most basic task of DNS is to translate hostnames such aS www icpdas com to IP address such as 96 9 41 131 NetProfile 3 29 GSM_U2 Library User s Manual v1 0 1 SYSTEM structure for setting system parameters typedef struct SYS PROFILE char PINCode 5 The pin code of SIM card ex 0000 int modemPort modem port number int hardware nardware type 0 G 4511 G 4513 series 1 G 4500 SYSProfile Tips amp Warnings 1 The GSM_U2 library needs OS7_COM lib Please include it 2 The speed of GPRS is less than 1 packet 1 second 3 The GSM_U2 library needs th

Download Pdf Manuals

image

Related Search

Related Contents

  Manuel d`entretien  Whirlpool AWOD 070  Manuale uso e manutenzione Duplex    GuiXT / InputAssistant / Viewer Dokumentation  User Guide    Bissell 2X User's Manual  SIMATIC S7 - OPEN MODBUS/TCP Kommunikation über  

Copyright © All rights reserved.
Failed to retrieve file