support library for C027 helper functions for Buffer Pipes, Buffered Serial Port (rtos capable) and GPS parsing. It includes modem APIs for USSD, SMS and Sockets.
Dependents: HTTPClient_Cellular_HelloWorld Cellular_HelloMQTT MbedSmartRestMain Car_Bon_car_module ... more
This library is intended to be used with u-blox products such as the C027 or a shield with u-blox cellular and GPS modules like the cellular and positioning shield from Embedded Artist.
For 2G/GSM and 3G/UMTS you need to:
- have a SIM card and know its PIN number
- need to know you network operators APN setting These setting should be passed to the connect or init and join functions. You can also extend the APN database in MDMAPN.h.
For CDMA products you need to make sure that you have provisioned and activated the modem with either Sprint or Verizon.
Diff: MDM.h
- Revision:
- 73:2b32e0a21df2
- Parent:
- 72:d1e943ad6558
- Child:
- 74:208e3e32d263
--- a/MDM.h Thu May 15 07:06:07 2014 +0000 +++ b/MDM.h Thu May 15 08:25:45 2014 +0000 @@ -282,24 +282,43 @@ // DUMP status to standard out (printf) // ---------------------------------------------------------------- + //! helper type for DPRINT + typedef int (*_DPRINT)(void* param, char const * format, ...); + + //! helper to declate templates and void versions +#define _DUMP_TEMPLATE(func, type, arg) \ + template<class T> \ + inline void func(type arg, \ + int (*dprint)( T* param, char const * format, ...), \ + T* param) { func(arg, (_DPRINT)dprint, (void*)param); } \ + static void func(type arg, \ + _DPRINT dprint = (_DPRINT)fprintf, \ + void* param = (void*)stdout); + /** dump the device status to stdout using printf \param status the status to convert to textual form, unavailable fields are ommited (not printed) + \param dprint a function pointer + \param param the irst argument passed to dprint */ - static void dumpDevStatus(MDMParser::DevStatus *status); + _DUMP_TEMPLATE(dumpDevStatus, MDMParser::DevStatus*, status) /** dump the network status to stdout using printf \param status the status to convert to textual form, unavailable fields are ommited (not printed) + \param dprint a function pointer + \param param the irst argument passed to dprint */ - static void dumpNetStatus(MDMParser::NetStatus *status); - + _DUMP_TEMPLATE(dumpNetStatus, MDMParser::NetStatus*, status) + /** dump the ip address to stdout using printf \param ip the ip to convert to textual form, unavailable fields are ommited (not printed) + \param dprint a function pointer + \param param the irst argument passed to dprint */ - static void dumpIp(MDMParser::IP ip); - + _DUMP_TEMPLATE(dumpIp, MDMParser::IP, ip) + // ---------------------------------------------------------------- // Parseing // ---------------------------------------------------------------- @@ -386,9 +405,9 @@ \sa waitFinalResp */ template<class T> - int waitFinalResp(int (*cb)(int type, const char* buf, int len, - T* param), - T* param, int timeout_ms = 10000) + inline int waitFinalResp(int (*cb)(int type, const char* buf, int len, T* param), + T* param, + int timeout_ms = 10000) { return waitFinalResp((_CALLBACKPTR)cb, (void*)param, timeout_ms); }