Other core methods.
More...
Other core methods.
void wiconnect::Wiconnect::flush |
( |
int |
delayMs = 500 | ) |
|
Flush any received data in serial RX buffer and terminate any commands on WiConnect WiFi module.
The delayMs parameter is used as the delay between terminating commands on the module and flushing the serial RX buffer. This is needed because after terminating commands on the module, the module will returns a response. These responses are invalid at this point and should be flushed from the serial RX buffer.
- Parameters
-
[in] | delayMs | Optional, if not specificed this only flushes the serial RX buffer. |
static Wiconnect* wiconnect::Wiconnect::getInstance |
( |
| ) |
|
|
static |
Get instance of previously instantiated Wiconnect Library.
- Returns
- Pointer to instance of Wiconnect Library.
const char* wiconnect::Wiconnect::getLastCommandResponseCodeStr |
( |
| ) |
|
When the WiConnect WiFi module returns a response, it contains a response code in the header. This function converts the previous response code to a readable string.
- Returns
- string representation of module response code
uint16_t wiconnect::Wiconnect::getLastCommandResponseLength |
( |
| ) |
|
Return the length in bytes of the previous response.
- Returns
- length of previous response
char* wiconnect::Wiconnect::getResponseBuffer |
( |
| ) |
|
Return pointer to internal response buffer.
- Returns
- pointer to internal response buffer
WiconnectResult wiconnect::Wiconnect::getVersion |
( |
char * |
versionBuffer = NULL , |
|
|
int |
versionBufferSize = 0 , |
|
|
const Callback & |
completeCallback = Callback() |
|
) |
| |
Return current version of WiConnect WiFi module.
- Parameters
-
[in] | versionBuffer | Optional, Buffer to hold received version string |
[in] | versionBufferSize | Optional, required if versionBuffer specified. |
[in] | completeCallback | Optional, callback when version is received. arg1 of callback contains version buffer pointer. |
- Returns
- Result of method. See WiconnectResult
Initialize library and communication link with WiConnect WiFi module.
- Note
- This function is always blocking regardless of configured mode.
- Parameters
-
[in] | bringNetworkUp | Flag indicating if the module should try to bring the network up upon initialization. |
- Returns
- Result of initialization. See WiconnectResult
bool wiconnect::Wiconnect::isInitialized |
( |
| ) |
|
Return TRUE if library is able to communicated with WiConnect WiFi module. FALSE else.
- Returns
- TRUE if library can communicate with WiFi module, FALSE else.
Toggle the WiConnect WiFi module reset signal.
- Note
- This only resets the module if the library was instantiated with the 'reset' pin parameter in the Wiconnect::Wiconnect constructor.
-
This method is always blocking. A small (1s) delay is added to ensure the module has returned from reset and ready.
- Returns
- Result of method. See WiconnectResult
WiconnectResult wiconnect::Wiconnect::responseToInt32 |
( |
int32_t * |
int32Ptr | ) |
|
Helper method to convert previous response to int32.
- Note
- This uses the internal response buffer.
- Parameters
-
[out] | int32Ptr | Pointer to hold result of conversion. |
- Returns
- Result of conversion. See WiconnectResult
WiconnectResult wiconnect::Wiconnect::responseToUint32 |
( |
uint32_t * |
uint32Ptr | ) |
|
Helper method to convert previous response to uint32.
- Note
- This uses the internal response buffer.
- Parameters
-
[out] | uint32Ptr | Pointer to hold result of conversion. |
- Returns
- Result of conversion. See WiconnectResult
WiconnectResult wiconnect::Wiconnect::updateFirmware |
( |
bool |
forced = false , |
|
|
const char * |
versionStr = NULL , |
|
|
const Callback & |
completeCallback = Callback() |
|
) |
| |
Update the wifi module's internal firmware.
- Parameters
-
[in] | forced | Optional, If true, force update of all firmware files to latest version, else only update out-dated files. |
[in] | versionStr | Optional, If specified, update to specific firmware version, else update to latest version. |
[in] | completeCallback | Optional, callback when update is complete. 'result' callback argument contains result of update. |
- Returns
- Result of method. See WiconnectResult
Toggle the WiConnect WiFi moduel wakeup signal.
- Note
- This only wakes the module if the library was instantiated with the 'wake' pin parameter in the Wiconnect::Wiconnect constructor.
-
This method is always blocking.
- Returns
- Result of method. See WiconnectResult