//Handle any valid data retrieved here
        void xbeePacketHandler_ValidDataGet(object sender, WATR_ValidDataGetArgs e)
        {
            //Log information
            db.LogReceivePacket(e.Data.RawData);

            //Figure out what type of packet it is and raise the proper event
            if (e.Data.GetFrameType() is WATR_XBeeRemoteATCommandResponseFrameData)
            {
                WATR_RemoteATCmdResponseGetArgs remoteATcmdResp = new WATR_RemoteATCmdResponseGetArgs(e.Data.GetFrameType());
                if (remoteATcmdResp != null)
                    ReceivedRemoteATCommandResponse(this, remoteATcmdResp);
            }
            else if (e.Data.GetFrameType() is WATR_XBeeATCommandFrameData)
            {
                WATR_ATCmdResponseGetArgs atCmdResp = new WATR_ATCmdResponseGetArgs(e.Data.GetFrameType());
                if (atCmdResp != null)
                    ReceivedATCmdResponse(this, atCmdResp);
            }
            else if (e.Data.GetFrameType() is WATR_XBeeReceivePacketFrameData)
            {
                WATR_RxPacketGetArgs rxFrameData = new WATR_RxPacketGetArgs(e.Data.GetFrameType());
                if (rxFrameData != null)
                    ReceivedRxPacket(this, rxFrameData);
            }
            else
            {
                WATR_TransmitStatusGetArgs transmitStatusGet = new WATR_TransmitStatusGetArgs(e.Data.GetFrameType());
                if (transmitStatusGet != null)
                    ReceivedTransmitStatus(this, transmitStatusGet);
            }
        }
Exemple #2
0
 void packetHandler_ReceivedTransmitStatus(object sender, WATR_TransmitStatusGetArgs e)
 {
     //Do nothing for now =D
     return;
 }