![Global Specialties RP6-M256 Instruction Manual Download Page 39](http://html1.mh-extra.com/html/global-specialties/rp6-m256/rp6-m256_instruction-manual_2233250039.webp)
RP6 ROBOT SYSTEM - 4. RP6 CONTROL M256 WIFI Library
If you want to wait for an answer of the WLAN module, you can use one of the two
following functions.
int8_t waitCharResponse_WIFI(char response, uint32_t timeout)
will wait for a single character (char response). And
int8_t waitResponse_WIFI(char * response, uint32_t timeout)
will wait for a complete string. For both functions you can set a timeout (is currently a
simple counter without a fixed time reference).
You can also send commands by
int8_t issueCMD_WIFI(char * cmd, char * response)
to the WLAN module. The above function does a lot automatically. The command is
sent and a reply is awaited. If this doesn't arrive, 3 further attempts are made. Return
value is 1 if successful and 0 if failure.
All these functions are blocking, therefore you should use them with care! If a com-
mand fails (e.g. because the WLAN module was just busy with something else), long
delays might occur.
For more complex programs, you might need non blocking variants. In this case you
have to work manually with normal writeChar_WIFI and writeString_WIFI functions
and integrate them into your own programs.
Tip:
You can switch the WLAN module into command mode via network
connection or via serial interface. However only ONE of the two inter-
faces can be active at the same time, never both together.
The RobotLoader uses the network connection to send commands to
the module (e.g. to trigger a reset of the microcontroller and query the
signal strength).
You should build your own programs in such a way that you switch into
command mode only for short periods and quit it as quickly as possible.
Otherwise you might have to launch quite a few trials until the Robot-
Loader gains control over the module or you might even have to push
the reset button manually.
- 39 -