API operation Supporting the API
XBee/XBee-PRO ZigBee RF Modules User Guide 114
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:
voidXBee_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;
}
}