Host library for controlling a WiConnect enabled Wi-Fi module.
Dependents: wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more
Revision 8:1fad4ca6c6a4, committed 2014-08-11
- Comitter:
- dan_ackme
- Date:
- Mon Aug 11 16:30:38 2014 -0700
- Parent:
- 7:41d456a65f14
- Child:
- 9:b6218dc218ad
- Commit message:
- fixed bug in QueuedCommand
Changed in this revision
--- a/internal/network/NetworkJoin.cpp Mon Aug 11 16:16:02 2014 -0700 +++ b/internal/network/NetworkJoin.cpp Mon Aug 11 16:30:38 2014 -0700 @@ -114,18 +114,18 @@ #ifdef WICONNECT_ASYNC_TIMER_ENABLED -static char joinStatusMonitor_responseBuffer[4]; -static uint8_t joinStatusMonitor_cmdBuffer[sizeof(QueuedCommand)]; /*************************************************************************************************/ // this is called every 1s by the monitorTimer void NetworkInterface::joinStatusMonitor() { - QueuedCommand *cmd = (QueuedCommand*)joinStatusMonitor_cmdBuffer; + static char responseBuffer[4]; + static uint8_t cmdBuffer[sizeof(QueuedCommand)]; + QueuedCommand *cmd = (QueuedCommand*)cmdBuffer; monitorTimer.stop(); - *cmd = QueuedCommand(sizeof(joinStatusMonitor_responseBuffer), joinStatusMonitor_responseBuffer, "get network.status"); + *cmd = QueuedCommand(sizeof(responseBuffer), responseBuffer, "get network.status"); wiconnect->enqueueCommand(cmd, Callback(this, &NetworkInterface::joinStatusCheckCallback)); }
--- a/internal/network/NetworkWebSetup.cpp Mon Aug 11 16:16:02 2014 -0700 +++ b/internal/network/NetworkWebSetup.cpp Mon Aug 11 16:30:38 2014 -0700 @@ -113,17 +113,17 @@ #ifdef WICONNECT_ASYNC_TIMER_ENABLED -static char webSetupStatusMonitor_responseBuffer[4]; -static uint8_t webSetupStatusMonitor_cmdBuffer[sizeof(QueuedCommand)]; /*************************************************************************************************/ void NetworkInterface::webSetupStatusMonitor() { - QueuedCommand *cmd = (QueuedCommand*)webSetupStatusMonitor_cmdBuffer; + static char responseBuffer[4]; + static uint8_t cmdBuffer[sizeof(QueuedCommand)]; + QueuedCommand *cmd = (QueuedCommand*)cmdBuffer; monitorTimer.stop(); - *cmd = QueuedCommand(sizeof(webSetupStatusMonitor_responseBuffer), webSetupStatusMonitor_responseBuffer, "setup status"); + *cmd = QueuedCommand(sizeof(responseBuffer), responseBuffer, "setup status"); wiconnect->enqueueCommand(cmd, Callback(this, &NetworkInterface::webSetupStatusCheckCallback)); }
--- a/internal/types/QueuedCommand.cpp Mon Aug 11 16:16:02 2014 -0700 +++ b/internal/types/QueuedCommand.cpp Mon Aug 11 16:30:38 2014 -0700 @@ -23,7 +23,7 @@ { va_list args; va_start(args, cmd_); - initialize(responseBufferLen_, responseBuffer_, timeoutMs_, NULL, NULL, cmd_, args); + initialize(responseBufferLen_, responseBuffer_, timeoutMs_, ReaderFunc(), NULL, cmd_, args); va_end(args); } @@ -32,7 +32,7 @@ { va_list args; va_start(args, cmd_); - initialize(responseBufferLen_, responseBuffer_, WICONNECT_DEFAULT_TIMEOUT, NULL, NULL, cmd_, args); + initialize(responseBufferLen_, responseBuffer_, WICONNECT_DEFAULT_TIMEOUT, ReaderFunc(), NULL, cmd_, args); va_end(args); } @@ -41,7 +41,7 @@ { va_list args; va_start(args, cmd_); - initialize(0, NULL, timeoutMs_, NULL, NULL, cmd_, args); + initialize(0, NULL, timeoutMs_, ReaderFunc(), NULL, cmd_, args); va_end(args); } @@ -50,7 +50,7 @@ { va_list args; va_start(args, cmd_); - initialize(0, NULL, WICONNECT_DEFAULT_TIMEOUT, NULL, NULL, cmd_, args); + initialize(0, NULL, WICONNECT_DEFAULT_TIMEOUT, ReaderFunc(), NULL, cmd_, args); va_end(args); }