micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

AIOBLE - ScanResult only returns first service when multiple are present in advertisement

Open rale opened this issue 4 years ago • 2 comments

When a device advertises multiple service UUIDs, it seems only the first one gets decoded.

I'm doing something like:

async with aioble.scan(5000, interval_us=30000, window_us=30000, active=True) as scanner:
    async for result in scanner:
        for service in result.services():
            print(service)

With an advertising packet like this: 020106050318182618 I think result.services() should yield both 0x1818 and 0x1826, but it only seems to decode the first one.

rale avatar Dec 31 '21 00:12 rale

With an advertising packet like this: 020106050318182618 I think result.services() should yield both 0x1818 and 0x1826, but it only seems to decode the first one.

Thanks, this is a bug, we do not current handle the decoding case where multiple service UUIDs are encoded into the same field (as an optimisation we should also handle this on the encode side too).

jimmo avatar Aug 05 '22 00:08 jimmo

I don't get service data work wither, for example sending temperature values to central. Manufacturer information seems to work though.

aetelani avatar May 11 '24 13:05 aetelani