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.

GATT Notification Send / Receive confusion

Other Parts Discussed in Thread: CC2541, CC2540

Hi,

I'm new to BLE thing and before posting anything, i have went through SimpleBLEPeripheral / KeyFob example and the wiki page realting the transferring data through GATT_notification. I've seen numerous post on not able to receive data on iPhone and having send them successfully by CC2541. I also read that one should enable the client characteristic configuration to be able to receive data. My quesion is on which side I do that? i mean, on the client side (phone) or server side (cutom CC2541 board being used in periphral role only)

What "things" I have to set for the characteristics being sent by my module in order for client (phone) to receive it?

I would really appreciate giving answeres in terms of client being the phone and server being me.

thanks

  • On a low level, the client writes 0x0001 to the handle after the target characteristic (assuming the characteristic descriptor claims to be notify).

    At a higher level, you tell the iOS that you want to subscribe and you register a callback.

    You can download Light Blue from the app store to try this out. In Light Blue, there will be a "Listen for notifications" option for relevant characteristics. The TI Sensortag has a few notification characteristics. 

  • Hi,

    Thanks for the quick reply. In the simpleBLEPeripheral example (SimpleGATTProfile.c file) characteristic4 has GATT_PROP_NOTIFY property. Does that mean client(phone) will only receive characteristic4 value and not others? What does GATT_PROP_NOTIFY mean? can I make all the characteristic 5 bytes long?

    Thanks
  • GATT_PROP_NOTIFY is a bit mask that makes up the descriptor (properties). Other properties include read, authenticated read, write , indicate, etc. The descriptors are purely an FYI to the client. They don't actually impact how the characteristic behaves.

    characteristic4 has additional code in the read callback (and elsewhere) to actually make the notifications function. You can make all the characteristics 5 bytes long, just be sure to edit the read and write callbacks. The CC2541 limits the max notification packet to 20 bytes long

  • Hi,

    Ok. I will read the chapter 5 again of the swru271g.pdf. Also I will go through the related posts in case I get my answer. It seems that they have explained different things there. After reading I will cross check few things with you, just in case. By this, i will save your time. Thanks for your help
  • Hi,

    Over the weekend I had a chance to read the chapter 5 again. I understood that only the characteristic which has "notify property" will be able to update its value to client. However on page 48 of swru271 it says char 4 has 1 byte value that cant be read or write from client device. and earlier you said that in order for client to get notified it has to write 0x001 value. so hows that possible? I also google this and got a good article, mbientlab.com/.../, which says "f the client has subscribed to notifications on that characteristic, then the new value is pushed to the client when it is written." so hows does client "subscribe" for notification? by writing 0x001 to its handle???

    thanks
  • I don't think you are making progress by only reading. Use a low level tool like gatttool, Python, or bttool to subscribe. The subject is covered in detail in multiple threads on the board
  • You got the point! Reading the CC2540 datasheet really not helping much (or should said, not helpful at all for beginner). Btool is the best for the moment. At least you can test out all the function one by one.