![]() |
LoRaMAC
4.4.5
Documentation of the API
|
LoRa MAC commands. More...
Go to the source code of this file.
Data Structures | |
| struct | MacCommand_t |
| #define | LORAMAC_COMMADS_MAX_NUM_OF_PARAMS 2 |
| enum | LoRaMacCommandStatus_t { LORAMAC_COMMANDS_SUCCESS = 0, LORAMAC_COMMANDS_ERROR_NPE, LORAMAC_COMMANDS_ERROR_MEMORY, LORAMAC_COMMANDS_ERROR_CMD_NOT_FOUND, LORAMAC_COMMANDS_ERROR_UNKNOWN_CMD, LORAMAC_COMMANDS_ERROR } |
| typedef void(* | LoRaMacCommandsNvmEvent) (void) |
| LoRaMacCommandStatus_t | LoRaMacCommandsInit (LoRaMacCommandsNvmEvent commandsNvmCtxChanged) |
| Initialization of LoRaMac MAC commands module. More... | |
| LoRaMacCommandStatus_t | LoRaMacCommandsRestoreNvmCtx (void *commandsNvmCtx) |
| void * | LoRaMacCommandsGetNvmCtx (size_t *commandsNvmCtxSize) |
| LoRaMacCommandStatus_t | LoRaMacCommandsAddCmd (uint8_t cid, uint8_t *payload, size_t payloadSize) |
| Adds a new MAC command to be sent. More... | |
| LoRaMacCommandStatus_t | LoRaMacCommandsRemoveCmd (MacCommand_t *macCmd) |
| Remove a MAC command. More... | |
| LoRaMacCommandStatus_t | LoRaMacCommandsGetCmd (uint8_t cid, MacCommand_t **macCmd) |
| Get the MAC command with corresponding CID. More... | |
| LoRaMacCommandStatus_t | LoRaMacCommandsRemoveNoneStickyCmds (void) |
| Remove all none sticky MAC commands. More... | |
| LoRaMacCommandStatus_t | LoRaMacCommandsRemoveStickyAnsCmds (void) |
| Remove all sticky answer MAC commands. More... | |
| LoRaMacCommandStatus_t | LoRaMacCommandsGetSizeSerializedCmds (size_t *size) |
| Get size of all MAC commands serialized as buffer. More... | |
| LoRaMacCommandStatus_t | LoRaMacCommandsSerializeCmds (size_t availableSize, size_t *effectiveSize, uint8_t *buffer) |
| Get as many as possible MAC commands serialized. More... | |
| LoRaMacCommandStatus_t | LoRaMacCommandsStickyCmdsPending (bool *cmdsPending) |
| Determines if there are sticky MAC commands pending. More... | |
| uint8_t | LoRaMacCommandsGetCmdSize (uint8_t cid) |
| Get the MAC command size with corresponding CID. More... | |
LoRa MAC commands.
addtogroup LORAMAC
| struct sMacCommand |
LoRaWAN MAC Command element
| typedef void( * LoRaMacCommandsNvmEvent) (void) |
Signature of callback function to be called by this module when the non-volatile needs to be saved.
LoRaMac Commands Status
| LoRaMacCommandStatus_t LoRaMacCommandsInit | ( | LoRaMacCommandsNvmEvent | commandsNvmCtxChanged | ) |
Initialization of LoRaMac MAC commands module.
| [IN] | commandsNvmCtxChanged - Callback function which will be called when the non-volatile context needs to be saved. |
| - | Status of the operation |
| LoRaMacCommandStatus_t LoRaMacCommandsRestoreNvmCtx | ( | void * | commandsNvmCtx | ) |
Restores the internal non-volatile context from passed pointer.
| [IN] | commandsNvmCtx - Pointer to non-volatile MAC commands module context to be restored. |
| - | Status of the operation |
| void* LoRaMacCommandsGetNvmCtx | ( | size_t * | commandsNvmCtxSize | ) |
Returns a pointer to the internal non-volatile context.
| [IN] | commandsNvmCtxSize - Size of the module non-volatile context |
| - | Points to a structure where the module store its non-volatile context |
| LoRaMacCommandStatus_t LoRaMacCommandsAddCmd | ( | uint8_t | cid, |
| uint8_t * | payload, | ||
| size_t | payloadSize | ||
| ) |
Adds a new MAC command to be sent.
| [IN] | cid - MAC command identifier |
| [IN] | payload - MAC command payload containing parameters |
| [IN] | payloadSize - Size of MAC command payload |
| - | Status of the operation |
| LoRaMacCommandStatus_t LoRaMacCommandsRemoveCmd | ( | MacCommand_t * | macCmd | ) |
Remove a MAC command.
| [OUT] | cmd - MAC command |
| - | Status of the operation |
| LoRaMacCommandStatus_t LoRaMacCommandsGetCmd | ( | uint8_t | cid, |
| MacCommand_t ** | macCmd | ||
| ) |
Get the MAC command with corresponding CID.
| [IN] | cid - MAC command identifier |
| [OUT] | cmd - MAC command |
| - | Status of the operation |
| LoRaMacCommandStatus_t LoRaMacCommandsRemoveNoneStickyCmds | ( | void | ) |
Remove all none sticky MAC commands.
| - | Status of the operation |
| LoRaMacCommandStatus_t LoRaMacCommandsRemoveStickyAnsCmds | ( | void | ) |
Remove all sticky answer MAC commands.
| - | Status of the operation |
| LoRaMacCommandStatus_t LoRaMacCommandsGetSizeSerializedCmds | ( | size_t * | size | ) |
Get size of all MAC commands serialized as buffer.
| [out] | size | - Available size of memory for MAC commands |
| - | Status of the operation |
| LoRaMacCommandStatus_t LoRaMacCommandsSerializeCmds | ( | size_t | availableSize, |
| size_t * | effectiveSize, | ||
| uint8_t * | buffer | ||
| ) |
Get as many as possible MAC commands serialized.
| [IN] | availableSize - Available size of memory for MAC commands | |
| [out] | effectiveSize | - Size of memory which was effectively used for serializing. |
| [out] | buffer | - Destination data buffer |
| - | Status of the operation |
| LoRaMacCommandStatus_t LoRaMacCommandsStickyCmdsPending | ( | bool * | cmdsPending | ) |
Determines if there are sticky MAC commands pending.
| [IN] | cmdsPending - Indicates if there are sticky MAC commands in the queue. |
| - | Status of the operation |
| uint8_t LoRaMacCommandsGetCmdSize | ( | uint8_t | cid | ) |
Get the MAC command size with corresponding CID.
| [IN] | cid - MAC command identifier |
| Size | of the command. |