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.

Notify and Indicate as GATT Client

Using Bluetopia, I see there are GATT apis for send indication and notification value if host device is acting as a server. What I don't seem to find is a mechanism to retrieve notifications if we are acting as a client. I've looked through GATT APIs, GAPS APIs, and BluetopiaCore APIs.

  • Hi,

    I think you should be receiving "getGATTHandleValueData" in the event callback that has been registered, which means that remote device has sent either a GATT Handle Value Notification or Indication to the local device. as menctioned in the BluetopiaPMCoreAPI.pdf document part of the SDK release.
  • I've looked at that. Looks like that's meant to send notification and indication to a connected device when behaving as a peripheral. I'm looking to get notifications/indication from a connected peripheral acting as a central. If you look at the API, GATM_SendHandleValueNotification includes a pointer of the data to send, not receive. I don't find an API to request notification. Nor does it say you can use the same function (either my sending null pointer or something else) to make such request.

    The Bluetopia APIs looks to work great as a peripheral API but not as a central.
  • Hi,

    GATT server sends indication and notifications asynchronously to the GATT client, so you will get an event in the client callback when the server sends a any indication or notifications, which has to be handled by the client. Please see the Bluetooth specification for better understanding.

  • Hi, 

    I'm well aware on how that works. I've been working with LE on other platforms, iOS and Android to be specific, and both have a "listen" call that needs to be made before the GATT server sends notifications. That is what I find that is missing or not clearly explained in the API. I understand that the clients handles the notification. I see that there are callback events after the GATT server sends the notifications, but the GATT server won't be sending them automatically. As previously stated, I've had to request to listen for notifications before having them come. 

  • Hi,

    I hope this is what you are looking for, see "EnableDisableNotificationsIndications()" function which calls "GATT_Write_Request()"
    GATT_Write_Request -> Write a value to a remote, connected, GATT server (and wait for a response).
  • Thanks. I believe you're not looking at the PM sample, but they do use something similar using PM APIs. It's not very clear compared to other platform APIs I've seen but I'm sure I can work with it and figure it out after your lead.

    Again, thanks.

  • Hi,

    Yes I was looking at the Bluetopia PM. I was under the assumption that you ware using WL18xx as you have posted it on WiLink forum? is my assumption wrong?

    and If you are using WL18xx + Bluetopia PM, You can use GATT_Write_Request() API, as in the demo samples.
  • Hi,

    You're absolutely right, but to keep down complexity and reduce code, I'd rather stick with BluetopiaPM apis since I already have the callbacks in place. Using GATT_Write_Request() would cause me to write an additional callback if I'm not mistaken.

  • I've been able to implement this properly, my only concern now is that there doesn't seem to be a way to stop notifications. To enable there is GATT_CLIENT_CONFIGURATION_CHARACTERISTIC_NOTIFY_ENABLE , but I don't find one for disable. I tried sending a different value to the client configuration, but that didn't work also.
  • Hi,

    have you tried Zero?
  • That was the first thing I tried. I didn't debug through thoroughly since there were other parts I had to work on. I'll will look into it further.