Other Parts Discussed in Thread: SYSCONFIG
Hi,
I’m currently trying to develop a sensor which uses DMM to implement a ZigBee Router and Bluetooth Simple Peripheral.
For this, I used the example dmm_zr_light_remote_display.
Now, for Bluetooth, I want to implement a pairing and bonding between peripheral and central based on white list.
The peripheral should accept only central devices from a white list. When a button is pressed, then the device should accept any connection for 20 seconds.
I tried to set the parameter with GapAdv_setParam() to enable white list, which doesn’t work. The function returns a value of 2, which I think is INVALIDPARAMETER.
This is how I tried to implement:
When the GAP_DEVICE_INIT_DONE_EVENT Event is send, I set the Parameter to use only white list before I enable the Advertising:
status = GapAdv_setParam(advHandleLegacy, GAP_ADV_PARAM_FILTER_POLICY, GAP_ADV_WL_POLICY_WL_ALL_REQ);
This doesn’t work and the value of status is 2.
Then I tried to set the value directly:
advParams1.filterPolicy = GAP_ADV_WL_POLICY_WL_ALL_REQ;
This works and the device accepts only devices in the white list.
When I press the button, the device should accept any connection, so I tried:
status = GapAdv_setParam(advHandleLegacy, GAP_ADV_PARAM_FILTER_POLICY, GAP_ADV_WL_POLICY_ANY_REQ);
This works without any problems (status = 0) and the device accepts any connection.
After 20 Seconds the device should fall back to accept only white listed devices:
status = GapAdv_setParam(advHandleLegacy, GAP_ADV_PARAM_FILTER_POLICY, GAP_ADV_WL_POLICY_WL_ALL_REQ);
This doesn’t work and the value of status is 2.
Does anybody know, what I'm doing wrong?
Thanks for any help!
Regards
Thomas