@@ -222,7 +222,7 @@ void LoRaMac::OnRadioTxDone( void )
222
222
get_phy_params_t getPhy;
223
223
phy_param_t phyParam;
224
224
set_band_txdone_params_t txDone;
225
- lorawan_time_t curTime = _lora_time.TimerGetCurrentTime ( );
225
+ lorawan_time_t curTime = _lora_time.get_current_time ( );
226
226
loramac_mlme_confirm_t mlme_confirm = mlme.get_confirmation ();
227
227
228
228
if ( _params.dev_class != CLASS_C )
@@ -237,16 +237,16 @@ void LoRaMac::OnRadioTxDone( void )
237
237
// Setup timers
238
238
if ( _params.is_rx_window_enabled == true )
239
239
{
240
- _lora_time.TimerStart ( _params.timers .rx_window1_timer , _params.rx_window1_delay );
240
+ _lora_time.start ( _params.timers .rx_window1_timer , _params.rx_window1_delay );
241
241
if ( _params.dev_class != CLASS_C )
242
242
{
243
- _lora_time.TimerStart ( _params.timers .rx_window2_timer , _params.rx_window2_delay );
243
+ _lora_time.start ( _params.timers .rx_window2_timer , _params.rx_window2_delay );
244
244
}
245
245
if ( ( _params.dev_class == CLASS_C ) || ( _params.is_node_ack_requested == true ) )
246
246
{
247
247
getPhy.attribute = PHY_ACK_TIMEOUT;
248
248
phyParam = lora_phy->get_phy_params (&getPhy);
249
- _lora_time.TimerStart ( _params.timers .ack_timeout_timer , _params.rx_window2_delay + phyParam.value );
249
+ _lora_time.start ( _params.timers .ack_timeout_timer , _params.rx_window2_delay + phyParam.value );
250
250
}
251
251
}
252
252
else
@@ -301,7 +301,7 @@ void LoRaMac::PrepareRxDoneAbort( void )
301
301
_params.flags .bits .mac_done = 1 ;
302
302
303
303
// Trig OnMacCheckTimerEvent call as soon as possible
304
- _lora_time.TimerStart ( _params.timers .mac_state_check_timer , 1 );
304
+ _lora_time.start ( _params.timers .mac_state_check_timer , 1 );
305
305
}
306
306
307
307
void LoRaMac::OnRadioRxDone ( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr )
@@ -349,7 +349,7 @@ void LoRaMac::OnRadioRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8
349
349
350
350
lora_phy->put_radio_to_sleep ();
351
351
352
- _lora_time.TimerStop ( _params.timers .rx_window2_timer );
352
+ _lora_time.stop ( _params.timers .rx_window2_timer );
353
353
354
354
macHdr.value = payload[pktHeaderLen++];
355
355
@@ -702,7 +702,7 @@ void LoRaMac::OnRadioRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8
702
702
703
703
// Stop the AckTimeout timer as no more retransmissions
704
704
// are needed.
705
- _lora_time.TimerStop ( _params.timers .ack_timeout_timer );
705
+ _lora_time.stop ( _params.timers .ack_timeout_timer );
706
706
}
707
707
else
708
708
{
@@ -712,7 +712,7 @@ void LoRaMac::OnRadioRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8
712
712
{
713
713
// Stop the AckTimeout timer as no more retransmissions
714
714
// are needed.
715
- _lora_time.TimerStop ( _params.timers .ack_timeout_timer );
715
+ _lora_time.stop ( _params.timers .ack_timeout_timer );
716
716
}
717
717
}
718
718
}
@@ -750,7 +750,7 @@ void LoRaMac::OnRadioRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8
750
750
_params.flags .bits .mac_done = 1 ;
751
751
752
752
// Trig OnMacCheckTimerEvent call as soon as possible
753
- _lora_time.TimerStart ( _params.timers .mac_state_check_timer , 1 );
753
+ _lora_time.start ( _params.timers .mac_state_check_timer , 1 );
754
754
}
755
755
756
756
void LoRaMac::OnRadioTxTimeout ( void )
@@ -791,9 +791,9 @@ void LoRaMac::OnRadioRxError( void )
791
791
792
792
mlme.get_confirmation ().status = LORAMAC_EVENT_INFO_STATUS_RX1_ERROR;
793
793
794
- if ( _lora_time.TimerGetElapsedTime ( _params.timers .aggregated_last_tx_time ) >= _params.rx_window2_delay )
794
+ if ( _lora_time.get_elapsed_time ( _params.timers .aggregated_last_tx_time ) >= _params.rx_window2_delay )
795
795
{
796
- _lora_time.TimerStop ( _params.timers .rx_window2_timer );
796
+ _lora_time.stop ( _params.timers .rx_window2_timer );
797
797
_params.flags .bits .mac_done = 1 ;
798
798
}
799
799
}
@@ -829,9 +829,9 @@ void LoRaMac::OnRadioRxTimeout( void )
829
829
}
830
830
mlme.get_confirmation ().status = LORAMAC_EVENT_INFO_STATUS_RX1_TIMEOUT;
831
831
832
- if ( _lora_time.TimerGetElapsedTime ( _params.timers .aggregated_last_tx_time ) >= _params.rx_window2_delay )
832
+ if ( _lora_time.get_elapsed_time ( _params.timers .aggregated_last_tx_time ) >= _params.rx_window2_delay )
833
833
{
834
- _lora_time.TimerStop ( _params.timers .rx_window2_timer );
834
+ _lora_time.stop ( _params.timers .rx_window2_timer );
835
835
_params.flags .bits .mac_done = 1 ;
836
836
}
837
837
}
@@ -860,7 +860,7 @@ void LoRaMac::OnMacStateCheckTimerEvent( void )
860
860
phy_param_t phyParam;
861
861
bool txTimeout = false ;
862
862
863
- _lora_time.TimerStop ( _params.timers .mac_state_check_timer );
863
+ _lora_time.stop ( _params.timers .mac_state_check_timer );
864
864
865
865
if ( _params.flags .bits .mac_done == 1 )
866
866
{
@@ -1045,7 +1045,7 @@ void LoRaMac::OnMacStateCheckTimerEvent( void )
1045
1045
else
1046
1046
{
1047
1047
// Operation not finished restart timer
1048
- _lora_time.TimerStart ( _params.timers .mac_state_check_timer , MAC_STATE_CHECK_TIMEOUT );
1048
+ _lora_time.start ( _params.timers .mac_state_check_timer , MAC_STATE_CHECK_TIMEOUT );
1049
1049
}
1050
1050
1051
1051
// Handle MCPS indication
@@ -1078,7 +1078,7 @@ void LoRaMac::OnTxDelayedTimerEvent( void )
1078
1078
1079
1079
lorawan_status_t status = LORAWAN_STATUS_OK;
1080
1080
1081
- _lora_time.TimerStop ( _params.timers .tx_delayed_timer );
1081
+ _lora_time.stop ( _params.timers .tx_delayed_timer );
1082
1082
_params.mac_state &= ~LORAMAC_TX_DELAYED;
1083
1083
1084
1084
if ( ( _params.flags .bits .mlme_req == 1 ) && ( mlme.get_confirmation ().req_type == MLME_JOIN ) )
@@ -1108,7 +1108,7 @@ void LoRaMac::OnTxDelayedTimerEvent( void )
1108
1108
1109
1109
void LoRaMac::OnRxWindow1TimerEvent ( void )
1110
1110
{
1111
- _lora_time.TimerStop ( _params.timers .rx_window1_timer );
1111
+ _lora_time.stop ( _params.timers .rx_window1_timer );
1112
1112
_params.rx_slot = RX_SLOT_WIN_1;
1113
1113
1114
1114
_params.rx_window1_config .channel = _params.channel ;
@@ -1129,7 +1129,7 @@ void LoRaMac::OnRxWindow1TimerEvent( void )
1129
1129
1130
1130
void LoRaMac::OnRxWindow2TimerEvent ( void )
1131
1131
{
1132
- _lora_time.TimerStop ( _params.timers .rx_window2_timer );
1132
+ _lora_time.stop ( _params.timers .rx_window2_timer );
1133
1133
1134
1134
_params.rx_window2_config .channel = _params.channel ;
1135
1135
_params.rx_window2_config .frequency = _params.sys_params .rx2_channel .frequency ;
@@ -1156,7 +1156,7 @@ void LoRaMac::OnRxWindow2TimerEvent( void )
1156
1156
1157
1157
void LoRaMac::OnAckTimeoutTimerEvent ( void )
1158
1158
{
1159
- _lora_time.TimerStop ( _params.timers .ack_timeout_timer );
1159
+ _lora_time.stop ( _params.timers .ack_timeout_timer );
1160
1160
1161
1161
if ( _params.is_node_ack_requested == true )
1162
1162
{
@@ -1325,7 +1325,7 @@ lorawan_status_t LoRaMac::ScheduleTx( void )
1325
1325
_params.mac_state |= LORAMAC_TX_DELAYED;
1326
1326
tr_debug (" Next Transmission in %lu ms" , dutyCycleTimeOff);
1327
1327
1328
- _lora_time.TimerStart ( _params.timers .tx_delayed_timer , dutyCycleTimeOff );
1328
+ _lora_time.start ( _params.timers .tx_delayed_timer , dutyCycleTimeOff );
1329
1329
1330
1330
return LORAWAN_STATUS_OK;
1331
1331
}
@@ -1339,7 +1339,7 @@ void LoRaMac::CalculateBackOff( uint8_t channel )
1339
1339
_params.is_dutycycle_on = MBED_CONF_LORA_DUTY_CYCLE_ON;
1340
1340
calcBackOff.dc_enabled = _params.is_dutycycle_on ;
1341
1341
calcBackOff.channel = channel;
1342
- calcBackOff.elapsed_time = _lora_time.TimerGetElapsedTime ( _params.timers .mac_init_time );
1342
+ calcBackOff.elapsed_time = _lora_time.get_elapsed_time ( _params.timers .mac_init_time );
1343
1343
calcBackOff.tx_toa = _params.timers .tx_toa ;
1344
1344
calcBackOff.last_tx_was_join_req = _params.is_last_tx_join_request ;
1345
1345
@@ -1668,7 +1668,7 @@ lorawan_status_t LoRaMac::SendFrameOnChannel( uint8_t channel )
1668
1668
mlme.get_confirmation ().tx_toa = _params.timers .tx_toa ;
1669
1669
1670
1670
// Starts the MAC layer status check timer
1671
- _lora_time.TimerStart ( _params.timers .mac_state_check_timer , MAC_STATE_CHECK_TIMEOUT );
1671
+ _lora_time.start ( _params.timers .mac_state_check_timer , MAC_STATE_CHECK_TIMEOUT );
1672
1672
1673
1673
if ( _params.is_nwk_joined == false )
1674
1674
{
@@ -1697,7 +1697,7 @@ lorawan_status_t LoRaMac::SetTxContinuousWave( uint16_t timeout )
1697
1697
lora_phy->set_tx_cont_mode (&continuousWave);
1698
1698
1699
1699
// Starts the MAC layer status check timer
1700
- _lora_time.TimerStart ( _params.timers .mac_state_check_timer , MAC_STATE_CHECK_TIMEOUT );
1700
+ _lora_time.start ( _params.timers .mac_state_check_timer , MAC_STATE_CHECK_TIMEOUT );
1701
1701
1702
1702
_params.mac_state |= LORAMAC_TX_RUNNING;
1703
1703
@@ -1718,7 +1718,7 @@ lorawan_status_t LoRaMac::SetTxContinuousWave1( uint16_t timeout, uint32_t frequ
1718
1718
lora_phy->set_tx_cont_mode (&continuousWave);
1719
1719
1720
1720
// Starts the MAC layer status check timer
1721
- _lora_time.TimerStart ( _params.timers .mac_state_check_timer , MAC_STATE_CHECK_TIMEOUT );
1721
+ _lora_time.start ( _params.timers .mac_state_check_timer , MAC_STATE_CHECK_TIMEOUT );
1722
1722
1723
1723
_params.mac_state |= LORAMAC_TX_RUNNING;
1724
1724
@@ -1846,31 +1846,31 @@ lorawan_status_t LoRaMac::LoRaMacInitialization(loramac_primitives_t *primitives
1846
1846
lora_phy->put_radio_to_sleep ();
1847
1847
1848
1848
// Initialize timers
1849
- _lora_time.TimerInit (_params.timers .mac_state_check_timer ,
1849
+ _lora_time.init (_params.timers .mac_state_check_timer ,
1850
1850
mbed::callback (this , &LoRaMac::handle_mac_state_check_timer_event));
1851
- _lora_time.TimerInit (_params.timers .tx_delayed_timer ,
1851
+ _lora_time.init (_params.timers .tx_delayed_timer ,
1852
1852
mbed::callback (this , &LoRaMac::handle_delayed_tx_timer_event));
1853
- _lora_time.TimerInit (_params.timers .rx_window1_timer ,
1853
+ _lora_time.init (_params.timers .rx_window1_timer ,
1854
1854
mbed::callback (this , &LoRaMac::handle_rx1_timer_event));
1855
- _lora_time.TimerInit (_params.timers .rx_window2_timer ,
1855
+ _lora_time.init (_params.timers .rx_window2_timer ,
1856
1856
mbed::callback (this , &LoRaMac::handle_rx2_timer_event));
1857
- _lora_time.TimerInit (_params.timers .ack_timeout_timer ,
1857
+ _lora_time.init (_params.timers .ack_timeout_timer ,
1858
1858
mbed::callback (this , &LoRaMac::handle_ack_timeout));
1859
1859
1860
1860
// Store the current initialization time
1861
- _params.timers .mac_init_time = _lora_time.TimerGetCurrentTime ();
1861
+ _params.timers .mac_init_time = _lora_time.get_current_time ();
1862
1862
1863
1863
return LORAWAN_STATUS_OK;
1864
1864
}
1865
1865
1866
1866
void LoRaMac::disconnect ()
1867
1867
{
1868
1868
// Cancel all timers
1869
- _lora_time.TimerStop (_params.timers .mac_state_check_timer );
1870
- _lora_time.TimerStop (_params.timers .tx_delayed_timer );
1871
- _lora_time.TimerStop (_params.timers .rx_window1_timer );
1872
- _lora_time.TimerStop (_params.timers .rx_window2_timer );
1873
- _lora_time.TimerStop (_params.timers .ack_timeout_timer );
1869
+ _lora_time.stop (_params.timers .mac_state_check_timer );
1870
+ _lora_time.stop (_params.timers .tx_delayed_timer );
1871
+ _lora_time.stop (_params.timers .rx_window1_timer );
1872
+ _lora_time.stop (_params.timers .rx_window2_timer );
1873
+ _lora_time.stop (_params.timers .ack_timeout_timer );
1874
1874
1875
1875
// Put radio to sleep
1876
1876
lora_phy->put_radio_to_sleep ();
@@ -2110,13 +2110,13 @@ radio_events_t *LoRaMac::GetPhyEventHandlers()
2110
2110
2111
2111
lorawan_status_t LoRaMac::LoRaMacSetTxTimer ( uint32_t TxDutyCycleTime )
2112
2112
{
2113
- _lora_time.TimerStart (tx_next_packet_timer, TxDutyCycleTime);
2113
+ _lora_time.start (tx_next_packet_timer, TxDutyCycleTime);
2114
2114
return LORAWAN_STATUS_OK;
2115
2115
}
2116
2116
2117
2117
lorawan_status_t LoRaMac::LoRaMacStopTxTimer ( )
2118
2118
{
2119
- _lora_time.TimerStop (tx_next_packet_timer);
2119
+ _lora_time.stop (tx_next_packet_timer);
2120
2120
return LORAWAN_STATUS_OK;
2121
2121
}
2122
2122
0 commit comments