xBeeAppEscapingMode.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef __XBEE_ESCAPING_H_
  2. #define __XBEE_ESCAPING_H_
  3. //0x10帧格式
  4. typedef struct frameForMat {
  5. unsigned char frameHead;//帧头
  6. unsigned int frameLen;//数据长度Number of bytes between length and checksum fields.
  7. unsigned char frameType;//帧类型,Transmit Request
  8. unsigned char frameID;//
  9. unsigned char des64DeviceAdd[8];//器件ID
  10. unsigned int des16NetAdd;//网络ID
  11. unsigned char broadcastRadius;//广播半径
  12. unsigned char transmitOptions;//发送选项
  13. } fRameFORMAT_t;
  14. //RX,frameType 0x90帧格式
  15. typedef struct frameForMat0x90 {
  16. unsigned char frameHead;//帧头
  17. unsigned int frameLen;//数据长度Number of bytes between length and checksum fields.
  18. unsigned char frameType;//帧类型,Transmit Request
  19. unsigned char frameID;//
  20. unsigned char source64DeviceAdd[8];//器件ID
  21. unsigned int source16NetAdd;//网络ID
  22. unsigned char receiveOptions;//接收选项
  23. } fRAME_0x90_RECEIVE_FORMAT_t;
  24. //RX,frameType 0x91帧格式
  25. typedef struct frameForMat0x91 {
  26. unsigned char frameHead;//帧头
  27. unsigned int frameLen;//数据长度Number of bytes between length and checksum fields.
  28. unsigned char frameType;//帧类型,Transmit Request
  29. unsigned char source64DeviceAdd[8];//器件ID
  30. unsigned int source16NetAdd;//网络ID
  31. unsigned char sourceEndpoint;
  32. unsigned char destinationEndpoint;
  33. unsigned int clusterID;
  34. unsigned int proFileID;
  35. unsigned char receiveOptions;//接收选项
  36. } fRAME_0x91_RECEIVE_FORMAT_t;
  37. //remote AT command 0x17帧格式
  38. typedef struct frameForMat0x17 {
  39. unsigned char frameHead;//帧头
  40. unsigned int frameLen;//数据长度Number of bytes between length and checksum fields.
  41. unsigned char frameType;//帧类型,Transmit Request
  42. unsigned char frameID;//
  43. unsigned char des64DeviceAdd[8];//器件ID
  44. unsigned int des16NetAdd;//网络ID
  45. unsigned char remoteCommandOptions;
  46. unsigned int ATCommand;
  47. unsigned char commandParameter;
  48. } fRAME_0x17_REMOTE_FORMAT_t;
  49. //***********************************************************************************
  50. //***********************************************************************************
  51. extern fRameFORMAT_t userSendFrame_t;//发送时候帧格式初始化
  52. extern fRAME_0x90_RECEIVE_FORMAT_t comeFromWhom0x90Frame_t;//接收0x90时候帧格式
  53. extern fRAME_0x91_RECEIVE_FORMAT_t comeFromWhom0x91Frame_t;//接收0x91时候帧格式
  54. extern fRAME_0x17_REMOTE_FORMAT_t atRemoteCommand0x17Frame_t;//远程命令帧
  55. extern unsigned char* xBeeApp2MakeFrame(fRameFORMAT_t *sendFrameFormat,unsigned char* buf);//返回一个处理完成后的数组的首地址
  56. extern unsigned char* xBeeApp2UnEscaping0x90Mode(unsigned char* buf);//返回一个处理完成后的数组的首地址
  57. extern unsigned char* xBeeApp2UnEscaping0x91Mode(unsigned char* buf);//返回一个处理完成后的数组的首地址
  58. extern unsigned char* xBeeApp2RemoteFrame(void);//远程命令付值,返回赋值后的数组
  59. #endif