Skip to main content
Selim Sagir
Associate III
October 4, 2019
Question

How get timestamp in i.cube.lrwan library?

  • October 4, 2019
  • 3 replies
  • 1032 views

Hello, i have two b-l072z board and making LoRa comm as point to point. While I sending ADC data I want to add packet to timestamp. I have inspected hw_rtc.c file and find HW_RTC_GetCalenderValue function. But it make me confusing because of static function. How get RTC_TimeStruct in my main file?

Thanks.

Selim.

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
October 4, 2019

The structure would pull via an include file.

The function would need to be changed from a static one so it could get exported.

You could perhaps use the exported HW_RTC_GetTimerValue() ?

>>But it make me confusing because of static function.

I doesn't have to be, you can change that if you want, it is generally done this way to reduce the name-space and allow for optimization and dead-code removal.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Selim Sagir
Associate III
October 4, 2019

@Community member​  Thanks for your answer. I have used to that function and I can't convert to that ticks to time and date. Do you know how i can do it?

Tesla DeLorean
Guru
October 4, 2019

You'd have to unpack it, pulling out the seconds/sub-seconds so you can pull out a 24-hour day, and then re-calendar it from the initial epoch (day zero).

Not sure the wrapping point of this implementation, looks to be using 10-bit (0..1023) for the sub-second, perhaps 48.55 days for a 32-bit value !? Not sure that's going to be very helpful.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..