TransmitXBeeSM
(On Main XBee PIC)
Initialize SPI communication
Psuedo Init State: goto ComposingMsgComposingMsg:
ControllerFound: prepare msg to be sent back to the controller, stating that you are under control,use address of the LUC that sent you the handshake
goto SendingMsg
CommandRec: prepare msg to be sent back to the controller, stating that you received the command, use address of the LUC that sent you the handshake
goto SendingMsg
SendingMsg
TransmitRegEmpty: write to TXREG
if not all bytes sent: post TransmitRegEmpty
if all bytes sent, set state to ComposingMsg
Timeout: set state to ComposingMsg
End