Skip to content

Commit 8f97e5c

Browse files
committed
Fix ClassB examples.
1 parent 584b8bf commit 8f97e5c

File tree

8 files changed

+8
-392
lines changed

8 files changed

+8
-392
lines changed

src/apps/LoRaMac/classB/B-L072Z-LRWAN1/main.c

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* Defines a random delay for application data transmission duty cycle. 5s,
5454
* value in [ms].
5555
*/
56-
#define APP_TX_DUTYCYCLE_RND 0000
56+
#define APP_TX_DUTYCYCLE_RND 5000
5757

5858
/*!
5959
* Default datarate
@@ -1146,51 +1146,6 @@ static void MlmeIndication( MlmeIndication_t *mlmeIndication )
11461146
}
11471147
}
11481148

1149-
void SetupMulticastChannels( void )
1150-
{
1151-
// Manually setup Multicast Keys.
1152-
MibRequestConfirm_t mibReq;
1153-
1154-
// MC channel 0 App session key setup
1155-
mibReq.Type = MIB_MC_APP_S_KEY_0;
1156-
mibReq.Param.McAppSKey0 = ( uint8_t* )Multicast0AppSKey;
1157-
LoRaMacMibSetRequestConfirm( &mibReq );
1158-
1159-
// MC channel 0 Nwk session key setup
1160-
mibReq.Type = MIB_MC_NWK_S_KEY_0;
1161-
mibReq.Param.McNwkSKey0 = ( uint8_t* )Multicast0NwkSKey;
1162-
LoRaMacMibSetRequestConfirm( &mibReq );
1163-
1164-
// MC channel 1 App session key setup
1165-
mibReq.Type = MIB_MC_APP_S_KEY_1;
1166-
mibReq.Param.McAppSKey1 = ( uint8_t* )Multicast1AppSKey;
1167-
LoRaMacMibSetRequestConfirm( &mibReq );
1168-
1169-
// MC channel 1 Nwk session key setup
1170-
mibReq.Type = MIB_MC_NWK_S_KEY_1;
1171-
mibReq.Param.McNwkSKey1 = ( uint8_t* )Multicast1NwkSKey;
1172-
LoRaMacMibSetRequestConfirm( &mibReq );
1173-
1174-
MulticastChannel_t channel;
1175-
// Setup Channel 0
1176-
channel.AddrID = MULTICAST_0_ADDR;
1177-
channel.Address = MULTICAST_CHANNEL_0_ADDRESS;
1178-
channel.IsEnabled = true;
1179-
channel.Frequency = MULTICAST_CHANNEL_0_FREQUENCY;
1180-
channel.Datarate = MULTICAST_CHANNEL_0_DATARATE;
1181-
channel.Periodicity = MULTICAST_CHANNEL_0_PERIODICITY;
1182-
LoRaMacMulticastChannelSet( channel );
1183-
1184-
// Setup Channel 1
1185-
channel.AddrID = MULTICAST_1_ADDR;
1186-
channel.Address = MULTICAST_CHANNEL_1_ADDRESS;
1187-
channel.IsEnabled = true;
1188-
channel.Frequency = MULTICAST_CHANNEL_1_FREQUENCY;
1189-
channel.Datarate = MULTICAST_CHANNEL_1_DATARATE;
1190-
channel.Periodicity = MULTICAST_CHANNEL_1_PERIODICITY;
1191-
LoRaMacMulticastChannelSet( channel );
1192-
}
1193-
11941149
void OnMacProcessNotify( void )
11951150
{
11961151
IsMacProcessPending = 1;
@@ -1305,9 +1260,6 @@ int main( void )
13051260

13061261
case DEVICE_STATE_START:
13071262
{
1308-
// Currently at least 1 Multicast channel must be created before the MAC initialization.
1309-
//SetupMulticastChannels( );
1310-
13111263
TimerInit( &TxNextPacketTimer, OnTxNextPacketTimerEvent );
13121264

13131265
TimerInit( &Led1Timer, OnLed1TimerEvent );

src/apps/LoRaMac/classB/NAMote72/main.c

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* Defines a random delay for application data transmission duty cycle. 5s,
5757
* value in [ms].
5858
*/
59-
#define APP_TX_DUTYCYCLE_RND 0000
59+
#define APP_TX_DUTYCYCLE_RND 5000
6060

6161
/*!
6262
* Default datarate
@@ -1223,51 +1223,6 @@ static void MlmeIndication( MlmeIndication_t *mlmeIndication )
12231223
}
12241224
}
12251225

1226-
void SetupMulticastChannels( void )
1227-
{
1228-
// Manually setup Multicast Keys.
1229-
MibRequestConfirm_t mibReq;
1230-
1231-
// MC channel 0 App session key setup
1232-
mibReq.Type = MIB_MC_APP_S_KEY_0;
1233-
mibReq.Param.McAppSKey0 = ( uint8_t* )Multicast0AppSKey;
1234-
LoRaMacMibSetRequestConfirm( &mibReq );
1235-
1236-
// MC channel 0 Nwk session key setup
1237-
mibReq.Type = MIB_MC_NWK_S_KEY_0;
1238-
mibReq.Param.McNwkSKey0 = ( uint8_t* )Multicast0NwkSKey;
1239-
LoRaMacMibSetRequestConfirm( &mibReq );
1240-
1241-
// MC channel 1 App session key setup
1242-
mibReq.Type = MIB_MC_APP_S_KEY_1;
1243-
mibReq.Param.McAppSKey1 = ( uint8_t* )Multicast1AppSKey;
1244-
LoRaMacMibSetRequestConfirm( &mibReq );
1245-
1246-
// MC channel 1 Nwk session key setup
1247-
mibReq.Type = MIB_MC_NWK_S_KEY_1;
1248-
mibReq.Param.McNwkSKey1 = ( uint8_t* )Multicast1NwkSKey;
1249-
LoRaMacMibSetRequestConfirm( &mibReq );
1250-
1251-
MulticastChannel_t channel;
1252-
// Setup Channel 0
1253-
channel.AddrID = MULTICAST_0_ADDR;
1254-
channel.Address = MULTICAST_CHANNEL_0_ADDRESS;
1255-
channel.IsEnabled = true;
1256-
channel.Frequency = MULTICAST_CHANNEL_0_FREQUENCY;
1257-
channel.Datarate = MULTICAST_CHANNEL_0_DATARATE;
1258-
channel.Periodicity = MULTICAST_CHANNEL_0_PERIODICITY;
1259-
LoRaMacMulticastChannelSet( channel );
1260-
1261-
// Setup Channel 1
1262-
channel.AddrID = MULTICAST_1_ADDR;
1263-
channel.Address = MULTICAST_CHANNEL_1_ADDRESS;
1264-
channel.IsEnabled = true;
1265-
channel.Frequency = MULTICAST_CHANNEL_1_FREQUENCY;
1266-
channel.Datarate = MULTICAST_CHANNEL_1_DATARATE;
1267-
channel.Periodicity = MULTICAST_CHANNEL_1_PERIODICITY;
1268-
LoRaMacMulticastChannelSet( channel );
1269-
}
1270-
12711226
void OnMacProcessNotify( void )
12721227
{
12731228
IsMacProcessPending = 1;
@@ -1382,9 +1337,6 @@ int main( void )
13821337

13831338
case DEVICE_STATE_START:
13841339
{
1385-
// Currently at least 1 Multicast channel must be created before the MAC initialization.
1386-
//SetupMulticastChannels( );
1387-
13881340
TimerInit( &TxNextPacketTimer, OnTxNextPacketTimerEvent );
13891341

13901342
TimerInit( &Led1Timer, OnLed1TimerEvent );

src/apps/LoRaMac/classB/NucleoL073/main.c

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* Defines a random delay for application data transmission duty cycle. 5s,
5454
* value in [ms].
5555
*/
56-
#define APP_TX_DUTYCYCLE_RND 0000
56+
#define APP_TX_DUTYCYCLE_RND 5000
5757

5858
/*!
5959
* Default datarate
@@ -1128,51 +1128,6 @@ static void MlmeIndication( MlmeIndication_t *mlmeIndication )
11281128
}
11291129
}
11301130

1131-
void SetupMulticastChannels( void )
1132-
{
1133-
// Manually setup Multicast Keys.
1134-
MibRequestConfirm_t mibReq;
1135-
1136-
// MC channel 0 App session key setup
1137-
mibReq.Type = MIB_MC_APP_S_KEY_0;
1138-
mibReq.Param.McAppSKey0 = ( uint8_t* )Multicast0AppSKey;
1139-
LoRaMacMibSetRequestConfirm( &mibReq );
1140-
1141-
// MC channel 0 Nwk session key setup
1142-
mibReq.Type = MIB_MC_NWK_S_KEY_0;
1143-
mibReq.Param.McNwkSKey0 = ( uint8_t* )Multicast0NwkSKey;
1144-
LoRaMacMibSetRequestConfirm( &mibReq );
1145-
1146-
// MC channel 1 App session key setup
1147-
mibReq.Type = MIB_MC_APP_S_KEY_1;
1148-
mibReq.Param.McAppSKey1 = ( uint8_t* )Multicast1AppSKey;
1149-
LoRaMacMibSetRequestConfirm( &mibReq );
1150-
1151-
// MC channel 1 Nwk session key setup
1152-
mibReq.Type = MIB_MC_NWK_S_KEY_1;
1153-
mibReq.Param.McNwkSKey1 = ( uint8_t* )Multicast1NwkSKey;
1154-
LoRaMacMibSetRequestConfirm( &mibReq );
1155-
1156-
MulticastChannel_t channel;
1157-
// Setup Channel 0
1158-
channel.AddrID = MULTICAST_0_ADDR;
1159-
channel.Address = MULTICAST_CHANNEL_0_ADDRESS;
1160-
channel.IsEnabled = true;
1161-
channel.Frequency = MULTICAST_CHANNEL_0_FREQUENCY;
1162-
channel.Datarate = MULTICAST_CHANNEL_0_DATARATE;
1163-
channel.Periodicity = MULTICAST_CHANNEL_0_PERIODICITY;
1164-
LoRaMacMulticastChannelSet( channel );
1165-
1166-
// Setup Channel 1
1167-
channel.AddrID = MULTICAST_1_ADDR;
1168-
channel.Address = MULTICAST_CHANNEL_1_ADDRESS;
1169-
channel.IsEnabled = true;
1170-
channel.Frequency = MULTICAST_CHANNEL_1_FREQUENCY;
1171-
channel.Datarate = MULTICAST_CHANNEL_1_DATARATE;
1172-
channel.Periodicity = MULTICAST_CHANNEL_1_PERIODICITY;
1173-
LoRaMacMulticastChannelSet( channel );
1174-
}
1175-
11761131
void OnMacProcessNotify( void )
11771132
{
11781133
IsMacProcessPending = 1;
@@ -1287,9 +1242,6 @@ int main( void )
12871242

12881243
case DEVICE_STATE_START:
12891244
{
1290-
// Currently at least 1 Multicast channel must be created before the MAC initialization.
1291-
//SetupMulticastChannels( );
1292-
12931245
TimerInit( &TxNextPacketTimer, OnTxNextPacketTimerEvent );
12941246

12951247
TimerInit( &Led1Timer, OnLed1TimerEvent );

src/apps/LoRaMac/classB/NucleoL152/main.c

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* Defines a random delay for application data transmission duty cycle. 5s,
5454
* value in [ms].
5555
*/
56-
#define APP_TX_DUTYCYCLE_RND 0000
56+
#define APP_TX_DUTYCYCLE_RND 5000
5757

5858
/*!
5959
* Default datarate
@@ -1128,51 +1128,6 @@ static void MlmeIndication( MlmeIndication_t *mlmeIndication )
11281128
}
11291129
}
11301130

1131-
void SetupMulticastChannels( void )
1132-
{
1133-
// Manually setup Multicast Keys.
1134-
MibRequestConfirm_t mibReq;
1135-
1136-
// MC channel 0 App session key setup
1137-
mibReq.Type = MIB_MC_APP_S_KEY_0;
1138-
mibReq.Param.McAppSKey0 = ( uint8_t* )Multicast0AppSKey;
1139-
LoRaMacMibSetRequestConfirm( &mibReq );
1140-
1141-
// MC channel 0 Nwk session key setup
1142-
mibReq.Type = MIB_MC_NWK_S_KEY_0;
1143-
mibReq.Param.McNwkSKey0 = ( uint8_t* )Multicast0NwkSKey;
1144-
LoRaMacMibSetRequestConfirm( &mibReq );
1145-
1146-
// MC channel 1 App session key setup
1147-
mibReq.Type = MIB_MC_APP_S_KEY_1;
1148-
mibReq.Param.McAppSKey1 = ( uint8_t* )Multicast1AppSKey;
1149-
LoRaMacMibSetRequestConfirm( &mibReq );
1150-
1151-
// MC channel 1 Nwk session key setup
1152-
mibReq.Type = MIB_MC_NWK_S_KEY_1;
1153-
mibReq.Param.McNwkSKey1 = ( uint8_t* )Multicast1NwkSKey;
1154-
LoRaMacMibSetRequestConfirm( &mibReq );
1155-
1156-
MulticastChannel_t channel;
1157-
// Setup Channel 0
1158-
channel.AddrID = MULTICAST_0_ADDR;
1159-
channel.Address = MULTICAST_CHANNEL_0_ADDRESS;
1160-
channel.IsEnabled = true;
1161-
channel.Frequency = MULTICAST_CHANNEL_0_FREQUENCY;
1162-
channel.Datarate = MULTICAST_CHANNEL_0_DATARATE;
1163-
channel.Periodicity = MULTICAST_CHANNEL_0_PERIODICITY;
1164-
LoRaMacMulticastChannelSet( channel );
1165-
1166-
// Setup Channel 1
1167-
channel.AddrID = MULTICAST_1_ADDR;
1168-
channel.Address = MULTICAST_CHANNEL_1_ADDRESS;
1169-
channel.IsEnabled = true;
1170-
channel.Frequency = MULTICAST_CHANNEL_1_FREQUENCY;
1171-
channel.Datarate = MULTICAST_CHANNEL_1_DATARATE;
1172-
channel.Periodicity = MULTICAST_CHANNEL_1_PERIODICITY;
1173-
LoRaMacMulticastChannelSet( channel );
1174-
}
1175-
11761131
void OnMacProcessNotify( void )
11771132
{
11781133
IsMacProcessPending = 1;
@@ -1287,9 +1242,6 @@ int main( void )
12871242

12881243
case DEVICE_STATE_START:
12891244
{
1290-
// Currently at least 1 Multicast channel must be created before the MAC initialization.
1291-
//SetupMulticastChannels( );
1292-
12931245
TimerInit( &TxNextPacketTimer, OnTxNextPacketTimerEvent );
12941246

12951247
TimerInit( &Led1Timer, OnLed1TimerEvent );

src/apps/LoRaMac/classB/SAML21/main.c

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
* Defines a random delay for application data transmission duty cycle. 5s,
6161
* value in [ms].
6262
*/
63-
#define APP_TX_DUTYCYCLE_RND 0000
63+
#define APP_TX_DUTYCYCLE_RND 5000
6464

6565
/*!
6666
* Default datarate
@@ -1134,51 +1134,6 @@ static void MlmeIndication( MlmeIndication_t *mlmeIndication )
11341134
}
11351135
}
11361136

1137-
void SetupMulticastChannels( void )
1138-
{
1139-
// Manually setup Multicast Keys.
1140-
MibRequestConfirm_t mibReq;
1141-
1142-
// MC channel 0 App session key setup
1143-
mibReq.Type = MIB_MC_APP_S_KEY_0;
1144-
mibReq.Param.McAppSKey0 = ( uint8_t* )Multicast0AppSKey;
1145-
LoRaMacMibSetRequestConfirm( &mibReq );
1146-
1147-
// MC channel 0 Nwk session key setup
1148-
mibReq.Type = MIB_MC_NWK_S_KEY_0;
1149-
mibReq.Param.McNwkSKey0 = ( uint8_t* )Multicast0NwkSKey;
1150-
LoRaMacMibSetRequestConfirm( &mibReq );
1151-
1152-
// MC channel 1 App session key setup
1153-
mibReq.Type = MIB_MC_APP_S_KEY_1;
1154-
mibReq.Param.McAppSKey1 = ( uint8_t* )Multicast1AppSKey;
1155-
LoRaMacMibSetRequestConfirm( &mibReq );
1156-
1157-
// MC channel 1 Nwk session key setup
1158-
mibReq.Type = MIB_MC_NWK_S_KEY_1;
1159-
mibReq.Param.McNwkSKey1 = ( uint8_t* )Multicast1NwkSKey;
1160-
LoRaMacMibSetRequestConfirm( &mibReq );
1161-
1162-
MulticastChannel_t channel;
1163-
// Setup Channel 0
1164-
channel.AddrID = MULTICAST_0_ADDR;
1165-
channel.Address = MULTICAST_CHANNEL_0_ADDRESS;
1166-
channel.IsEnabled = true;
1167-
channel.Frequency = MULTICAST_CHANNEL_0_FREQUENCY;
1168-
channel.Datarate = MULTICAST_CHANNEL_0_DATARATE;
1169-
channel.Periodicity = MULTICAST_CHANNEL_0_PERIODICITY;
1170-
LoRaMacMulticastChannelSet( channel );
1171-
1172-
// Setup Channel 1
1173-
channel.AddrID = MULTICAST_1_ADDR;
1174-
channel.Address = MULTICAST_CHANNEL_1_ADDRESS;
1175-
channel.IsEnabled = true;
1176-
channel.Frequency = MULTICAST_CHANNEL_1_FREQUENCY;
1177-
channel.Datarate = MULTICAST_CHANNEL_1_DATARATE;
1178-
channel.Periodicity = MULTICAST_CHANNEL_1_PERIODICITY;
1179-
LoRaMacMulticastChannelSet( channel );
1180-
}
1181-
11821137
void OnMacProcessNotify( void )
11831138
{
11841139
IsMacProcessPending = 1;
@@ -1295,9 +1250,6 @@ int main( void )
12951250

12961251
case DEVICE_STATE_START:
12971252
{
1298-
// Currently at least 1 Multicast channel must be created before the MAC initialization.
1299-
//SetupMulticastChannels( );
1300-
13011253
TimerInit( &TxNextPacketTimer, OnTxNextPacketTimerEvent );
13021254

13031255
TimerInit( &Led1Timer, OnLed1TimerEvent );

0 commit comments

Comments
 (0)