- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi. I want a passive BLE Observer to accept advertising packets from one and only one designated BLE Peripheral. Is this possible? I've studied the Cypress BLE_Whitelist project on GitHub but I am still having trouble. I believe all I need to do is, in my Observer's main.c, pass my designated Peripheral's 6 byte public address by calling CyBle_GapAddDeviceToWhiteList(). Then if my Observer is set to passive scanning and whitelist only filtering, it should work, correct?
The problem I am having is correctly getting the designated Peripheral's 6 byte address into the bdAddr[] of my CYBLE_GAP_BD_ADDR_T struct. Could you show me what that should look like?
Thanks much,
Pat Dolan
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The address should be used as following:
CYBLE_GAP_BD_ADDR_T bdAddr;
bdAddr.bdAddr[0] = 0x01; /* LSB of 6 byte Address */
bdAddr.bdAddr[1] = 0x02;
bdAddr.bdAddr[2] = 0x03;
bdAddr.bdAddr[3] = 0x04;
bdAddr.bdAddr[4] = 0x05;
bdAddr.bdAddr[5] = 0x06; /* MSB of 6 byte Address */
bdAddr.type = 0; /* public = 0, Random = 1 */
CyBle_GapAddDeviceToWhiteList(&bdAddr);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks roit.
I put the code below in my empty main.c file, just above the int main() loop:
************************************
#include<project.h>
#include<BLE_1_Stack.h>
CYBLE_GAP_BD_ADDR_T periph;
periph.bdAddr[0] = 0x01; /* LSB of 6 byte Address */
periph.bdAddr[1] = 0x02;
periph.bdAddr[2] = 0x03;
periph.bdAddr[3] = 0x04;
periph.bdAddr[4] = 0x05;
periph.bdAddr[5] = 0x06; /* MSB of 6 byte Address */
periph.type = 0; /* public = 0, Random = 1 */
CyBle_GapAddDeviceToWhiteList(&periph);
********************************************
All but the top line of code had syntax errors.
The lsb to msb lines had the same error message: unknown type name 'periph'
The periph.type line's error message was also: unknown type name 'periph'
The error on the line CyBle_GapAddDeviceToWhiteList(&periph); was: type specifier missing, defaults to int
The same results obtained when I pasted in your code exactly as is: unknown type name 'bdAddr' on all lines but the top and bottom.
What have I left out?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What I mean is this line:
CYBLE_GAP_BD_ADDR_T periph;
had no error
Nor did "CYBLE_GAP_BD_ADDR_T bdAddr;" when I pasted your code.