Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CircularBuffer FixedLengthList
Dependents: XBeeApiTest XBeeApiSimpleATCmdsExample XBeeApiBroadcastExample XBeeApiBroadcastExampleRTOS ... more
Remote/XBeeDeviceRemoteAt.hpp@51:a7d0d2ef9261, 2014-07-28 (annotated)
- Committer:
- johnb
- Date:
- Mon Jul 28 10:24:16 2014 +0000
- Revision:
- 51:a7d0d2ef9261
- Parent:
- 50:f76b7e7959a2
- Child:
- 52:0950b05d5270
Additional infrastructure for AT & remote AT commands.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| johnb | 50:f76b7e7959a2 | 1 | /** |
| johnb | 50:f76b7e7959a2 | 2 | @file |
| johnb | 50:f76b7e7959a2 | 3 | @brief Class to provide an abstract representation of a remote |
| johnb | 50:f76b7e7959a2 | 4 | XBee device's AT command interface |
| johnb | 50:f76b7e7959a2 | 5 | |
| johnb | 50:f76b7e7959a2 | 6 | @author John Bailey |
| johnb | 50:f76b7e7959a2 | 7 | |
| johnb | 50:f76b7e7959a2 | 8 | @copyright Copyright 2014 John Bailey |
| johnb | 50:f76b7e7959a2 | 9 | |
| johnb | 50:f76b7e7959a2 | 10 | @section LICENSE |
| johnb | 50:f76b7e7959a2 | 11 | |
| johnb | 50:f76b7e7959a2 | 12 | Licensed under the Apache License, Version 2.0 (the "License"); |
| johnb | 50:f76b7e7959a2 | 13 | you may not use this file except in compliance with the License. |
| johnb | 50:f76b7e7959a2 | 14 | You may obtain a copy of the License at |
| johnb | 50:f76b7e7959a2 | 15 | |
| johnb | 50:f76b7e7959a2 | 16 | http://www.apache.org/licenses/LICENSE-2.0 |
| johnb | 50:f76b7e7959a2 | 17 | |
| johnb | 50:f76b7e7959a2 | 18 | Unless required by applicable law or agreed to in writing, software |
| johnb | 50:f76b7e7959a2 | 19 | distributed under the License is distributed on an "AS IS" BASIS, |
| johnb | 50:f76b7e7959a2 | 20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| johnb | 50:f76b7e7959a2 | 21 | See the License for the specific language governing permissions and |
| johnb | 50:f76b7e7959a2 | 22 | limitations under the License. |
| johnb | 50:f76b7e7959a2 | 23 | |
| johnb | 50:f76b7e7959a2 | 24 | */ |
| johnb | 50:f76b7e7959a2 | 25 | |
| johnb | 50:f76b7e7959a2 | 26 | #if !defined XBEEDEVICEREMOTEAT_HPP |
| johnb | 50:f76b7e7959a2 | 27 | #define XBEEDEVICEREMOTEAT_HPP |
| johnb | 50:f76b7e7959a2 | 28 | |
| johnb | 50:f76b7e7959a2 | 29 | #include "XBeeApiCfg.hpp" |
| johnb | 50:f76b7e7959a2 | 30 | #include "XBeeApiFrame.hpp" |
| johnb | 50:f76b7e7959a2 | 31 | #include "XBeeApiCmdAt.hpp" |
| johnb | 50:f76b7e7959a2 | 32 | |
| johnb | 50:f76b7e7959a2 | 33 | /** */ |
| johnb | 50:f76b7e7959a2 | 34 | class XBeeDeviceRemoteAt : public XBeeApiCmdAt |
| johnb | 50:f76b7e7959a2 | 35 | { |
| johnb | 50:f76b7e7959a2 | 36 | protected: |
| johnb | 50:f76b7e7959a2 | 37 | /** Called by XBeeDevice in order to offer frame data to the object for |
| johnb | 50:f76b7e7959a2 | 38 | decoding |
| johnb | 50:f76b7e7959a2 | 39 | |
| johnb | 50:f76b7e7959a2 | 40 | \param p_data Pointer to the content of the received data |
| johnb | 50:f76b7e7959a2 | 41 | \param p_len Length of the data pointed to by p_data |
| johnb | 50:f76b7e7959a2 | 42 | */ |
| johnb | 50:f76b7e7959a2 | 43 | virtual bool decodeCallback( const uint8_t* const p_data, size_t p_len ); |
| johnb | 50:f76b7e7959a2 | 44 | |
| johnb | 50:f76b7e7959a2 | 45 | virtual void SendCmd_uint8_t( const uint8_t p_frameId, |
| johnb | 50:f76b7e7959a2 | 46 | const uint8_t* const p_data, |
| johnb | 50:f76b7e7959a2 | 47 | const uint8_t& p_val ); |
| johnb | 50:f76b7e7959a2 | 48 | virtual void SendCmd_uint16_t( const uint8_t p_frameId, |
| johnb | 50:f76b7e7959a2 | 49 | const uint8_t* const p_data, |
| johnb | 50:f76b7e7959a2 | 50 | const uint16_t& p_val ); |
| johnb | 51:a7d0d2ef9261 | 51 | virtual void SendCmd_uint32_t( const uint8_t p_frameId, |
| johnb | 51:a7d0d2ef9261 | 52 | const uint8_t* const p_data, |
| johnb | 51:a7d0d2ef9261 | 53 | const uint32_t& p_val ); |
| johnb | 50:f76b7e7959a2 | 54 | virtual void SendReq( const uint8_t p_frameId, |
| johnb | 50:f76b7e7959a2 | 55 | const uint8_t* p_data ); |
| johnb | 50:f76b7e7959a2 | 56 | |
| johnb | 50:f76b7e7959a2 | 57 | virtual size_t getResponseStatusPos( void ) const; |
| johnb | 50:f76b7e7959a2 | 58 | |
| johnb | 50:f76b7e7959a2 | 59 | uint16_t m_addr16Bit; |
| johnb | 50:f76b7e7959a2 | 60 | uint64_t m_addr64Bit; |
| johnb | 51:a7d0d2ef9261 | 61 | bool m_applyChanges; |
| johnb | 50:f76b7e7959a2 | 62 | |
| johnb | 50:f76b7e7959a2 | 63 | public: |
| johnb | 50:f76b7e7959a2 | 64 | /** Constructor */ |
| johnb | 50:f76b7e7959a2 | 65 | XBeeDeviceRemoteAt( XBeeDevice* p_device, |
| johnb | 50:f76b7e7959a2 | 66 | const uint16_t& p_addr16Bit, |
| johnb | 51:a7d0d2ef9261 | 67 | const uint64_t& p_addr64Bit = 0, |
| johnb | 51:a7d0d2ef9261 | 68 | const bool p_applyChanges = false ); |
| johnb | 50:f76b7e7959a2 | 69 | |
| johnb | 50:f76b7e7959a2 | 70 | /** Destructor */ |
| johnb | 50:f76b7e7959a2 | 71 | virtual ~XBeeDeviceRemoteAt( void ); |
| johnb | 51:a7d0d2ef9261 | 72 | |
| johnb | 51:a7d0d2ef9261 | 73 | void setApplyChanges( const bool p_apply ); |
| johnb | 50:f76b7e7959a2 | 74 | }; |
| johnb | 50:f76b7e7959a2 | 75 | |
| johnb | 50:f76b7e7959a2 | 76 | #endif |