SADSD
Dependencies: DigiLogger
Fork of XBeeLib_vs by
AtCmdFrame Class Reference
Class for the AT command api frames. More...
#include <AtCmdFrame.h>
Inherits ApiFrame.
Public Types | |
enum | AtCmdResp { AtCmdRespOk = 0, AtCmdRespError = 1, AtCmdRespInvalidCmd = 2, AtCmdRespInvalidParam = 3, AtCmdRespTxFailure = 4, AtCmdRespLenMismatch = 0xfd, AtCmdRespInvalidAddr = 0xfe, AtCmdRespTimeout = 0xff } |
AtCmdResp. More... | |
enum | ModemStatus { HwReset = 0, WdReset = 1, JoinedNW = 2, Disassociated = 3, SyncLost = 4, CoordRealign = 5, CoordStarted = 6, NwSecKeyUpdated = 7, NwWokeUp = 0x0B, NwToSleep = 0x0C, VccExceeded = 0x0D, ModConfChangeJoinInProg = 0x11 } |
ModemStatus. More... | |
enum | ApiFrameType { TxReq64Bit = 0x00, TxReq16Bit = 0x01, AtCmd = 0x08, AtCmdQueuePV = 0x09, TxReqZBDM = 0x10, ExpAddrCmd = 0x11, RemoteCmdReq = 0x17, CreateSrcRoute = 0x21, RxPacket64Bit = 0x80, RxPacket16Bit = 0x81, Io64Bit = 0x82, Io16Bit = 0x83, AtCmdResp = 0x88, TxStatus = 0x89, AtModemStatus = 0x8A, TxStatusZBDM = 0x8B, RouteInfo = 0x8D, AggregateAddr = 0x8E, RxPacketAO0 = 0x90, RxPacketAO1 = 0x91, IoSampleRxZBDM = 0x92, SensorRxIndAO0 = 0x94, NodeIdentIndAO0 = 0x95, RemoteCmdResp = 0x97, OtaFwUpStatus = 0xA0, RouteRecInd = 0xA1, Many2OneRRInd = 0xA3, Invalid = ~0 } |
List of API frames. More... | |
Public Member Functions | |
AtCmdFrame (const char *const cmd, const uint32_t cmd_param) | |
Class constructor. | |
AtCmdFrame (const char *const cmd, const uint8_t *cmd_param=NULL, uint16_t param_len=0) | |
Class constructor. | |
AtCmdFrame (uint64_t remote, const char *const cmd, uint32_t cmd_param) | |
Class constructor. | |
AtCmdFrame (uint64_t remote, const char *const cmd, const uint8_t *cmd_param=NULL, uint16_t param_len=0) | |
Class constructor. | |
AtCmdFrame (uint16_t remote, const char *const cmd, uint32_t cmd_param) | |
Class constructor. | |
AtCmdFrame (uint16_t remote, const char *const cmd, const uint8_t *cmd_param=NULL, uint16_t param_len=0) | |
Class constructor. | |
AtCmdFrame (uint64_t remote64, uint16_t remote16, const char *const cmd, uint32_t cmd_param) | |
Class constructor. | |
AtCmdFrame (uint64_t remote64, uint16_t remote16, const char *const cmd, const uint8_t *cmd_param=NULL, uint16_t param_len=0) | |
Class constructor. | |
ApiFrameType | get_frame_type () const |
get_frame_type gets the type of the frame | |
void | dump () const |
dump dumps the information of this frame | |
void | dump_if (ApiFrameType type) |
dump_if dumps the information of the frame if the frame type matches with the parameter. | |
void | set_frame_type (ApiFrameType type) |
set_frame_type sets the type of the frame to type. | |
uint16_t | get_data_len () const |
get_data_len gets the length of the frame data payload. | |
void | set_data_len (uint16_t len) |
set_data_len sets the length of the frame data payload. | |
const uint8_t * | get_data () const |
get_data returns a pointer to the frame data payload. | |
uint8_t | get_data_at (uint16_t index) const |
get_data_at returns the byte at index offset. | |
void | set_data (uint8_t data, uint16_t index) |
set_data sets data byte at the specified index or offset. | |
uint8_t | get_frame_id () const |
get_frame_id returns the frame id of this frame. | |
Protected Member Functions | |
void | build_at_cmd_frame (const char *cmd, const uint8_t *cmd_params, uint8_t payload_len, bool reverse=true) |
build_at_cmd_frame method used by the constructors to create the at command frame | |
void | build_at_cmd_remote_frame (uint64_t remote64, uint16_t remote16, const char *const cmd, const uint8_t *const cmd_params, uint8_t payload_len, bool reverse=true) |
build_at_cmd_remote_frame method used by the constructors to create the at command frame | |
uint8_t | get_next_frame_id () |
get_next_frame_id - returns the next frame ID secuentially, skipping the value 0 | |
void | set_api_frame (ApiFrameType type, const uint8_t *data, uint16_t len) |
set_api_frame sets several members | |
Protected Attributes | |
ApiFrameType | _type |
Type of this frame. | |
uint16_t | _data_frame_len |
length of the payload, excluding the frame type | |
uint8_t * | _data |
pointer to the frame data | |
bool | _alloc_data |
True if the constructor allocates the data. | |
uint8_t | _frame_id |
Frame ID of this frame. |
Detailed Description
Class for the AT command api frames.
Derived from ApiFrame
Definition at line 42 of file AtCmdFrame.h.
Member Enumeration Documentation
enum ApiFrameType [inherited] |
List of API frames.
Note that not all frames are supported by all radios
- Enumerator:
Definition at line 26 of file ApiFrame.h.
enum AtCmdResp |
AtCmdResp.
- Enumerator:
Reimplemented from ApiFrame.
Definition at line 49 of file AtCmdFrame.h.
enum ModemStatus |
ModemStatus.
- Enumerator:
Definition at line 63 of file AtCmdFrame.h.
Constructor & Destructor Documentation
AtCmdFrame | ( | const char *const | cmd, |
const uint32_t | cmd_param | ||
) |
Class constructor.
- Parameters:
-
cmd at command of the frame cmd_param command parameter param_len length of the command param
Definition at line 38 of file AtCmdFrame.cpp.
AtCmdFrame | ( | const char *const | cmd, |
const uint8_t * | cmd_param = NULL , |
||
uint16_t | param_len = 0 |
||
) |
Class constructor.
- Parameters:
-
cmd at command of the frame cmd_param pointer to command parameter param_len length of the command param
Definition at line 56 of file AtCmdFrame.cpp.
AtCmdFrame | ( | uint64_t | remote, |
const char *const | cmd, | ||
uint32_t | cmd_param | ||
) |
Class constructor.
- Parameters:
-
remote 64 bit address of the remote device where we want to run the command cmd at command of the frame cmd_param command parameter
Definition at line 64 of file AtCmdFrame.cpp.
AtCmdFrame | ( | uint64_t | remote, |
const char *const | cmd, | ||
const uint8_t * | cmd_param = NULL , |
||
uint16_t | param_len = 0 |
||
) |
Class constructor.
- Parameters:
-
remote 64 bit address of the remote device where we want to run the command cmd at command of the frame cmd_param pointer to command parameter param_len length of the command param
Definition at line 72 of file AtCmdFrame.cpp.
AtCmdFrame | ( | uint16_t | remote, |
const char *const | cmd, | ||
uint32_t | cmd_param | ||
) |
Class constructor.
- Parameters:
-
remote 16 bit address of the remote device where we want to run the command cmd at command of the frame cmd_param command parameter
Definition at line 80 of file AtCmdFrame.cpp.
AtCmdFrame | ( | uint16_t | remote, |
const char *const | cmd, | ||
const uint8_t * | cmd_param = NULL , |
||
uint16_t | param_len = 0 |
||
) |
Class constructor.
- Parameters:
-
remote 16 bit address of the remote device where we want to run the command cmd at command of the frame cmd_param pointer to command parameter param_len length of the command param
Definition at line 88 of file AtCmdFrame.cpp.
AtCmdFrame | ( | uint64_t | remote64, |
uint16_t | remote16, | ||
const char *const | cmd, | ||
uint32_t | cmd_param | ||
) |
Class constructor.
- Parameters:
-
remote 64 bit address of the remote device where we want to run the command remote 16 bit address of the remote device where we want to run the command cmd at command of the frame cmd_param command parameter
Definition at line 96 of file AtCmdFrame.cpp.
AtCmdFrame | ( | uint64_t | remote64, |
uint16_t | remote16, | ||
const char *const | cmd, | ||
const uint8_t * | cmd_param = NULL , |
||
uint16_t | param_len = 0 |
||
) |
Class constructor.
- Parameters:
-
remote 64 bit address of the remote device where we want to run the command remote 16 bit address of the remote device where we want to run the command cmd at command of the frame cmd_param pointer to command parameter param_len length of the command param
Definition at line 104 of file AtCmdFrame.cpp.
Member Function Documentation
void build_at_cmd_frame | ( | const char * | cmd, |
const uint8_t * | cmd_params, | ||
uint8_t | payload_len, | ||
bool | reverse = true |
||
) | [protected] |
build_at_cmd_frame method used by the constructors to create the at command frame
- Parameters:
-
cmd at command of the frame cmd_params pointer to command parameter param_len length of the command param
Definition at line 20 of file AtCmdFrame.cpp.
void build_at_cmd_remote_frame | ( | uint64_t | remote64, |
uint16_t | remote16, | ||
const char *const | cmd, | ||
const uint8_t *const | cmd_params, | ||
uint8_t | payload_len, | ||
bool | reverse = true |
||
) | [protected] |
build_at_cmd_remote_frame method used by the constructors to create the at command frame
- Parameters:
-
remote64 64 bit address of the remote device where we want to run the command remote16 16 bit address of the remote device where we want to run the command cmd at command of the frame cmd_params pointer to command parameter param_len length of the command param
Definition at line 122 of file AtCmdFrame.cpp.
void dump | ( | void | ) | const [inherited] |
dump dumps the information of this frame
Definition at line 75 of file ApiFrame.cpp.
void dump_if | ( | ApiFrameType | type ) | [inherited] |
dump_if dumps the information of the frame if the frame type matches with the parameter.
- Parameters:
-
type dump the frame info/data if the frame type matches with type.
Definition at line 85 of file ApiFrame.cpp.
const uint8_t * get_data | ( | ) | const [inherited] |
get_data returns a pointer to the frame data payload.
- Returns:
- a pointer to the frame data payload.
Definition at line 113 of file ApiFrame.cpp.
uint8_t get_data_at | ( | uint16_t | index ) | const [inherited] |
get_data_at returns the byte at index offset.
- Parameters:
-
index offset of the byte we want to get.
- Returns:
- the byte at index offset.
Definition at line 118 of file ApiFrame.cpp.
uint16_t get_data_len | ( | ) | const [inherited] |
get_data_len gets the length of the frame data payload.
- Returns:
- the length of the data payload.
Definition at line 103 of file ApiFrame.cpp.
uint8_t get_frame_id | ( | ) | const [inherited] |
get_frame_id returns the frame id of this frame.
- Returns:
- the frame id of this frame.
Definition at line 129 of file ApiFrame.cpp.
ApiFrame::ApiFrameType get_frame_type | ( | ) | const [inherited] |
get_frame_type gets the type of the frame
- Returns:
- the type of this frame.
Definition at line 93 of file ApiFrame.cpp.
uint8_t get_next_frame_id | ( | void | ) | [protected, inherited] |
get_next_frame_id - returns the next frame ID secuentially, skipping the value 0
- Returns:
- the next frame ID that should be assigned to a frame
Definition at line 39 of file ApiFrame.cpp.
void set_api_frame | ( | ApiFrameType | type, |
const uint8_t * | data, | ||
uint16_t | len | ||
) | [protected, inherited] |
set_api_frame sets several members
- Parameters:
-
type frame type of this api frame. data pointer to frame data payload. len length of the payload.
Definition at line 55 of file ApiFrame.cpp.
void set_data | ( | uint8_t | data, |
uint16_t | index | ||
) | [inherited] |
set_data sets data byte at the specified index or offset.
- Parameters:
-
data byte that will be set at index position. index offset of the byte we want to set.
Definition at line 123 of file ApiFrame.cpp.
void set_data_len | ( | uint16_t | len ) | [inherited] |
set_data_len sets the length of the frame data payload.
- Parameters:
-
len the length of the data payload will be set on this frame.
Definition at line 108 of file ApiFrame.cpp.
void set_frame_type | ( | ApiFrameType | type ) | [inherited] |
set_frame_type sets the type of the frame to type.
- Parameters:
-
type the type we want to set on the frame.
Definition at line 98 of file ApiFrame.cpp.
Field Documentation
bool _alloc_data [protected, inherited] |
True if the constructor allocates the data.
Needed to delete it on the destructor
Definition at line 157 of file ApiFrame.h.
uint8_t* _data [protected, inherited] |
pointer to the frame data
Definition at line 154 of file ApiFrame.h.
uint16_t _data_frame_len [protected, inherited] |
length of the payload, excluding the frame type
Definition at line 151 of file ApiFrame.h.
uint8_t _frame_id [protected, inherited] |
Frame ID of this frame.
Definition at line 160 of file ApiFrame.h.
ApiFrameType _type [protected, inherited] |
Type of this frame.
Definition at line 148 of file ApiFrame.h.
Generated on Tue Jul 12 2022 20:10:44 by 1.7.2