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.h
- Revision:
- 3:6b205ec8624b
- Parent:
- 1:3dc0ec2f9fd6
- Child:
- 4:a0f1fba6c2fb
--- a/Core/CoreAPI.h Thu Oct 22 22:22:12 2015 +0000 +++ b/Core/CoreAPI.h Mon Oct 26 18:04:12 2015 +0000 @@ -47,6 +47,9 @@ bool isEscapeMode; bool isRunning; bool isChecksum; + Timer timer; + + char waitFrameID; APIFrame * msg; XBeeRx64Indicator xBeeRx64Indicator; @@ -77,13 +80,13 @@ * @param data one byte [0x00-0xFF] */ void writeByte(char data); - + /// Processing API frame. void packetProcess(); - + /// Get the next avaliable API frame length. int getLength(); - + /// Read the next avaliable API frame data. void readPayLoad(int length); @@ -152,85 +155,132 @@ * @returns a API frame, NULL means data not avaliable. */ ATCommandIndicator * getATCommand(); - + /** Read the next avaliable API frame. * * @returns a API frame, NULL means data not avaliable. */ ModemStatusIndicator * getModemStatus(); - + /** Read the next avaliable API frame. * * @returns a API frame, NULL means data not avaliable. */ ZigBeeTxStatusIndicator * getZigBeeTxStatus(); - + /** Read the next avaliable API frame. * * @returns a API frame, NULL means data not avaliable. */ ZigBeeRxIndicator * getZigBeeRx(); - + /** Read the next avaliable API frame. * * @returns a API frame, NULL means data not avaliable. */ ZigBeeExplicitRxIndicator * getZigBeeExplicitRx(); - + /** Read the next avaliable API frame. * * @returns a API frame, NULL means data not avaliable. */ ZigBeeIOSampleIndicator * getZigBeeIOSample(); - + /** Read the next avaliable API frame. * * @returns a API frame, NULL means data not avaliable. */ SensorReadIndicator * getSensorRead(); - + /** Read the next avaliable API frame. * * @returns a API frame, NULL means data not avaliable. */ NodeIdentificationIndicator * getNodeIdentification(); - + /** Read the next avaliable API frame. * * @returns a API frame, NULL means data not avaliable. */ RemoteCommandIndicator * getRemoteCommand(); - + /** Read the next avaliable API frame. * * @returns a API frame, NULL means data not avaliable. */ RouteRecordIndicator * getRouteRecord(); - + /** Read the next avaliable API frame. * * @returns a API frame, NULL means data not avaliable. */ ManyToOneRouteIndicator * getManyToOneRoute(); + + XBeeTxStatusIndicator * sendXBeeTx16(Address * remoteAddress, OptionsBase * option, const char * payload, int offset, int length); + + XBeeTxStatusIndicator * sendXBeeTx64(Address * remoteAddress, OptionsBase * option, const char * payload, int offset, int length); + + ATCommandIndicator * sendATCommand(const char * command, bool applyChange, const 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); + + ZigBeeTxStatusIndicator * sendZigBeeTx(Address * remoteAddress, OptionsBase * option, const char * payload, int offset, int length); + + ZigBeeTxStatusIndicator * sendZigBeeExplicitTx(ExplicitAddress * remoteAddress, OptionsBase * option, const char * payload, int offset, int length); + + /** + * @param function + *DISABLED = 0x00, + *RESERVED_FOR_PIN_SPECIFIC_ALTERNATE_FUNCTIONALITIES = 0x01, + *ANALOG_INPUT_SINGLE_ENDED = 0x02, + *DIGITAL_INPUT_MONITORED = 0x03, + *DIGITAL_OUTPUT_DEFAULT_LOW = 0x04, + *DIGITAL_OUTPUT_DEFAULT_HIGH = 0x05, + *ALTERNATE_FUNCTIONALITIES_WHERE_APPLICABLE = 0x06//0x06~0x09 + */ + ATCommandIndicator * setPinFunction(Pin * pin, char function); + + ATCommandIndicator * setIODetection(Pin * pins, int size); + + /** + * @param function + *DISABLED = 0x00, + *RESERVED_FOR_PIN_SPECIFIC_ALTERNATE_FUNCTIONALITIES = 0x01, + *ANALOG_INPUT_SINGLE_ENDED = 0x02, + *DIGITAL_INPUT_MONITORED = 0x03, + *DIGITAL_OUTPUT_DEFAULT_LOW = 0x04, + *DIGITAL_OUTPUT_DEFAULT_HIGH = 0x05, + *ALTERNATE_FUNCTIONALITIES_WHERE_APPLICABLE = 0x06//0x06~0x09 + */ + RemoteCommandIndicator * setRemotePinFunction(Address * remoteAddress, Pin * pin, char function); + + RemoteCommandIndicator * setRemoteIODetection(Address * remoteAddress, Pin * pins, int size); + + /// <summary> + /// The command will immediately return an "OK" response. The data will follow in the normal API format for DIO data event. + /// </summary> + /// <returns>true if the command is "OK", false if no IO is enabled.</returns> + bool forceXBeeLocalIOSample(); + + /// <summary> + /// Return 1 IO sample from the local module. + /// </summary> + /// <returns></returns> + IOSamples * forceZigBeeLocalIOSample(); + + /// <summary> + /// Return 1 IO sample only, Samples before TX (IT) does not affect. + /// </summary> + /// <param name="remote"Remote address of the device></param> + /// <returns></returns> + IOSamples * forceXBeeRemoteIOSample(Address * remote); + + /// <summary> + /// Return 1 IO sample only. + /// </summary> + /// <param name="remote">Remote address of the device</param> + /// <returns></returns> + IOSamples * forceZigBeeRemoteIOSample(Address * remote); }; - - - - - - - - - - - - - - - - - - - -#endif \ No newline at end of file +#endif