LoRaMAC  4.4.5
Documentation of the API
LoRaMacClassB.h File Reference

LoRa MAC Class B layer implementation. More...

#include "systime.h"
#include "LoRaMacTypes.h"

Go to the source code of this file.

Data Structures

struct  PingSlotContext_t
 
struct  BeaconContext_t
 
struct  BeaconContext_t::sBeaconCtrl
 
struct  LoRaMacClassBCallback_t
 
struct  LoRaMacClassBParams_t
 

Typedefs

typedef void(* LoRaMacClassBNvmEvent) (void)
 

Enumerations

enum  BeaconState_t {
  BEACON_STATE_ACQUISITION, BEACON_STATE_ACQUISITION_BY_TIME, BEACON_STATE_TIMEOUT, BEACON_STATE_BEACON_MISSED,
  BEACON_STATE_REACQUISITION, BEACON_STATE_LOCKED, BEACON_STATE_HALT, BEACON_STATE_IDLE,
  BEACON_STATE_GUARD, BEACON_STATE_RX, BEACON_STATE_LOST
}
 
enum  PingSlotState_t { PINGSLOT_STATE_CALC_PING_OFFSET, PINGSLOT_STATE_SET_TIMER, PINGSLOT_STATE_IDLE, PINGSLOT_STATE_RX }
 

Functions

void LoRaMacClassBInit (LoRaMacClassBParams_t *classBParams, LoRaMacClassBCallback_t *callbacks, LoRaMacClassBNvmEvent classBNvmCtxChanged)
 Initialize LoRaWAN Class B. More...
 
bool LoRaMacClassBRestoreNvmCtx (void *classBNvmCtx)
 
void * LoRaMacClassBGetNvmCtx (size_t *classBNvmCtxSize)
 
void LoRaMacClassBSetBeaconState (BeaconState_t beaconState)
 Set the state of the beacon state machine. More...
 
void LoRaMacClassBSetPingSlotState (PingSlotState_t pingSlotState)
 Set the state of the ping slot state machine. More...
 
void LoRaMacClassBSetMulticastSlotState (PingSlotState_t multicastSlotState)
 Set the state of the multicast slot state machine. More...
 
bool LoRaMacClassBIsAcquisitionInProgress (void)
 Verifies if an acquisition procedure is in progress. More...
 
void LoRaMacClassBBeaconTimerEvent (void *context)
 State machine of the Class B for beaconing.
 
void LoRaMacClassBPingSlotTimerEvent (void *context)
 State machine of the Class B for ping slots.
 
void LoRaMacClassBMulticastSlotTimerEvent (void *context)
 State machine of the Class B for multicast slots.
 
bool LoRaMacClassBRxBeacon (uint8_t *payload, uint16_t size)
 Receives and decodes the beacon frame. More...
 
bool LoRaMacClassBIsBeaconExpected (void)
 The function validates, if the node expects a beacon at the current time. More...
 
bool LoRaMacClassBIsPingExpected (void)
 The function validates, if the node expects a ping slot at the current time. More...
 
bool LoRaMacClassBIsMulticastExpected (void)
 The function validates, if the node expects a multicast slot at the current time. More...
 
bool LoRaMacClassBIsAcquisitionPending (void)
 Verifies if the acquisition pending bit is set. More...
 
bool LoRaMacClassBIsBeaconModeActive (void)
 Verifies if the beacon mode active bit is set. More...
 
void LoRaMacClassBHaltBeaconing (void)
 Stops the beacon and ping slot operation.
 
void LoRaMacClassBResumeBeaconing (void)
 Resumes the beacon and ping slot operation.
 
void LoRaMacClassBSetPingSlotInfo (uint8_t periodicity)
 Sets the periodicity of the ping slots. More...
 
LoRaMacStatus_t LoRaMacClassBSwitchClass (DeviceClass_t nextClass)
 Switches the device class. More...
 
LoRaMacStatus_t LoRaMacClassBMibGetRequestConfirm (MibRequestConfirm_t *mibGet)
 LoRaMAC ClassB MIB-Get. More...
 
LoRaMacStatus_t LoRaMacMibClassBSetRequestConfirm (MibRequestConfirm_t *mibSet)
 LoRaMAC Class B MIB-Set. More...
 
void LoRaMacClassBPingSlotInfoAns (void)
 This function handles the PING_SLOT_FREQ_ANS.
 
uint8_t LoRaMacClassBPingSlotChannelReq (uint8_t datarate, uint32_t frequency)
 This function handles the PING_SLOT_CHANNEL_REQ. More...
 
void LoRaMacClassBBeaconTimingAns (uint16_t beaconTimingDelay, uint8_t beaconTimingChannel, TimerTime_t lastRxDone)
 This function handles the BEACON_TIMING_ANS. More...
 
void LoRaMacClassBDeviceTimeAns (void)
 This function handles the ClassB DEVICE_TIME_ANS.
 
bool LoRaMacClassBBeaconFreqReq (uint32_t frequency)
 This function handles the BEACON_FREQ_REQ. More...
 
TimerTime_t LoRaMacClassBIsUplinkCollision (TimerTime_t txTimeOnAir)
 Queries the ping slot window time. More...
 
void LoRaMacClassBStopRxSlots (void)
 Stops the timers for the RX slots. This includes the timers for ping and multicast slots.
 
void LoRaMacClassBStartRxSlots (void)
 Starts the timers for the RX slots. This includes the timers for ping and multicast slots.
 
void LoRaMacClassBSetMulticastPeriodicity (MulticastCtx_t *multicastChannel)
 Starts the timers for the RX slots. This includes the timers for ping and multicast slots. More...
 
void LoRaMacClassBProcess (void)
 

Detailed Description

LoRa MAC Class B layer implementation.

______ _
/ _____) _ | |
( (____ _____ ____ _| |_ _____ ____| |__
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
(C)2013 Semtech
___ _____ _ ___ _ _____ ___ ___ ___ ___
/ __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __|
\__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _|
|___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
embedded.connectivity.solutions===============
Author
Miguel Luis ( Semtech )
Gregory Cristian ( Semtech )
Daniel Jaeckle ( STACKFORCE )