1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 06:23:53 +01:00

pkg/semtech-loramac: enable setting channels mask

- user can set the channel mask
- includes a patch due to LoRa v1.0.3rA spec change
This commit is contained in:
Geovane Fedrecheski 2022-03-17 23:33:34 -03:00
parent d894d658d4
commit d5b4492cf3
3 changed files with 60 additions and 0 deletions

View File

@ -407,3 +407,14 @@ uint32_t semtech_loramac_get_uplink_counter(semtech_loramac_t *mac)
mutex_unlock(&mac->lock);
return counter;
}
void semtech_loramac_set_channels_mask(semtech_loramac_t *mac, uint16_t *mask)
{
mutex_lock(&mac->lock);
DEBUG("[semtech-loramac] setting channels mask\n");
MibRequestConfirm_t mibReqChannel;
mibReqChannel.Type = MIB_CHANNELS_MASK;
mibReqChannel.Param.ChannelsMask = mask;
LoRaMacMibSetRequestConfirm(&mibReqChannel);
mutex_unlock(&mac->lock);
}

View File

@ -504,6 +504,14 @@ uint8_t semtech_loramac_get_rx2_dr(semtech_loramac_t *mac);
*/
void semtech_loramac_set_uplink_counter(semtech_loramac_t *mac, uint32_t counter);
/**
* @brief Sets the Channels Mask
*
* @param[in] mac Pointer to the mac
* @param[in] mask Mask array, e.g., {0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000}
*/
void semtech_loramac_set_channels_mask(semtech_loramac_t *mac, uint16_t *mask);
/**
* @brief Gets the Uplink Frame Counter
*

View File

@ -0,0 +1,41 @@
From ba0f363621429a2f6ac78d63f1d17ec322820814 Mon Sep 17 00:00:00 2001
From: Geovane Fedrecheski <geonnave@gmail.com>
Date: Thu, 17 Mar 2022 23:11:38 -0300
Subject: [PATCH] relax channel mask rules in region AU915
This reflects the latest state of the RegionAU915ChanMaskSet function
(latest change in Mar 8 2021):
https://github.com/Lora-net/LoRaMac-node/blob/691086af5524803d17fd22d3096cda62da4b0713/src/mac/region/RegionAU915.c#L475
The removal of the rules was made in this commit:
https://github.com/Lora-net/LoRaMac-node/commit/e60bd869
---
src/mac/region/RegionAU915.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/src/mac/region/RegionAU915.c b/src/mac/region/RegionAU915.c
index 067a15df..68b311fd 100644
--- a/src/mac/region/RegionAU915.c
+++ b/src/mac/region/RegionAU915.c
@@ -384,17 +384,6 @@ void RegionAU915ApplyCFList( ApplyCFListParams_t* applyCFList )
bool RegionAU915ChanMaskSet( ChanMaskSetParams_t* chanMaskSet )
{
- uint8_t nbChannels = RegionCommonCountChannels( chanMaskSet->ChannelsMaskIn, 0, 4 );
-
- // Check the number of active channels
- // According to ACMA regulation, we require at least 20 125KHz channels, if
- // the node shall utilize 125KHz channels.
- if( ( nbChannels < 20 ) &&
- ( nbChannels > 0 ) )
- {
- return false;
- }
-
switch( chanMaskSet->ChannelsMaskType )
{
case CHANNELS_MASK:
--
2.20.1