PicoWAN SDK Documentation
Functions
lora_mac.h File Reference

Functions that are specific to LoRaWAN. More...

#include <stdint.h>

Go to the source code of this file.

Functions

void lora_mac_set_adr (uint8_t enable)
 Enables/disables the ADR (Adaptive Data Rate). More...
 
void lora_mac_set_channels_tx_power (int8_t tx_power)
 Sets the channels TX output power. More...
 
void lora_mac_set_channels_datarate (int8_t datarate)
 Sets the channels datarate. More...
 
void lora_mac_set_repeater_support (uint8_t enable)
 Enables/disables repeater support. More...
 
uint8_t lora_mac_get_last_demod_margin (void)
 Link margin reported after a LinkCheckReq command. More...
 
uint8_t lora_mac_get_last_nb_gateways (void)
 Number of gateways reported after a LinkCheckReq command. More...
 
void lora_mac_set_rx2_datarate (uint8_t dr)
 Sets the datarate of the RX2 window. More...
 
void lora_mac_test_set_duty_cycle (uint8_t enable)
 Enables/disables the duty cycle limitation (for test purpose). More...
 

Detailed Description

Functions that are specific to LoRaWAN.

Copyright (c) 2018, Archos S.A. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND AND EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARCHOS S.A. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

uint8_t lora_mac_get_last_demod_margin ( void  )

Link margin reported after a LinkCheckReq command.

Return values
uint8_tThe margin in dB between 0 and 255.
uint8_t lora_mac_get_last_nb_gateways ( void  )

Number of gateways reported after a LinkCheckReq command.

Return values
uint8_tThe number of gateways.
void lora_mac_set_adr ( uint8_t  enable)

Enables/disables the ADR (Adaptive Data Rate).

Parameters
enable1 to enable ADR, 0 otherwise.
void lora_mac_set_channels_datarate ( int8_t  datarate)

Sets the channels datarate.

Parameters
datarateThe new datarate. Allowed values are:
  • EU868 - [DR_0, DR_1, DR_2, DR_3, DR_4, DR_5, DR_6, DR_7]
  • US915 - [DR_0, DR_1, DR_2, DR_3, DR_4]
void lora_mac_set_channels_tx_power ( int8_t  tx_power)

Sets the channels TX output power.

Parameters
tx_powerThe TX output power. Allowed values are TX_POWER_20_DBM, TX_POWER_14_DBM, TX_POWER_11_DBM, TX_POWER_08_DBM, TX_POWER_05_DBM, TX_POWER_02_DBM.
void lora_mac_set_repeater_support ( uint8_t  enable)

Enables/disables repeater support.

Parameters
enable1 to enable ADR, 0 to disable it.
void lora_mac_set_rx2_datarate ( uint8_t  dr)

Sets the datarate of the RX2 window.

Parameters
drThe datarate to set (DR_n where n can be 0-6).
0-6corresponding to DR_X.
void lora_mac_test_set_duty_cycle ( uint8_t  enable)

Enables/disables the duty cycle limitation (for test purpose).

Parameters
enable1 to enable the limitation, 0 to disable it.
0disable 1: enable