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.

How to retreive a data modifying the BLESimpleObserver example?

Other Parts Discussed in Thread: CC2541DK-MINI, CC2540

Hi! I've a cc2541DK-mini kit and a SensorTag.

I'm using the SensorTag device with the BLESimpleBroadcaster example and I've modified it to send a diferent "AdvData" each time I press a button. I checked it using the TI Sniffer with the cc2540 USB Dongle and it works fine.

Here comes my problem:

I want to use the KeyFob device as an BLESimpleObserver and make it do different things according with the "AdvData" retreived. I checked that it discovers that an advertisement has been launched making a led on when it occurs. But I don't know where the incoming data is stored and how to manage it. My idea is to get the data to analize it and depending on its value to make differents things

I need help!!!

  • In your application layer call back function simpleBLEObserverEventCB() the argument that is passed is of type gapObserverRoleEvent_t. This is a union of different structs (see observer.h) and where the proper struct variables are determined via the opcode.

    Look through the different fields of gapDeviceInfoEvent_t struct found in gap.h and you should be able to access all of the packet information that was received for that device. The stock simpleBLEObserver app only accesses the addr and addrType fields for a GAP_DEVICE_INFO_EVENT but there is more info available in the pEvent struct.

    -Matt

  • Thaks a lot Matt:

    Finally the correct sentences was this:

    simpleBLEAddDeviceInfo( pEvent->deviceInfo.pEvtData, pEvent->deviceInfo.dataLen);
  • Could you pleeeeease provide the code that you used for the keyfob(the modified blesimpleobserver). i want to make exacly what you are describing. but i just cant manage to make the code work. 

    Daniel