Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

LoRaMacCommand Class Reference

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.
uint8_t get_mac_cmd_length () const
 Get the length of MAC commands.
uint8_t * get_mac_commands_buffer ()
 Get MAC command buffer.
void parse_mac_commands_to_repeat ()
 Parses the MAC commands which must be re-sent.
void clear_repeat_buffer ()
 Clear MAC command repeat buffer.
void copy_repeat_commands_to_buffer ()
 Copy MAC commands from repeat buffer to actual MAC command buffer.
uint8_t get_repeat_commands_length () const
 Get the length of MAC commands in repeat buffer.
void clear_sticky_mac_cmd ()
 Clear sticky MAC commands.
bool has_sticky_mac_cmd () const
 Check if MAC command buffer contains sticky commands.
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.
lorawan_status_t add_link_check_req ()
 Adds a new LinkCheckReq MAC command to be sent.
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.

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

Definition at line 314 of file LoRaMacCommand.cpp.

void clear_command_buffer ( void   )

Clear MAC command buffer.

Definition at line 46 of file LoRaMacCommand.cpp.

void clear_repeat_buffer (  )

Clear MAC command repeat buffer.

Definition at line 104 of file LoRaMacCommand.cpp.

void clear_sticky_mac_cmd (  )

Clear sticky MAC commands.

Definition at line 120 of file LoRaMacCommand.cpp.

void copy_repeat_commands_to_buffer (  )

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

Definition at line 109 of file LoRaMacCommand.cpp.

uint8_t get_mac_cmd_length (  ) const

Get the length of MAC commands.

Returns:
status Length of used MAC buffer (bytes)

Definition at line 51 of file LoRaMacCommand.cpp.

uint8_t * get_mac_commands_buffer (  )

Get MAC command buffer.

Returns:
Pointer to MAC command buffer

Definition at line 56 of file LoRaMacCommand.cpp.

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)

Definition at line 115 of file LoRaMacCommand.cpp.

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

Definition at line 125 of file LoRaMacCommand.cpp.

void parse_mac_commands_to_repeat (  )

Parses the MAC commands which must be re-sent.

Definition at line 61 of file LoRaMacCommand.cpp.

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.

Definition at line 130 of file LoRaMacCommand.cpp.

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.

Definition at line 309 of file LoRaMacCommand.cpp.