C027_Support library plus AT Comand for dialing.
Fork of C027_Support_Plus_Dialing by
Diff: MDM.h
- Revision:
- 120:353754a2bcd9
- Parent:
- 117:74e4e0109a9e
- Child:
- 121:3e1d84b2d34c
--- a/MDM.h Thu Mar 12 17:10:17 2015 +0000 +++ b/MDM.h Thu Oct 08 04:05:30 2015 +0000 @@ -5,6 +5,7 @@ #include "Pipe.h" #include "SerialPipe.h" +#include <sstream> #ifdef TARGET_UBLOX_C027 #define MDM_IF(onboard,shield) onboard @@ -281,6 +282,66 @@ bool smsSend(const char* num, const char* buf); // ---------------------------------------------------------------- + // Dial Service + // ---------------------------------------------------------------- + + /** Start Dial Phone Number + \param num the phone number of the recipient + + \return true if successful, false otherwise + */ + bool dialStart(const char* num); + + /** Stop Dial Phone Number + \param num the phone number of the recipient + + \return true if successful, false otherwise + */ + bool dialStop(); + + /** Answer Dial from Other Phone + \don't have param for this query + + return true if successful, alse otherwise + */ + bool dialAns(); + + /** Check Dial Status if Have Call list + \param num the phone number of the dialler must same as init(set number). + + return true if successful, alse otherwise + */ + bool dialStatus(const char* num); + + bool dbgSts(); + + // ---------------------------------------------------------------- + // Signal Service + // ---------------------------------------------------------------- + + /** Check signal quality + \param signal strenght + + \return value of signal strenght + */ + int chkSig(MDMParser::NetStatus *status); + + /** Chek status of debug for set the next action + \param status debug + \param number of dialing + \ param signal quality + + \return status info, matching number, and signal quality + */ + bool readDbg(int* status, char* num, int *signal, int* idx); + //bool readDbg(int* status, char* num, int *signal, int* idx); + + /** make all uplink and downlink are mute + \param value for active or inactive + */ + bool mute(bool mut); + + // ---------------------------------------------------------------- // USSD Unstructured Supplementary Service Data // ---------------------------------------------------------------- @@ -536,6 +597,17 @@ typedef struct { int* ix; int num; } CMGLparam; static int _cbCMGL(int type, const char* buf, int len, CMGLparam* param); static int _cbCMGR(int type, const char* buf, int len, CMGRparam* param); + // dial + typedef struct { char* num; int* stat;} ATAparam; + static int _cbATA(int type, const char* buf, int len, ATAparam* param); + static int _cbSts(int type, const char* buf, int len, char* str); + static int _cbRing(int type, const char* buf, int len, char* str); + // signal + typedef struct { char* buf; int* sig; int* qual;} CSQparam; + static int _cbCSQ(int type, const char* buf, int len, CSQparam* param); + // status dbg + typedef struct { char* buf; int* signal; int *status; char* num; int* indeks;} DBGparam; + static int _cbDBG(int type, const char* buf, int len, DBGparam* param); // file typedef struct { const char* filename; char* buf; int sz; int len; } URDFILEparam; static int _cbUDELFILE(int type, const char* buf, int len, void*); @@ -552,6 +624,7 @@ int _findSocket(int handle = SOCKET_ERROR/* = CREATE*/); static MDMParser* inst; bool _init; + const char* num; #ifdef TARGET_UBLOX_C027 bool _onboard; #endif