This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am using the CC2540 Mini DK and have the USB dongle as the central device and the KeyFob as the peripheral. I have the KeyFob update the advertisement data with the accelerometer positions as it is moved. I would like the USB to scan for these values and then print them to a file somewhere so I can track the movement. In order to do this, I want to start just by figuring out how to read the address of the connecting device (in this case, the peripheral device). How would I go about doing that?
I'm using the SimpleBLECentral code on the dongle . I know that a series of "GAP_DEVICE_INFO_EVENT" events are added to the stack and that these have a type gapDeviceInfoevent_t. Inside this struct there is a pEvtData array which holds the advertisement data. However, when I flash the code to the dongle and have the KeyFob advertising, it doesn't recognize it and doesn't reach any of the GAP_DEVICE_INFO_EVENTS.
If you have any specifics about reading the address of the peripheral device, writing this value to a file, or reading the advertising data, that would be helpful.
Thanks!
Hello. What you are describing is exactly what the simpleBLECentral does. One source of problem could be that you did not configure the simpleBLECentral project correctly for the USB dongle (i.e. using the correct HAL files).
Also note that, by default, simpleBLECentral filters out all devices that don't advertise that they have the simpleGATTprofile. To remove this filtering, set DEFAULT_DEV_DISC_BY_SVC_UUID in simpleBLEcentral.c to FALSE.
Assuming all goes well, you will receive advetisements in the application in the GAP_DEVICE_DISCOVERY_EVENT case of the simpleBLECentralEventCB.
You may be doing this already but I would recommend using the GAPRole command GAPCentralRole_StartDiscovery(). GAP_DeviceDiscoveryRequest() is one layer down at the GAP layer. GAPRole handles some configuration, i.e.
bStatus_t GAPCentralRole_StartDiscovery( uint8 mode, uint8 activeScan, uint8 whiteList ) { gapDevDiscReq_t params; params.taskID = gapCentralRoleTaskId; params.mode = mode; params.activeScan = activeScan; params.whiteList = whiteList; return GAP_DeviceDiscoveryRequest( ¶ms ); }
This is all explained in detail in the software developer guide included with the 1.4.1 stack (http://www.ti.com/blestack)
If you are already doing this, than there could be a few possible problems:
1. SimpleBLECentral, by default, filters out any devices that aren't advertising with the simpleGATTProfile in their advertising data. You can remove this by setting DEFAULT_DEV_DISC_BY_SVC_UUID in simpleBLEcentral.c to FALSE
2. No devices are advertising. You can check this with a sniffer or a smartphone app.