TI大神,
为实现低功耗,2640已设置了开机进入shutdown模式,用按键可以唤醒并开始广播。现在的问题是,如何设置代码,实现当手机APP与2640设备断开后,2640能再次自动进入shutdown模式,当下次按键唤醒时,再次开始广播,如此循环往复。
Viki Shi:
开启power saving后,系统在任务完成后会自动进入低功耗模式,具体请参考CC26XX power management的文档: www.ti.com/…/sprui20.pdf
Eggsy Pang:
你有参考我们的pin shutdown的例程吗?直接把关键代码放在断开连接的地方就行了,按键后相当于类似复位的感觉,代码会重新跑,也就是说会重新广播
Eggsy Pang:
你有参考我们的pin shutdown的例程吗?直接把关键代码放在断开连接的地方就行了,按键后相当于类似复位的感觉,代码会重新跑,也就是说会重新广播
hao Q:
回复 Eggsy Pang:
谢谢解答!
typedef enum{ GAPROLE_INIT = 0, //!< Waiting to be started GAPROLE_STARTED, //!< Started but not advertising GAPROLE_ADVERTISING, //!< Currently Advertising GAPROLE_ADVERTISING_NONCONN, //!< Currently using non-connectable Advertising GAPROLE_WAITING, //!< Device is started but not advertising, is in waiting period before advertising again GAPROLE_WAITING_AFTER_TIMEOUT, //!< Device just timed out from a connection but is not yet advertising, is in waiting period before advertising again GAPROLE_CONNECTED, //!< In a connection GAPROLE_CONNECTED_ADV, //!< In a connection + advertising GAPROLE_ERROR //!< Error occurred – invalid state} gaprole_States_t;
这个枚举中哪一个是断开连接啊,我试了三个都不行
Eggsy Pang:
回复 hao Q:
这两个都是:GAPROLE_WAITING 和GAPROLE_WAITING_AFTER_TIMEOUT,
mark_xu:
在断开的地方,设置个定时事件,进入shutdown
hao Q:
回复 Eggsy Pang:
两个都试了,断不开啊,还是一直发。说明:我程序中设置了每15秒采样AD数据并发送。
Eggsy Pang:
回复 hao Q:
你要的是手机主动断开,还是板子自动断开手机啊?
hao Q:
回复 Eggsy Pang:
我要的是当手机APP断开时,板子能自动感知并停止定时采样数据的程序,进入低功耗广播。