RP6 ROBOT SYSTEM - 4. RP6 CONTROL M256 WIFI Library
4.1.10. WIFI Library
The WIFI Library offers a few helper functions to communicate with the WLAN module.
4.1.10.1. Data Communication
Basically sending data works almost exactly as with a normal UART, except that the
functions have a _WIFI extension at the end:
void writeChar_WIFI(char ch)
void writeString_WIFI(char *string)
void writeStringLength_WIFI(char *data, uint8_t length, uint8_t offset)
void writeInteger_WIFI(int16_t number, uint8_t base)
void writeIntegerLength_WIFI(int16_t number, uint8_t base, uint8_t length)
To write and
void clearReceptionBuffer_WIFI(void)
uint16_t getBufferLength_WIFI(void)
char readChar_WIFI(void)
uint16_t readChars_WIFI(char *buf, uint16_t numberOfChars)
to read.
However there is a small specialty in the writeChar_WIFI function (and therefore in all
other functions that use this function): It supports data flow control and might there-
fore block if the WLAN module takes more time to send a packet via the network. You
must take this into account in your own programs.
For the rest, it works just as the functions already known from the RP6. Therefore we
will explain only the additional functions here.
A small example should be sufficient:
writeString_P_WIFI("Hello Echo!\n");
Sends the constant text “Hello Echo!” with line break to the WLAN module that trans-
mits it via WLAN. So the text will appear in the terminal of RobotLoader.
writeChar_WIFI('A');
Sends the ASCII character A.
uint8_t test = 42;
writeInteger_WIFI(test,DEC);
Sends the numerical value of the test variable in decimal format as ASCII text, in this
case 42.
You will find many more details in the example programs. The reception of text is il-
lustrated in the example programs and also explained in the other RP6 example pro-
grams.
Please also check the normal RP6 documentation and examples for further details on
the UART functions which work almost identical!
- 37 -