This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Alert notification service setup at runtime

Hi,

We have two services, apple ANCS and Alert Notification on iOS. We try to connect it with 51822. There is an exception case the the alert notification function not working. The followings is the steps to reproduce:

  1. Close our app.
  2. Pair the device to iOS
  3. Call Alert Notification from device ANCS working and alert nortification not working, it's correct because our app hasn't opened
  4. Open our app.
  5. Call Alert Notification for device ANCS working and alert nortification not working

My question is that are there any ways we could do establish the alert notification at runtime them when we found that it hasn't been setup? Thanks.

Paul

Parents
  • Hi Ole,

    I'm not quite sure I understand what you try to ask. You can add a service to the GATT Table at any time, but remember that to comply with the Bluetooth specification, you must send a Service Changed Indication to all bonded devices after having done changes to your GATT Table.

    Do you mean that in our iOS app, we need to send service changed indication to all paired devices after we set up the alert notification service? The problem is that when the device connect to the iPhone, our alert notification service hasn't been setup. At this point, the device cannot discover that service.

    You can also dynamically decide to look for a new service, as a GATT Client, if you for example want to first see if there is an ANCS service there, and only if you don't find that check if there is a regular Alert Notification Service. This is something you'd have to implement in your application.

    Do you mean that we setup a timer in the 51822 to discover the ios alert notification continuously (e.g. in every 5 minutes) until we find it?

    Thanks again for your help.

    Paul

  • If you enable indications for the Service Changed attribute in the iOS device's GATT Table, you should receive an indication whenever the GATT Table changes, and you could then use this to trigger a new service discovery.

    It would also possible to just retry the service discovery at certain intervals.

    A final option would be to have some kind of enable service on your device, so that the app would write to that service to trigger service discovery as soon as the app has started.

    Of these, I actually think that the last one is the easiest and most reasonable to implement, but this is really an application choice.

Reply
  • If you enable indications for the Service Changed attribute in the iOS device's GATT Table, you should receive an indication whenever the GATT Table changes, and you could then use this to trigger a new service discovery.

    It would also possible to just retry the service discovery at certain intervals.

    A final option would be to have some kind of enable service on your device, so that the app would write to that service to trigger service discovery as soon as the app has started.

    Of these, I actually think that the last one is the easiest and most reasonable to implement, but this is really an application choice.

Children
No Data
Related