tes sim 5360
GSM Class Reference
#include <SIM5360.h>
Public Member Functions | |
GSM (PinName tx, PinName rx, int baudRate, char *number) | |
Create GSM instance. | |
int | init (void) |
init GSM module including SIM card check & signal strength & network check | |
int | registerNet (void) |
Register Network of GSM module including signal strength & network check. | |
int | checkNetStatus (void) |
Check network status of GSM module. | |
int | checkSIMStatus (void) |
Check SIM card' Status. | |
int | checkSignalStrength (void) |
Check signal strength. | |
int | settingSMS (void) |
Set SMS format and processing mode. | |
int | sendSMS (char *number, char *data) |
Send text SMS. | |
int | readSMS (char *message, int index) |
Read SMS by index. | |
int | deleteSMS (int index) |
Delete SMS message on SIM card. | |
int | getSMS (char *message) |
Read SMS when coming a message,it will be store in messageBuffer. | |
int | callUp (char *number) |
Call someone. | |
int | answer (void) |
Auto answer if coming a call. | |
int | join (char *apn, char *userName=NULL, char *passWord=NULL) |
Join GSM network. | |
int | disconnect (void) |
Disconnect from network. | |
int | SetBlocking (int netopen_to=5, int cipopen_to=5, int cipsend_to=5) |
Set blocking of the connection. | |
int | connectTCP (char *ip, int port) |
Build TCP connect. | |
int | sendTCPData (char *data, int len) |
Send data to TCP server. | |
int | receivedTCPData (char *buff, int len) |
Send data to TCP server. | |
int | closeTCP (void) |
Close TCP connection. | |
void | purge (void) |
Clear serial pipe. |
Detailed Description
GSM class.
Used for mobile communication. attention that GSM module communicate with MCU in serial protocol
Definition at line 21 of file SIM5360.h.
Constructor & Destructor Documentation
GSM | ( | PinName | tx, |
PinName | rx, | ||
int | baudRate, | ||
char * | number | ||
) |
Member Function Documentation
int answer | ( | void | ) |
Auto answer if coming a call.
- Returns:
- 0 on success, -1 on error
Definition at line 290 of file SIM5360.cpp.
int callUp | ( | char * | number ) |
Call someone.
- Parameters:
-
*number the phone number which you want to call
- Returns:
- 0 on success, -1 on error
Definition at line 280 of file SIM5360.cpp.
int checkNetStatus | ( | void | ) |
Check network status of GSM module.
- Returns:
- 0 on success, -1 on error
Definition at line 152 of file SIM5360.cpp.
int checkSignalStrength | ( | void | ) |
Check signal strength.
- Returns:
- signal strength in number(ex 3,4,5,6,7,8...) on success, -1 on error
Definition at line 196 of file SIM5360.cpp.
int checkSIMStatus | ( | void | ) |
Check SIM card' Status.
- Returns:
- 0 on success, -1 on error
Definition at line 175 of file SIM5360.cpp.
int closeTCP | ( | void | ) |
int connectTCP | ( | char * | ip, |
int | port | ||
) |
Build TCP connect.
- Parameters:
-
*ip ip address which will connect to *port TCP server' port number
- Returns:
- 0 on success, -1 on error
Definition at line 351 of file SIM5360.cpp.
int deleteSMS | ( | int | index ) |
Delete SMS message on SIM card.
- Parameters:
-
*index the index number which SMS message will be delete
- Returns:
- 0 on success, -1 on error
Definition at line 264 of file SIM5360.cpp.
int disconnect | ( | void | ) |
Disconnect from network.
- Returns:
- 0 on success, -1 on error
Definition at line 410 of file SIM5360.cpp.
int getSMS | ( | char * | message ) |
Read SMS when coming a message,it will be store in messageBuffer.
- Parameters:
-
message buffer used to get SMS message
Definition at line 272 of file SIM5360.cpp.
int init | ( | void | ) |
init GSM module including SIM card check & signal strength & network check
- Returns:
- 0 on success, -1 on error
Definition at line 86 of file SIM5360.cpp.
int join | ( | char * | apn, |
char * | userName = NULL , |
||
char * | passWord = NULL |
||
) |
Join GSM network.
- Parameters:
-
*apn Access Point Name to connect network *userName general is empty *passWord general is empty
Definition at line 296 of file SIM5360.cpp.
void purge | ( | void | ) |
Clear serial pipe.
Definition at line 35 of file SIM5360.cpp.
int readSMS | ( | char * | message, |
int | index | ||
) |
Read SMS by index.
- Parameters:
-
*message buffer used to get SMS message index which SMS message to read
- Returns:
- 0 on success, -1 on error
Definition at line 243 of file SIM5360.cpp.
int receivedTCPData | ( | char * | buff, |
int | len | ||
) |
Send data to TCP server.
- Parameters:
-
*buff data that will be received from TCP server len size of buffer to read
- Returns:
- 0 on success, -1 on error
Definition at line 393 of file SIM5360.cpp.
int registerNet | ( | void | ) |
Register Network of GSM module including signal strength & network check.
- Returns:
- 0 on success, -1 on error
Definition at line 131 of file SIM5360.cpp.
int sendSMS | ( | char * | number, |
char * | data | ||
) |
Send text SMS.
- Parameters:
-
*number phone number which SMS will be send to *data message that will be send to
- Returns:
- 0 on success, -1 on error
Definition at line 227 of file SIM5360.cpp.
int sendTCPData | ( | char * | data, |
int | len | ||
) |
Send data to TCP server.
- Parameters:
-
*data data that will be send to TCP server
- Returns:
- 0 on success, -1 on error
Definition at line 373 of file SIM5360.cpp.
int SetBlocking | ( | int | netopen_to = 5 , |
int | cipopen_to = 5 , |
||
int | cipsend_to = 5 |
||
) |
Set blocking of the connection.
- Parameters:
-
netopen_to time out of open the socket network in second cipopen_to time out of open the connection to server in second cipsend_to time out of send data to server in second
- Returns:
- 0 on success, -1 on error
Definition at line 335 of file SIM5360.cpp.
int settingSMS | ( | void | ) |
Set SMS format and processing mode.
- Returns:
- 0 on success, -1 on error
Definition at line 216 of file SIM5360.cpp.
Generated on Wed Jul 13 2022 00:17:58 by
![doxygen](doxygen.png)