@@ -94,7 +94,7 @@ lora_mac_status_t LoRaWANStack::set_application_port(uint8_t port)
94
94
LoRaWANStack::LoRaWANStack ()
95
95
: _loramac(_lora_time), _lora_phy(_lora_time),
96
96
_device_current_state(DEVICE_STATE_NOT_INITIALIZED), _mac_handlers(NULL ),
97
- _num_retry(1 ), _queue(NULL ), _duty_cycle_on(LORAWAN_DUTYCYCLE_ON )
97
+ _num_retry(1 ), _queue(NULL ), _duty_cycle_on(MBED_CONF_LORA_DUTY_CYCLE_ON )
98
98
{
99
99
#ifdef MBED_CONF_LORA_APP_PORT
100
100
// is_port_valid() is not virtual, so we can call it in constructor
@@ -152,7 +152,7 @@ lora_mac_status_t LoRaWANStack::initialize_mac_layer(EventQueue *queue)
152
152
static lora_mac_mib_request_confirm_t mib_req;
153
153
154
154
#if defined(LORAWAN_COMPLIANCE_TEST)
155
- static uint8_t compliance_test_buffer[LORAWAN_TX_MAX_SIZE ];
155
+ static uint8_t compliance_test_buffer[MBED_CONF_LORA_TX_MAX_SIZE ];
156
156
#endif
157
157
158
158
tr_debug (" Initializing MAC layer" );
@@ -174,11 +174,11 @@ lora_mac_status_t LoRaWANStack::initialize_mac_layer(EventQueue *queue)
174
174
_loramac.LoRaMacInitialization (&LoRaMacPrimitives, &LoRaMacCallbacks, &_lora_phy, queue);
175
175
176
176
mib_req.type = LORA_MIB_ADR;
177
- mib_req.param .adr_enable = LORAWAN_ADR_ON ;
177
+ mib_req.param .adr_enable = MBED_CONF_LORA_ADR_ON ;
178
178
mib_set_request (&mib_req);
179
179
180
180
mib_req.type = LORA_MIB_PUBLIC_NETWORK;
181
- mib_req.param .enable_public_network = LORAWAN_PUBLIC_NETWORK ;
181
+ mib_req.param .enable_public_network = MBED_CONF_LORA_PUBLIC_NETWORK ;
182
182
mib_set_request (&mib_req);
183
183
184
184
// Reset counters to zero. Will change in future with 1.1 support.
@@ -217,7 +217,7 @@ void LoRaWANStack::prepare_special_tx_frame(uint8_t port)
217
217
_tx_msg.f_buffer_size = _compliance_test.app_data_size ;
218
218
219
219
_tx_msg.f_buffer [0 ] = _compliance_test.app_data_buffer [0 ];
220
- for (uint8_t i = 1 ; i < MIN (_compliance_test.app_data_size , LORAWAN_TX_MAX_SIZE ); ++i) {
220
+ for (uint8_t i = 1 ; i < MIN (_compliance_test.app_data_size , MBED_CONF_LORA_TX_MAX_SIZE ); ++i) {
221
221
_tx_msg.f_buffer [i] = _compliance_test.app_data_buffer [i];
222
222
}
223
223
break ;
@@ -838,13 +838,13 @@ int16_t LoRaWANStack::handle_tx(uint8_t port, const uint8_t* data,
838
838
839
839
uint16_t max_possible_size = check_possible_tx_size (length);
840
840
841
- if (max_possible_size > LORAWAN_TX_MAX_SIZE ) {
841
+ if (max_possible_size > MBED_CONF_LORA_TX_MAX_SIZE ) {
842
842
// LORAWAN_APP_DATA_MAX_SIZE should at least be
843
843
// either equal to or bigger than maximum possible
844
844
// tx size because our tx message buffer takes its
845
845
// length from that macro. Force maximum possible tx unit
846
846
// to be equal to the buffer size user chose.
847
- max_possible_size = LORAWAN_TX_MAX_SIZE ;
847
+ max_possible_size = MBED_CONF_LORA_TX_MAX_SIZE ;
848
848
}
849
849
850
850
if (max_possible_size < length) {
@@ -1118,8 +1118,8 @@ void LoRaWANStack::mcps_confirm_handler(lora_mac_mcps_confirm_t *mcps_confirm)
1118
1118
// or some other error happened. Discard buffer, unset the tx-ongoing
1119
1119
// flag and let the application know
1120
1120
_tx_msg.tx_ongoing = false ;
1121
- memset (_tx_msg.f_buffer , 0 , LORAWAN_TX_MAX_SIZE );
1122
- _tx_msg.f_buffer_size = LORAWAN_TX_MAX_SIZE ;
1121
+ memset (_tx_msg.f_buffer , 0 , MBED_CONF_LORA_TX_MAX_SIZE );
1122
+ _tx_msg.f_buffer_size = MBED_CONF_LORA_TX_MAX_SIZE ;
1123
1123
1124
1124
tr_error (" mcps_confirm_handler: Error code = %d" , mcps_confirm->status );
1125
1125
@@ -1309,17 +1309,17 @@ void LoRaWANStack::compliance_test_handler(lora_mac_mcps_indication_t *mcps_indi
1309
1309
switch (_compliance_test.state ) {
1310
1310
case 0 : // Check compliance test disable command (ii)
1311
1311
_compliance_test.is_tx_confirmed = true ;
1312
- _compliance_test.app_port = LORAWAN_APP_PORT ;
1312
+ _compliance_test.app_port = MBED_CONF_LORA_APP_PORT ;
1313
1313
_compliance_test.app_data_size = LORAWAN_COMPLIANCE_TEST_DATA_SIZE;
1314
1314
_compliance_test.downlink_counter = 0 ;
1315
1315
_compliance_test.running = false ;
1316
1316
1317
1317
lora_mac_mib_request_confirm_t mib_req;
1318
1318
mib_req.type = LORA_MIB_ADR;
1319
- mib_req.param .adr_enable = LORAWAN_ADR_ON ;
1319
+ mib_req.param .adr_enable = MBED_CONF_LORA_ADR_ON ;
1320
1320
mib_set_request (&mib_req);
1321
1321
#if MBED_CONF_LORA_PHY == 0
1322
- _loramac.LoRaMacTestSetDutyCycleOn (LORAWAN_DUTYCYCLE_ON );
1322
+ _loramac.LoRaMacTestSetDutyCycleOn (MBED_CONF_LORA_DUTY_CYCLE_ON );
1323
1323
#endif
1324
1324
// Go to idle state after compliance test mode.
1325
1325
tr_debug (" Compliance test disabled." );
@@ -1362,16 +1362,16 @@ void LoRaWANStack::compliance_test_handler(lora_mac_mcps_indication_t *mcps_indi
1362
1362
1363
1363
// Disable TestMode and revert back to normal operation
1364
1364
_compliance_test.is_tx_confirmed = true ;
1365
- _compliance_test.app_port = LORAWAN_APP_PORT ;
1365
+ _compliance_test.app_port = MBED_CONF_LORA_APP_PORT ;
1366
1366
_compliance_test.app_data_size = LORAWAN_COMPLIANCE_TEST_DATA_SIZE;
1367
1367
_compliance_test.downlink_counter = 0 ;
1368
1368
_compliance_test.running = false ;
1369
1369
1370
1370
mib_request.type = LORA_MIB_ADR;
1371
- mib_request.param .adr_enable = LORAWAN_ADR_ON ;
1371
+ mib_request.param .adr_enable = MBED_CONF_LORA_ADR_ON ;
1372
1372
mib_set_request (&mib_request);
1373
1373
#if MBED_CONF_LORA_PHY == 0
1374
- _loramac.LoRaMacTestSetDutyCycleOn (LORAWAN_DUTYCYCLE_ON );
1374
+ _loramac.LoRaMacTestSetDutyCycleOn (MBED_CONF_LORA_DUTY_CYCLE_ON );
1375
1375
#endif
1376
1376
mlme_request.type = LORA_MLME_JOIN;
1377
1377
mlme_request.req .join .dev_eui = _lw_session.connection .connection_u .otaa .dev_eui ;
@@ -1828,7 +1828,7 @@ lora_mac_status_t LoRaWANStack::lora_state_machine()
1828
1828
mib_set_request (&mib_req);
1829
1829
1830
1830
// reset buffers to original state
1831
- memset (_tx_msg.f_buffer , 0 , LORAWAN_TX_MAX_SIZE );
1831
+ memset (_tx_msg.f_buffer , 0 , MBED_CONF_LORA_TX_MAX_SIZE );
1832
1832
_tx_msg.pending_size = 0 ;
1833
1833
_tx_msg.f_buffer_size = 0 ;
1834
1834
_tx_msg.tx_ongoing = false ;
0 commit comments