2

I'm developing a frame exchange sequence between an nRF52840 and an Android smartphone using the BLE protocol.

The service exposed by nRF52840 has the following 16-bit UUID : EB7A

In my Android application, if I only want to retrieve BLE devices that have this service, I need to initialize the filter like this :

    private var scanFilters: List<ScanFilter> = arrayListOf(
        ScanFilter.Builder().setServiceUuid(ParcelUuid(UUID.fromString("0000eb7a-0000-1000-8000-00805f9b34fb"))
)

However, if I want to write about a feature of this service, I have to use the following UUID:

0000eb7a-0000-0000-0000-000000000000

I don't understand why I can't use the same UUID for filtering as for read/write operations, can you help me?

Martin Denion
  • 352
  • 1
  • 3
  • 22

1 Answers1

0

I don't know whether you have figured it out. If yes, would be interesting to know what you have discovered. I am quite new to android and nRF dev myself, but I have 2 theories for your question:

  1. If you are using a vendor-specific UUID for the filter, I guess you are not able to modify it, which is why you have to use a different UUID.
  2. Have you tried deriving the UUID as a String for example and then using it in a filter (not sure if this would work thou)
    public static String SOME_SERVICE = "0000eb7a-0000-1000-8000-00805f9b34fb"
    
    ScanFilter = newScanFilter.Builder().setServiceUuid(UUID.fromString(SOME_SERVICE);
    
    
AimekSS
  • 11
  • 1