easy connect wnc added to http request with debug mode enabled. traces collected for AT%CGEQOS, AT%MEAS, AT%PCONI
Fork of WncControllerLibrary by
Diff: WncController.h
- Revision:
- 1:ac2de545b981
- Parent:
- 0:affdbb35faa4
- Child:
- 2:30d78cda6779
--- a/WncController.h Wed Aug 31 02:06:26 2016 +0000 +++ b/WncController.h Thu Sep 01 02:28:10 2016 +0000 @@ -100,7 +100,7 @@ * constructor below. Assumes UART is enabled, setup and ready to go. This * class will read and write to this UART. */ - WncController(const char * const apnStr); + WncController(void); // WncController( const char * const apnStr, MODSERIAL * wnc_uart, MODSERIAL * debug_uart = NULL); @@ -140,7 +140,7 @@ * and bring it to life. It will also initialize the WNC enough to get it to be able to open sockets * (with AT commands) */ - bool powerWncOn(uint8_t powerUpTimeoutSecs = MAX_POWERUP_TIMEOUT); + bool powerWncOn(const char * const apn, uint8_t powerUpTimeoutSecs = MAX_POWERUP_TIMEOUT); /** * \brief Query the WNC modem for its Internet attributes @@ -295,6 +295,7 @@ int dbgPutsNoTime(const char * s, bool crlf = true); int dbgPuts(const char * s, bool crlf = true); const char * _to_string(int64_t value); + const char * _to_hex_string(uint8_t value); // Sends commands to WNC via enum AtCmdErr_e { @@ -312,21 +313,21 @@ virtual int putc(char c) = 0; virtual int puts(const char * s) = 0; virtual char getc(void) = 0; - virtual int byteReady(void) = 0; - virtual int dbgWriteByte(char b) = 0; - virtual int dbgWriteBytes(const char *b) = 0; + virtual int charReady(void) = 0; + virtual int dbgWriteChar(char b) = 0; + virtual int dbgWriteChars(const char *b) = 0; virtual void waitMs(int t) = 0; virtual void waitUs(int t) = 0; virtual bool initWncModem(uint8_t powerUpTimeoutSecs) = 0; // Isolate OS timers - virtual int getLogTimerTicks(void) = 0; - virtual void startTimerA(void) = 0; - virtual void stopTimerA(void) = 0; - virtual int getUsTimerTicksA(void) = 0; - virtual void startTimerB(void) = 0; - virtual void stopTimerB(void) = 0; - virtual int getUsTimerTicksB(void) = 0; + virtual int getLogTimerTicks(void) = 0; + virtual void startTimerA(void) = 0; + virtual void stopTimerA(void) = 0; + virtual int getTimerTicksA_mS(void) = 0; + virtual void startTimerB(void) = 0; + virtual void stopTimerB(void) = 0; + virtual int getTimerTicksB_mS(void) = 0; bool waitForPowerOnModemToRespond(uint8_t powerUpTimeoutSecs); @@ -335,11 +336,11 @@ bool softwareInitMdm(void); bool checkCellLink(void); AtCmdErr_e mdmSendAtCmdRsp(const char * cmd, int timeout_ms, string * rsp, bool crLf = true); - size_t mdmGetline(string & buff, int timeout_ms); + size_t mdmGetline(string * buff, int timeout_ms); AtCmdErr_e sendWncCmd(const char * const s, string ** r, int ms_timeout); bool at_at_wnc(void); bool at_init_wnc(bool hardReset = false); - bool at_sockopen_wnc(const string & ipStr, uint16_t port, uint16_t numSock, bool tcp, uint16_t timeOutSec); + bool at_sockopen_wnc(const char * const ip, uint16_t port, uint16_t numSock, bool tcp, uint16_t timeOutSec); bool at_sockclose_wnc(uint16_t numSock); bool at_dnsresolve_wnc(const char * s, string * ipStr); AtCmdErr_e at_sockwrite_wnc(const char * s, uint32_t n, uint16_t numSock, bool isTcp); @@ -353,7 +354,7 @@ size_t at_readSMStext_wnc(const char ** log); bool at_getrssiber_wnc(int16_t * dBm, int16_t * ber3g); void closeOpenSocket(uint16_t numSock); - bool sockWrite(const char * s, uint32_t n, uint16_t numSock, bool isTcp); + bool sockWrite(const char * const s, uint32_t n, uint16_t numSock, bool isTcp); bool at_sendSMStextMem_wnc(char n); bool at_deleteSMSTextFromMem_wnc(char n); bool at_saveSMStext_wnc(const char * const phoneNum, const char * const text, char * msgIdx);