ACKme Logo WiConnect Host Library- API Reference Guide
 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Miscellaneous Methods

Other core methods. More...

Functions

static Wiconnectwiconnect::Wiconnect::getInstance ()
 Get instance of previously instantiated Wiconnect Library. More...
 
WiconnectResult wiconnect::Wiconnect::init (bool bringNetworkUp=false)
 Initialize library and communication link with WiConnect WiFi module. More...
 
void wiconnect::Wiconnect::deinit ()
 De-initialize library.
 
bool wiconnect::Wiconnect::isInitialized ()
 Return TRUE if library is able to communicated with WiConnect WiFi module. FALSE else. More...
 
bool wiconnect::Wiconnect::updateRequired ()
 Return TRUE if the WiFi module's firmware supports the SDK version, FALSE if the WiFi module's firmware needs to be updated. See updateFirmware() to update the module's firmware. More...
 
WiconnectResult wiconnect::Wiconnect::reset ()
 Toggle the WiConnect WiFi module reset signal. More...
 
WiconnectResult wiconnect::Wiconnect::wakeup ()
 Toggle the WiConnect WiFi moduel wakeup signal. More...
 
void wiconnect::Wiconnect::flush (int delayMs=500)
 Flush any received data in serial RX buffer and terminate any commands on WiConnect WiFi module. More...
 
WiconnectResult wiconnect::Wiconnect::getVersion (char *versionBuffer=NULL, int versionBufferSize=0, const Callback &completeCallback=Callback())
 Return current version of WiConnect WiFi module. More...
 
WiconnectResult wiconnect::Wiconnect::updateFirmware (bool forced=false, const char *versionStr=NULL, const Callback &completeCallback=Callback())
 Update the wifi module's internal firmware. More...
 
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. More...
 
uint16_t wiconnect::Wiconnect::getLastCommandResponseLength ()
 Return the length in bytes of the previous response. More...
 
char * wiconnect::Wiconnect::getResponseBuffer ()
 Return pointer to internal response buffer. More...
 
WiconnectResult wiconnect::Wiconnect::responseToUint32 (uint32_t *uint32Ptr)
 Helper method to convert previous response to uint32. More...
 
WiconnectResult wiconnect::Wiconnect::responseToInt32 (int32_t *int32Ptr)
 Helper method to convert previous response to int32. More...
 

Detailed Description

Other core methods.

Function Documentation

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]delayMsOptional, 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]versionBufferOptional, Buffer to hold received version string
[in]versionBufferSizeOptional, required if versionBuffer specified.
[in]completeCallbackOptional, callback when version is received. arg1 of callback contains version buffer pointer.
Returns
Result of method. See WiconnectResult
WiconnectResult wiconnect::Wiconnect::init ( bool  bringNetworkUp = false)

Initialize library and communication link with WiConnect WiFi module.

Note
This function is always blocking regardless of configured mode.
Parameters
[in]bringNetworkUpFlag 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.
WiconnectResult wiconnect::Wiconnect::reset ( )

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]int32PtrPointer 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]uint32PtrPointer 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]forcedOptional, If true, force update of all firmware files to latest version, else only update out-dated files.
[in]versionStrOptional, If specified, update to specific firmware version, else update to latest version.
[in]completeCallbackOptional, callback when update is complete. 'result' callback argument contains result of update.
Returns
Result of method. See WiconnectResult
bool wiconnect::Wiconnect::updateRequired ( )

Return TRUE if the WiFi module's firmware supports the SDK version, FALSE if the WiFi module's firmware needs to be updated. See updateFirmware() to update the module's firmware.

Returns
TRUE WiFi firmware version is supported, FALSE else
WiconnectResult wiconnect::Wiconnect::wakeup ( )

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