Revision: 1.18
CrossFire IX – Freely Programmable - Data Logger Edition -
Programming Manual
2018-12-21
13
void WIFI_Init(WIFISerialBaudrate
baudRate);
Initialize WIFI module
unsigned long
WIFI_SendString(char* data);
Send string to WIFI processor over USART. It is up to the
WIFI processor what to do with the data.
unsigned long WIFI_Send(unsigned
char* data, int len);
Send data to WIFI processor over USART. It is up to the WIFI
processor what to do with the data. This call will not block.
unsigned long
WIFI_SendSync(unsigned char* data,
int len, int timeoutMS);
Send data to WIFI processor over USART. It is up to the WIFI
processor what to do with the data. This call will block until
data is sent or timeout occurs.
void WIFI_Reset(void);
Reset the WIFI circuit
void WIFI_KeepInReset(void);
Reset the WIFI circuit and keep it in reset. Call WIFI_Reset to
start again.
BOOL WIFI_GetMessagePtr(unsigned
char **buf, unsigned long *len,
UsartFlagsEnum* flags);
Get message from WIFI message buffer. Note that the message
is not copied, you get direct access to the usart buffer slot (for
performance reason)
BOOL WIFI_GetMessage(unsigned
char* buf, unsigned long *len,
UsartFlagsEnum* flags);
Get message from WIFI message buffer. The message is copied
to the buffer and should not be freed with
WIFI_FreeLastMessage afterwards.
void WIFI_FreeLastMessage(void);
Free the last message in the message queue. Must be called
after you have processed data returned by
WIFI_GetMessagePtr.
16.
Examples
The CrossFire IX freely programmable Data Logger Edition is delivered with several examples. The
examples are made in Atollic TrueSTUDIO IDE/Arduino IDE but can be converted to IAR
Embedded Workbench if desired. The examples are divided in two parts. One part is running on
the IX main processor and one part is running on the Wi-Fi slave processor.
Note that all examples need additional testing and error management to be used as products.
16.1.
The CANWifiGateway example
The CANWIFIGateway example shows how to read CAN messages from the CAN bus and send
them over Wi-Fi and vice versa. Data is sent with UDP for best performance. Data can be sent to a
PC running CrossFire IX Wi-Fi Tool, another CrossFire IX or any other unit supporting UDP. If
connecting two IXs together, one IX must not set up an access point but connect to the other IX, or
both IXs must connect to the same router.
To run the example, make sure to compile and install the corresponding software on the Wi-Fi
module.
When starting the application the CrossFire IX will set up an access point. Use password
“password001” to connect. The CrossFire IX will use IP address 192.168.4.1 and will give the first
connected unit IP address 192.168.4.2