armapi  v1.0
bĂȘta
Lora network

Macros

#define ARM_LW_UNCONFIRMED(val)   ((-1)*(val))
 Macro to set unconfirmed frame. More...
 
#define ARM_LW_IS_UNCONFIRMED(val)   ((val)<=0)
 Macro to know if the frame is unconfirmed or not. More...
 

Functions

armError_t armLwSetRadio (arm_t *arm, uint8_t txChannel, uint8_t power, uint8_t txSf, uint8_t rx2Sf, uint8_t rx2Channel)
 Setup the LoraWan radio configuration. More...
 
void armLwGetRadio (arm_t *arm, uint8_t *txChannel, uint8_t *power, uint8_t *txSf, uint8_t *rx2Sf, uint8_t *rx2Channel)
 Get the LoraWan radio configuration. More...
 
armError_t armLwSetConfirmedFrame (arm_t *arm, int8_t nbFrame)
 Enable/Disable and set the confirmed frame. More...
 
int8_t armLwGetConfirmedFrame (arm_t *arm)
 Get the setup of confirmed frame. More...
 
void armLwSetPortField (arm_t *arm, uint8_t port)
 Set the port field. More...
 
uint8_t armLwGetPortField (arm_t *arm)
 Get the port field. More...
 
void armLwEnableOtaa (arm_t *arm, bool enable)
 Enable/Disable Over The Air Activation. More...
 
bool armLwIsEnableOtaa (arm_t *arm)
 Get if Over The Air Activation is enable. More...
 
void armLwEnableRxWindows (arm_t *arm, bool enable)
 Enable/Disable Rx windows. More...
 
bool armLwIsEnableRxWindows (arm_t *arm)
 Get if Rx windows is enable. More...
 
void armLwEnableTxAdaptiveSpeed (arm_t *arm, bool enable)
 Enable/Disable Tx Adaptive Speed. More...
 
bool armLwIsEnableTxAdaptiveSpeed (arm_t *arm)
 Get if Tx Adaptive Speed is enable. More...
 
void armLwEnableDutyCycle (arm_t *arm, bool enable)
 Enable/Disable Duty Cycle. More...
 
bool armLwIsEnableDutyCycle (arm_t *arm)
 Get if Duty Cycle is enable. More...
 
void armLwEnableTxAdaptiveChannel (arm_t *arm, bool enable)
 Enable/Disable Tx Adaptive Channel. More...
 
bool armLwIsEnableTxAdaptiveChannel (arm_t *arm)
 Get if Tx Adaptive Channel is enable. More...
 
void armLwEnableRx2Adaptive (arm_t *arm, bool enable)
 Enable/Disable Rx2 windows Adaptive. More...
 
bool armLwIsEnableRx2Adaptive (arm_t *arm)
 Get if Rx2 windows Adaptive is enable. More...
 
armError_t armLwIds (arm_t *arm, uint32_t *devAddr, uint64_t *devEui, uint64_t *appEui, uint128_t *appKey, uint128_t *nwkSKey, uint128_t *appSKey)
 Get the IDs. More...
 

Detailed Description

Macro Definition Documentation

#define ARM_LW_IS_UNCONFIRMED (   val)    ((val)<=0)

Macro to know if the frame is unconfirmed or not.

Can you use this with armLwGetConfirmedFrame() and armLwSetConfirmedFrame().

#define ARM_LW_UNCONFIRMED (   val)    ((-1)*(val))

Macro to set unconfirmed frame.

Can you use this with armLwSetConfirmedFrame() and armLwGetConfirmedFrame().

Function Documentation

void armLwEnableDutyCycle ( arm_t *  arm,
bool  enable 
)

Enable/Disable Duty Cycle.

Warning
The Duty Cycle should be enable every time.
Note
In the case where this function in not supported by your ARM this functions is ignored.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
enabletrue to enable \b Duty Cycle or false to disable.
Note
You need to call armUpdateConfig() to update the parameters in you ARM.
See also
armLwIsEnableDutyCycle()
void armLwEnableOtaa ( arm_t *  arm,
bool  enable 
)

Enable/Disable Over The Air Activation.

Note
In the case where this function in not supported by your ARM this functions is ignored.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
enabletrue to enable Over The Air Activation or false to disable.
Note
You need to call armUpdateConfig() to update the parameters in you ARM. The ARM will be restart if necessary.
See also
armLwIsEnableOtaa()
void armLwEnableRx2Adaptive ( arm_t *  arm,
bool  enable 
)

Enable/Disable Rx2 windows Adaptive.

Note
In the case where this function in not supported by your ARM this functions is ignored.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
enabletrue to enable Rx2 windows Adaptive or false to disable. In the case where enable is true, the ARM will ignore the parameter rx2Sf and rx2Channel of the function armLwSetRadio().
Note
You need to call armUpdateConfig() to update the parameters in you ARM.
See also
armLwIsEnableRx2Adaptive()
void armLwEnableRxWindows ( arm_t *  arm,
bool  enable 
)

Enable/Disable Rx windows.

Note
In the case where this function in not supported by your ARM this functions is ignored.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
enabletrue to enable Rx windows or false to disable. In the case where enable is true, the ARM will ignore the parameters rx2Sf and rx2Channel of the function armLwSetRadio().
Note
You need to call armUpdateConfig() to update the parameters in you ARM.
See also
armLwIsEnableRxWindows()
void armLwEnableTxAdaptiveChannel ( arm_t *  arm,
bool  enable 
)

Enable/Disable Tx Adaptive Channel.

Note
In the case where this function in not supported by your ARM this functions is ignored.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
enabletrue to enable Tx Adaptive Channel or false to disable. In the case where enable is true, the ARM will ignore the parameter txChannel of the function armLwSetRadio().
Note
You need to call armUpdateConfig() to update the parameters in you ARM.
See also
armLwIsEnableTxAdaptiveChannel()
void armLwEnableTxAdaptiveSpeed ( arm_t *  arm,
bool  enable 
)

Enable/Disable Tx Adaptive Speed.

Note
In the case where this function in not supported by your ARM this functions is ignored.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
enabletrue to enable Tx Adaptive Speed or false to disable. In the case where enable is true, the ARM will ignore the parameters power and txSf of the function armLwSetRadio().
Note
You need to call armUpdateConfig() to update the parameters in you ARM.
See also
armLwIsEnableTxAdaptiveSpeed()
int8_t armLwGetConfirmedFrame ( arm_t *  arm)

Get the setup of confirmed frame.

Note
In the case where this function in not supported by your ARM the returned value is unfeasible.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
Returns
The confirmed frame setup.

eg:

int8_t nbFrame = armLwGetConfirmedFrame(&myArm);
{
nbFrame = ARM_LW_UNCONFIRMED(nbFrame);
//...
}
else
{
//...
}

or (this is same thing):

int8_t nbFrame = armLwGetConfirmedFrame(&myArm);
if(nbFrame <= 0)
{
nbFrame = -1*nbFrame);
//...
}
else
{
//...
}
See also
armLwSetConfirmedFrame()
uint8_t armLwGetPortField ( arm_t *  arm)

Get the port field.

Note
In the case where this function in not supported by your ARM the returned value is unfeasible.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
Returns
The port field.
See also
armLwSetPortField()
void armLwGetRadio ( arm_t *  arm,
uint8_t *  txChannel,
uint8_t *  power,
uint8_t *  txSf,
uint8_t *  rx2Sf,
uint8_t *  rx2Channel 
)

Get the LoraWan radio configuration.

Please, for more information about parameter consult the documentation of the armLwSetRadio() function.

Note
If you don't went get a parameter you can give the NULL value.
In the case where this function in not supported by your ARM the value of parameters is no modified.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
txChannelIf the pointer is valid, the txChannel is set.
powerIf the pointer is valid, the power is set.
txSfIf the pointer is valid, the txSf is set.
rx2SfIf the pointer is valid, the rx2Sf is set.
rx2ChannelIf the pointer is valid, the rx2Channel is set.
See also
armLwSetRadio()
armError_t armLwIds ( arm_t *  arm,
uint32_t *  devAddr,
uint64_t *  devEui,
uint64_t *  appEui,
uint128_t *  appKey,
uint128_t *  nwkSKey,
uint128_t *  appSKey 
)

Get the IDs.

This function is supported by:

  • ARM_N8_LW, ARM Nano 868MHz in Lora Wan.
Note
If you don't went get a parameter you can give the NULL value.
Parameters
armPointer to your ARM structure.
devAddrIf the pointer is valid, the devAddr is set.
devEuiIf the pointer is valid, the devEui is set.
appEuiIf the pointer is valid, the appEui is set.
appKeyIf the pointer is valid, the appKey is set.
nwkSKeyIf the pointer is valid, the nwkSKey is set.
appSKeyIf the pointer is valid, the appSKey is set.
Returns
Error available:
bool armLwIsEnableDutyCycle ( arm_t *  arm)

Get if Duty Cycle is enable.

Note
In the case where this function in not supported by your ARM the returned value is unfeasible.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
Returns
true if the Duty Cycle is enable or false if disable.
See also
armLwEnableDutyCycle()
bool armLwIsEnableOtaa ( arm_t *  arm)

Get if Over The Air Activation is enable.

Note
In the case where this function in not supported by your ARM the returned value is unfeasible.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
Returns
true if the Over The Air Activation is enable or false if disable.
See also
armLwEnableOtaa()
bool armLwIsEnableRx2Adaptive ( arm_t *  arm)

Get if Rx2 windows Adaptive is enable.

Note
In the case where this function in not supported by your ARM the returned value is unfeasible.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
Returns
true if the Rx2 windows Adaptive is enable or false if disable.
See also
armLwEnableRx2Adaptive()
bool armLwIsEnableRxWindows ( arm_t *  arm)

Get if Rx windows is enable.

Note
In the case where this function in not supported by your ARM the returned value is unfeasible.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
Returns
true if the Rx windows is enable or false if disable.
See also
armLwEnableRxWindows()
bool armLwIsEnableTxAdaptiveChannel ( arm_t *  arm)

Get if Tx Adaptive Channel is enable.

Note
In the case where this function in not supported by your ARM the returned value is unfeasible.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
Returns
true if the Tx Adaptive Channel is enable or false if disable.
See also
armLwEnableTxAdaptiveChannel()
bool armLwIsEnableTxAdaptiveSpeed ( arm_t *  arm)

Get if Tx Adaptive Speed is enable.

Note
In the case where this function in not supported by your ARM the returned value is unfeasible.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
Returns
true if the Tx Adaptive Speed is enable or false if disable.
See also
armLwEnableTxAdaptiveSpeed()
armError_t armLwSetConfirmedFrame ( arm_t *  arm,
int8_t  nbFrame 
)

Enable/Disable and set the confirmed frame.

Note
In the case where this function in not supported by your ARM this functions is ignored.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
nbFramethe value available:
  • 0: Enable unconfirmed frame, will use LoRaWan default value, can be adapt by gateway with MacCommand.
  • -1 down -15: Enable unconfirmed frame, send unconfirmed frame of 1 up to 15. You can use the ARM_LW_UNCONFIRMED() macro to set a positive value.
  • 1 to 15 : Enable confirmed frame, send confirmed frame of 1 up to 15.
Returns
Error available:

eg:

//Put at 3 the number of frame unconfirmed.

or (this is same thing):

//Put at 3 the number of frame unconfirmed.
Note
You need to call armUpdateConfig() to update the parameters in you ARM.
See also
armLwGetConfirmedFrame()
void armLwSetPortField ( arm_t *  arm,
uint8_t  port 
)

Set the port field.

Note
In the case where this function in not supported by your ARM this functions is ignored.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Parameters
armPointer to your ARM structure.
portthe value available:
  • 0x00: indicates that the FRMPayload contains MAC commands only
  • 0x01 to 0xDF: application specific
  • 0xE0 to 0xFF: reserved for future standardized application extensions
Note
You need to call armUpdateConfig() to update the parameters in you ARM.
See also
armLwGetPortField()
armError_t armLwSetRadio ( arm_t *  arm,
uint8_t  txChannel,
uint8_t  power,
uint8_t  txSf,
uint8_t  rx2Sf,
uint8_t  rx2Channel 
)

Setup the LoraWan radio configuration.

For more information, please consulate Lora radio page.

This function is supported by:

  • ARM_N8_LW, ARM Nano in 868MHz Lora Wan.
Note
If you don't want set a value, pass the 0 value to parameters.
Warning
This functions disable automatically the Tx Adaptive Speed if the parameter txSf or power is not set to 0.
This functions disable automatically the Adaptive Channel if the parameter txChannel is not set to 0.
This functions disable automatically the rx2 Adaptive if the parameter rx2Sf or rx2Channel is not set to 0.
Parameters
armPointer to your ARM structure.
txChannelthe emission channel.
  • The range possible is of 1 to 9. In this case the Adaptive Channel is automatically disable.
  • Set 0 if you don't want set this parameter.
  • The function, return the error ARM_ERR_PARAM_OUT_OF_RANGE if this value is out of rang.
powerthe output power.
  • The possibles values are 2, 5, 8, 11, 14 (value in dBm). In this case the Tx Adaptive Speed is automatically disable.
  • Set 0 if you don't want set this parameter.
  • The function, return the error ARM_ERR_PARAM_OUT_OF_RANGE if this value is out of rang.
txSfthe emission spreading factor.
  • The range possible is of 7 to 12. In this case the Tx Adaptive Speed is automatically disable.
  • Set 0 if you don't want set this parameter.
  • The function, return the error ARM_ERR_PARAM_OUT_OF_RANGE if this value is out of rang.
rx2Sfthe Rx2 spreading factor.
  • The range possible is of 7 to 12. In this case the rx2 Adaptive is automatically disable.
  • Set 0 if you don't want set this parameter.
  • The function, return the error ARM_ERR_PARAM_OUT_OF_RANGE if this value is out of rang.
rx2Channelthe Rx2 channel.
  • The range possible is of 1 to 9. In this case the rx2 Adaptive is automatically disable.
  • Set 0 if you don't want set this parameter.
  • The function, return the error ARM_ERR_PARAM_OUT_OF_RANGE if this value is out of rang.
Returns
Error available:
Note
You need to call armUpdateConfig() to update the parameters in you ARM.
See also
armLwGetRadio()
armLwEnableRxWindows()
armLwEnableTxAdaptiveSpeed()
armLwEnableDutyCycle()
armLwEnableTxAdaptiveChannel()
armLwIsEnableRx2Adaptive()