Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
LoRaMacCommand Class Reference

LoRaMacCommand Class Helper class for LoRaMac layer to handle any MAC commands. More...

#include <LoRaMacCommand.h>

Public Member Functions

void clear_command_buffer (void)
 Clear MAC command buffer. More...
 
uint8_t get_mac_cmd_length () const
 Get the length of MAC commands. More...
 
uint8_t * get_mac_commands_buffer ()
 Get MAC command buffer. More...
 
void parse_mac_commands_to_repeat ()
 Parses the MAC commands which must be re-sent. More...
 
void clear_repeat_buffer ()
 Clear MAC command repeat buffer. More...
 
void copy_repeat_commands_to_buffer ()
 Copy MAC commands from repeat buffer to actual MAC command buffer. More...
 
uint8_t get_repeat_commands_length () const
 Get the length of MAC commands in repeat buffer. More...
 
void clear_sticky_mac_cmd ()
 Clear sticky MAC commands. More...
 
bool has_sticky_mac_cmd () const
 Check if MAC command buffer contains sticky commands. More...
 
lorawan_status_t process_mac_commands (const uint8_t *payload, uint8_t mac_index, uint8_t commands_size, uint8_t snr, loramac_mlme_confirm_t &mlme_conf, lora_mac_system_params_t &mac_params, LoRaPHY &lora_phy)
 Decodes MAC commands in the fOpts field and in the payload. More...
 
lorawan_status_t add_link_check_req ()
 Adds a new LinkCheckReq MAC command to be sent. More...
 
void set_batterylevel_callback (mbed::Callback< uint8_t(void)> battery_level)
 Set battery level query callback method If callback is not set, BAT_LEVEL_NO_MEASURE is returned. More...
 

Detailed Description

LoRaMacCommand Class Helper class for LoRaMac layer to handle any MAC commands.

Definition at line 57 of file LoRaMacCommand.h.

Member Function Documentation

lorawan_status_t add_link_check_req ( )

Adds a new LinkCheckReq MAC command to be sent.

Returns
status Function status: LORAWAN_STATUS_OK: OK, LORAWAN_STATUS_LENGTH_ERROR: Buffer full
void clear_command_buffer ( void  )

Clear MAC command buffer.

void clear_repeat_buffer ( )

Clear MAC command repeat buffer.

void clear_sticky_mac_cmd ( )

Clear sticky MAC commands.

void copy_repeat_commands_to_buffer ( )

Copy MAC commands from repeat buffer to actual MAC command buffer.

uint8_t get_mac_cmd_length ( ) const

Get the length of MAC commands.

Returns
status Length of used MAC buffer (bytes)
uint8_t* get_mac_commands_buffer ( )

Get MAC command buffer.

Returns
Pointer to MAC command buffer
uint8_t get_repeat_commands_length ( ) const

Get the length of MAC commands in repeat buffer.

Returns
status Length of used MAC Repeat buffer (bytes)
bool has_sticky_mac_cmd ( ) const

Check if MAC command buffer contains sticky commands.

Returns
status True: buffer has sticky MAC commands in it, false: no sticky commands in buffer
void parse_mac_commands_to_repeat ( )

Parses the MAC commands which must be re-sent.

lorawan_status_t process_mac_commands ( const uint8_t *  payload,
uint8_t  mac_index,
uint8_t  commands_size,
uint8_t  snr,
loramac_mlme_confirm_t mlme_conf,
lora_mac_system_params_t mac_params,
LoRaPHY lora_phy 
)

Decodes MAC commands in the fOpts field and in the payload.

Returns
status Function status. LORAWAN_STATUS_OK if command successful.
void set_batterylevel_callback ( mbed::Callback< uint8_t(void)>  battery_level)

Set battery level query callback method If callback is not set, BAT_LEVEL_NO_MEASURE is returned.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.