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

ANCS message length

Hi,

I've got ANCS working well in my application, but I seem unable to increase the length of the notification's message that I receive.

BLE_ANCS_ATTR_DATA_MAX is defined in nrf_ble_ancs_c.h as 32 - but it feels like it's not expected that we change this. Even increasing MTU and this value to 53 I only see 35 bytes of message (the last bytes being unicode for ... - "\xE2\x80\xA6" - so the phone seems to be restricting length).

I've seen another request here that suggests increasing the MTU - but a message could easily be longer than the max Bluetooth MTU allows for.

As far as I can see from Apple's docs at https://developer.apple.com/library/archive/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Specification/Specification.html#//apple_ref/doc/uid/TP40013460-CH1-SW18 changing the MTU shouldn't be needed - the iOS device will split the message into multiple fragments, and it seems there is code in the Nordic libraries to split the response up correctly, even allowing for very large attribute sizes.

So is this to be expected? From a quick search it seems people are able to get much longer notifications, but then it seems odd the library has BLE_ANCS_ATTR_DATA_MAX and checks against it in the library when there seems to be no technical limitation.

Parents
  • Sorry - totally my fault.

    Literally all you need is to increase BLE_ANCS_ATTR_DATA_MAX. I was just increasing it on the *wrong* nRF SDK version (the app has to target different SDKs for different devices).

    It still needs the code change in the Nordic SDK to work (which feels like a bit of a shame). But otherwise is fine.

    I'd just suggest removing the check " || (len > BLE_ANCS_ATTR_DATA_MAX)" in nrf_ble_ancs_c_attr_add - then you can leave BLE_ANCS_ATTR_DATA_MAX (and the associated app_id buffer) the same size and everything seems to work great

Reply
  • Sorry - totally my fault.

    Literally all you need is to increase BLE_ANCS_ATTR_DATA_MAX. I was just increasing it on the *wrong* nRF SDK version (the app has to target different SDKs for different devices).

    It still needs the code change in the Nordic SDK to work (which feels like a bit of a shame). But otherwise is fine.

    I'd just suggest removing the check " || (len > BLE_ANCS_ATTR_DATA_MAX)" in nrf_ble_ancs_c_attr_add - then you can leave BLE_ANCS_ATTR_DATA_MAX (and the associated app_id buffer) the same size and everything seems to work great

Children
No Data
Related