XBee and XBee-PRO ZigBee RF modules provide cost-effective wireless connectivity to electronic devices. They are interoperable with other ZigBee PRO feature set devices, including devices from other vendors.

Dependencies:   BufferedArray

Dependents:   MBEDminiproject

Revision:
6:5f31ddc17239
Parent:
4:a0f1fba6c2fb
--- a/Core/CoreAPI.h	Thu Nov 05 23:03:42 2015 +0000
+++ b/Core/CoreAPI.h	Sat Nov 14 16:42:36 2015 +0000
@@ -39,11 +39,11 @@
 class CoreAPI
 {
 private:
-    static const char KEY = 0x7E;
-    static const char ESCAPED = 0x7D;
-    static const char XON = 0x11;
-    static const char XOFF = 0x13;
-    static const int INITIAL_FRAME_LENGTH = 100;
+    static const unsigned char KEY = 0x7E;
+    static const unsigned char ESCAPED = 0x7D;
+    static const unsigned char XON = 0x11;
+    static const unsigned char XOFF = 0x13;
+    static const unsigned int INITIAL_FRAME_LENGTH = 10;
 
     ISerial * serial;
     bool isEscapeMode;
@@ -51,7 +51,7 @@
     bool isChecksum;
     Timer timer;
 
-    char waitFrameID;
+    unsigned char waitFrameID;
 
     APIFrame * msg;
     XBeeRx64Indicator xBeeRx64Indicator;
@@ -81,7 +81,7 @@
     /** Write one byte to the payload, which allready handle the escape char.
     * @param data one byte [0x00-0xFF]
     */
-    void writeByte(char data);
+    void writeByte(unsigned  char data);
 
     /// Processing API frame.
     void packetProcess();
@@ -218,17 +218,17 @@
     */
     ManyToOneRouteIndicator * getManyToOneRoute();
     
-    XBeeTxStatusIndicator * sendXBeeTx16(Address * remoteAddress, OptionsBase * option, const char * payload, int offset, int length);
+    XBeeTxStatusIndicator * sendXBeeTx16(Address * remoteAddress, OptionsBase * option, const unsigned char * payload, int offset, int length);
 
-    XBeeTxStatusIndicator * sendXBeeTx64(Address * remoteAddress, OptionsBase * option, const char * payload, int offset, int length);
+    XBeeTxStatusIndicator * sendXBeeTx64(Address * remoteAddress, OptionsBase * option, const unsigned char * payload, int offset, int length);
 
-    ATCommandIndicator * sendATCommand(const char * command, bool applyChange, const char * parameter = NULL, int offset = 0, int length = 0);
+    ATCommandIndicator * sendATCommand(const char * command, bool applyChange, const unsigned  char * parameter = NULL, int offset = 0, int length = 0);
 
-    RemoteCommandIndicator * sendRemoteATCommand(Address * remoteAddress, const char * command, OptionsBase * transmitOptions, const char * parameter = NULL, int parameterOffset = 0, int parameterLength = 0);
+    RemoteCommandIndicator * sendRemoteATCommand(Address * remoteAddress, const char * command, OptionsBase * transmitOptions, const unsigned  char * parameter = NULL, int parameterOffset = 0, int parameterLength = 0);
 
-    ZigBeeTxStatusIndicator * sendZigBeeTx(Address * remoteAddress, OptionsBase * option, const char * payload, int offset, int length);
+    ZigBeeTxStatusIndicator * sendZigBeeTx(Address * remoteAddress, OptionsBase * option, const unsigned  char * payload, int offset, int length);
 
-    ZigBeeTxStatusIndicator * sendZigBeeExplicitTx(ExplicitAddress * remoteAddress, OptionsBase * option, const char * payload, int offset, int length);
+    ZigBeeTxStatusIndicator * sendZigBeeExplicitTx(ExplicitAddress * remoteAddress, OptionsBase * option, const unsigned  char * payload, int offset, int length);
 
     /**
     * @param function
@@ -240,7 +240,7 @@
     * DIGITAL_OUTPUT_DEFAULT_HIGH = 0x05,
     * ALTERNATE_FUNCTIONALITIES_WHERE_APPLICABLE = 0x06//0x06~0x09
     */
-    ATCommandIndicator * setPinFunction(Pin * pin, char function);
+    ATCommandIndicator * setPinFunction(Pin * pin, unsigned  char function);
 
     ATCommandIndicator * setIODetection(Pin ** pins, int size);
 
@@ -254,7 +254,7 @@
     * DIGITAL_OUTPUT_DEFAULT_HIGH = 0x05,
     * ALTERNATE_FUNCTIONALITIES_WHERE_APPLICABLE = 0x06//0x06~0x09
     */
-    RemoteCommandIndicator * setRemotePinFunction(Address * remoteAddress, Pin * pin, char function);
+    RemoteCommandIndicator * setRemotePinFunction(Address * remoteAddress, Pin * pin, unsigned char function);
 
     RemoteCommandIndicator * setRemoteIODetection(Address * remoteAddress, Pin ** pins, int size);