Peripheral+Broadcaster 混合模式, 在被讀取服務列表時 有嚴重延時
參考國外TI的帖子:
https://e2e.ti.com/support/wireless_connectivity/f/538/p/197769/1545545#1545545
其內容為:
I believe I have solved this.
Here are my steps to getting the TI provided SimpleBLEPeripheral to work as a Peripheral + Broadcaster Role:
1) Follow the TI instructions (enable PLUS_BROADCASTER, exclude peripheral.c, include peripheralBroadcaster.c)
{Steps 2 through 6 are all done in peripheralBroadcaster.c}
2) Change line 45: #include "hci.h" to: #include "hci_tl.h"
<<Now the Project Compiles>>
3) Change line 641: (GAP_PROFILE_PERIPHERAL | GAP_PROFILE_BROADCASTER) to GAP_PROFILE_PERIPHERAL
<<Now the device will advertise>>
4) In peripheralBroadcaster.c: After line 970: insert this line: VOID osal_set_event( gapRole_TaskID, START_ADVERTISING_EVT );
<<Now the device continues to advertise after it has connected to a central device>>
5) Change line 927: comment out: //gapRole_AdvEnabled = FALSE;
6) After line 927: insert this line: VOID osal_start_timerEx( gapRole_TaskID, START_ADVERTISING_EVT, 1000 );
<<Now, after disconnecting from central device, the device will resume advertising (after 1000 ms)>>
如此確實可以於連結時 同時廣播
但如此修改代碼 會讓主機獲得服務列表時 變的非常緩慢 (discovering service)
我用的主機是安卓上的BLE scanner
設為純外設(peripheral)模式: 連結後獲得服務列表 最慢1秒 , 大多情況是小於人反應速度
但peripheral + Broadcaster 混合模式, 服物列表要最少要五秒才會顯示在手機上
除了讀取服務外 於讀取characteristics列表 與讀取數據 雖然慢了一些些 不過還可接受
那請問該如何修改代碼, 讓服務列表可被讀取得更快呢
謝謝
註: 本人是使用 1.3.2藍牙棧 能否不要升級為1.4.X呢 本人的IAR無法使用之...