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.
Diff: Core/CoreAPI.cpp
- Revision:
- 6:5f31ddc17239
- Parent:
- 4:a0f1fba6c2fb
--- a/Core/CoreAPI.cpp Thu Nov 05 23:03:42 2015 +0000 +++ b/Core/CoreAPI.cpp Sat Nov 14 16:42:36 2015 +0000 @@ -74,7 +74,7 @@ return value; } -void CoreAPI::writeByte(char data) +void CoreAPI::writeByte(unsigned char data) { if (isEscapeMode) { if (data == KEY || data == ESCAPED || data == XON || data == XOFF) { @@ -288,7 +288,7 @@ else return NULL; } -XBeeTxStatusIndicator * CoreAPI::sendXBeeTx16(Address * remoteAddress, OptionsBase * option, const char * payload, int offset, int length) +XBeeTxStatusIndicator * CoreAPI::sendXBeeTx16(Address * remoteAddress, OptionsBase * option, const unsigned char * payload, int offset, int length) { if (!isRunning) return NULL; @@ -328,7 +328,7 @@ return NULL; } -XBeeTxStatusIndicator * CoreAPI::sendXBeeTx64(Address * remoteAddress, OptionsBase * option, const char * payload, int offset, int length) +XBeeTxStatusIndicator * CoreAPI::sendXBeeTx64(Address * remoteAddress, OptionsBase * option, const unsigned char * payload, int offset, int length) { if (!isRunning) return NULL; @@ -367,7 +367,7 @@ return NULL; } -ATCommandIndicator * CoreAPI::sendATCommand(const char * command, bool applyChange, const char * parameter, int offset, int length) +ATCommandIndicator * CoreAPI::sendATCommand(const char * command, bool applyChange, const unsigned char * parameter, int offset, int length) { waitFrameID++; if (waitFrameID == 0) @@ -378,7 +378,8 @@ msg->set(APIFrame::AT_Command); else msg->set(APIFrame::AT_Command_Queue_Parameter_Value); msg->set(waitFrameID); - msg->sets(command, 0 , 2); + msg->set(command[0]); + msg->set(command[1]); if (parameter != NULL) msg->sets(parameter, offset, length); @@ -405,7 +406,7 @@ return NULL; } -RemoteCommandIndicator * CoreAPI::sendRemoteATCommand(Address * remoteAddress, const char * command, OptionsBase * transmitOptions, const char * parameter, int parameterOffset, int parameterLength) +RemoteCommandIndicator * CoreAPI::sendRemoteATCommand(Address * remoteAddress, const char * command, OptionsBase * transmitOptions, const unsigned char * parameter, int parameterOffset, int parameterLength) { waitFrameID++; if (waitFrameID == 0) @@ -417,7 +418,8 @@ msg->sets(remoteAddress->getAddressValue(), 0, 10); msg->set(transmitOptions->getValue()); - msg->sets(command, 0, 2); + msg->set(command[0]); + msg->set(command[1]); if (parameter != NULL) msg->sets(parameter, parameterOffset, parameterLength); @@ -445,7 +447,7 @@ return NULL; } -ZigBeeTxStatusIndicator * CoreAPI::sendZigBeeTx(Address * remoteAddress, OptionsBase * option, const char * payload, int offset, int length) +ZigBeeTxStatusIndicator * CoreAPI::sendZigBeeTx(Address * remoteAddress, OptionsBase * option, const unsigned char * payload, int offset, int length) { waitFrameID++; if (waitFrameID == 0) @@ -482,7 +484,7 @@ return NULL; } -ZigBeeTxStatusIndicator * CoreAPI::sendZigBeeExplicitTx(ExplicitAddress * remoteAddress, OptionsBase * option, const char * payload, int offset, int length) +ZigBeeTxStatusIndicator * CoreAPI::sendZigBeeExplicitTx(ExplicitAddress * remoteAddress, OptionsBase * option, const unsigned char * payload, int offset, int length) { waitFrameID++; if (waitFrameID == 0) @@ -520,7 +522,7 @@ return NULL; } -ATCommandIndicator * CoreAPI::setPinFunction(Pin * pin, char function) +ATCommandIndicator * CoreAPI::setPinFunction(Pin * pin, unsigned char function) { return sendATCommand(pin->getCommand(), true, &function, 0 , 1); } @@ -530,7 +532,7 @@ return sendATCommand(ATCommands::Digital_IO_Change_Detection, true, Pin::IOChangeDetectionConfiguration(pins, size)); } -RemoteCommandIndicator * CoreAPI::setRemotePinFunction(Address * remoteAddress, Pin * pin, char function) +RemoteCommandIndicator * CoreAPI::setRemotePinFunction(Address * remoteAddress, Pin * pin, unsigned char function) { return sendRemoteATCommand(remoteAddress, pin->getCommand(), RemoteCommandOptions::ApplyChanges, &function, 0 , 1); }