cancel
Showing results for 
Search instead for 
Did you mean: 

How get timestamp in i.cube.lrwan library?

Selim Sagir
Associate III

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.

3 REPLIES 3

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
Up vote any posts that you find helpful, it shows what's working..

@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?

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
Up vote any posts that you find helpful, it shows what's working..