BLE advertisment ADVTypes issues



  • Hello,

    Pycom BLE advertisment add in payload some dataType that are duplicated.

    For instance software is simple I added only service data :

    data = bytearray([0x19,0x14,counter])
    data.extend(tempInt.to_bytes(4,"little"))
    data.extend(refInt.to_bytes(4,"little"))
    
    bt.set_advertisement(name="TeraseyaR", manufacturer_data=None,service_data=data, service_uuid=ubinascii.unhexlify('00000000000000000000000000000000'))
    

    The received BLEAdv payload is

    b'\x02\x01\x06\n\tTeraseyaR\x02\n\xeb\x05\x12 \x00@\x00\x02\x01\x06\x05\x12 \x00@\x00\x0c\x16\x19\x14\x12\xe1\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
    

    decoded has:

    Type=09    TeraseyaR
    Type=0A    EB 
    Type=12    20 00 40 00 
    Type=01    06 
    Type=12    20 00 40 00 
    Type=16    19 14 12 E1 00 00 00 01 01 00 00
    

    As you can see AdvType 0x12 is twice.
    According to https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile/ , ADVType 0x12 relies to «Slave Connection Interval Range»

    And there is a way to remove non necessary ADVType like 0x12 0x1 0xA ?

    For Instace I get for a beacon the following clean advertisment:
    b'\x02\x01\x04\n\tADVT00001\x0c\x16\x19\x14\x8e\xfc\x00\x00\x00\x0b\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
    Type=09 ADVT00001
    Type=16 19 14 8E FC 00 00 00 0B 01 00 00


Log in to reply
 

Pycom on Twitter