在每个广告改变制造商数据ment?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
essele
Offline
Last seen:2 months 2 weeks ago
加入:2020-12-19 15:33
在每个广告改变制造商数据ment?

Hi,

I'm working on a project which advertises some sensor and status information as part of the manufacturer data in the advertising packet.

I understand the example that uses a timer to change the data ... so it's relatively easy to change the data at specific intervals, however I would like to include a "time since last reading" field, so that needs me to be able to change the data for each advertising packet.

Is that possible? I understand I could setup a timer that's just slightly less than the advertising interval, but that would mean waking up twice and power consumption is absolutely key .. and clearly it needs to wake up to send the packet, so why not use the same wake-up event to adjust the data?

Is there a callback or something I can use to achieve this?

Many thanks,

Lee.

Device:
essele
Offline
Last seen:2 months 2 weeks ago
加入:2020-12-19 15:33
Answering my question, but

Answering my question, but also with another question....

The easiest way I've found (so far) is to use a user_app_resume_from_sleep() callback ... it's not perfect since (a) you may be waking for something other than advertising, and (b) presumably there are situations where you may not have gone to sleep, and therefore won't wake. But with my current testing it seems to be ok. Would be nice to have something that is specific to individual advertising packets though!

BUT ... in that resume_from_sleep() callback I use app_easy_gap_update_adv_data() which ultimately sends a message ... which I assume is queued somehow.

So my question is ... upon wakeup, will the message be processed before the advertisement packet is sent? Or will the update be delayed until the next packet? I *think* from looking at the code, that it depends how rwip_schedule() handles things and there's no source for that to look at.

Thanks,

Lee.

PM_Dialog
Offline
Last seen:1 day 1 hour ago
Staff
加入:2018-02-08 11:03
Hi There,

Hi There,

Apologies for the delay. Could you please explain the : "time since last reading" ?

You could set-up an app_easy_timer and update the manufacturer specific data upon its expiration.

Thanks, PM_Dialog