Closed amkuipers closed 7 years ago
I suggest we:
float airtime
public so that users can programmatically retrieve the total airtime to make informed decisions, e.g. to change delays. It also enables them to reset the airtime to 0
, e.g. every 24h.trackAirtime()
to create separate public calculateAirtime()
method to allow users to calculate how much a message will cost before sending it.@FokkeZB agreed
Closed by #162
In v1.0,
sendBytes
updates private airtime in classTheThingsNetwork
. In beta, examples just send data and delay for 20s or so. In production there is a need for users to control airtime, and it would be great if the library supports it. I am not aware if TTN Uno has a RTC to 'reset daily used airtime'. But some assistance in calculating a delay/sleep would help. Example: delay_ms = calc_delay( sizeof (user_data_upstream) + sizeof (user_data_downstream ))
, that uses the privatefp
andsf
, etc, to calculate the minimum delay. If an RTC is available, the used airtime can be recorded per day, and thecalc_delay()
can use the remaining airtime in the calculation. Documentation then can have examples that use that delay, or less; multiply the delay by 2, or use something likemax( calc_delay(..), SIX_HOUR)
.