User Manual
XBee® Wi-Fi RF Modules
© 2012 Digi International, Inc. 63
Supporting the API
Applications that support the API should make provisions to deal with new API frames
that may be introduced in future releases. For example, a section of code on a host
microprocessor that handles received serial API frames (sent out the module's DOUT
pin) might look like this:
void XBee_HandleRxAPIFrame(_apiFrameUnion *papiFrame){
switch(papiFrame->api_id){
case RX_RF_DATA_FRAME:
//process received RF data frame break;
case RX_IO_SAMPLE_FRAME:
//process IO sample frame break;
default:
//Discard any other API frame types that are not being used break;
}
}