Get handle values from MILI service charcteristics

Issue #5 new
Marco Trevisan
created an issue

You're currently hardcoding the handle values, but as you state in comments these might change with firmware upgrades.

So, why not discovering them using the Mili service characteristics and filtering them by uuid? This is easily doable in a gattool session, so I guess it can be implemented even in pygattlib:

[   ][88:0F:10:xx:xx:xx][LE]> connect
[CON][88:0F:10:xx:xx:xx][LE]> primary
[CON][88:0F:10:xx:xx:xx][LE]> 
attr handle: 0x0001, end grp handle: 0x0009 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x000f uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x0010, end grp handle: 0x0033 uuid: 0000fee0-0000-1000-8000-00805f9b34fb
attr handle: 0x0034, end grp handle: 0x0042 uuid: 0000fee1-0000-1000-8000-00805f9b34fb
attr handle: 0x0043, end grp handle: 0x004a uuid: 0000fee7-0000-1000-8000-00805f9b34fb
attr handle: 0x004b, end grp handle: 0x004d uuid: 00001802-0000-1000-8000-00805f9b34fb

# UUID_SERVICE_MILI_SERVICE
[CON][88:0F:10:xx:xx:xx][LE]> primary 0000fee0-0000-1000-8000-00805f9b34fb
Starting handle: 0x0010 Ending handle: 0x0033
[CON][88:0F:10:xx:xx:xx][LE]> characteristics 0x10 0x33

# UUID_CHARACTERISTIC_DEVICE_INFO
handle: 0x0011, char properties: 0x02, char value handle: 0x0012, uuid: 0000ff01-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_DEVICE_NAME
handle: 0x0013, char properties: 0x0a, char value handle: 0x0014, uuid: 0000ff02-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_NOTIFICATION
handle: 0x0015, char properties: 0x12, char value handle: 0x0016, uuid: 0000ff03-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_USER_INFO
handle: 0x0018, char properties: 0x0a, char value handle: 0x0019, uuid: 0000ff04-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_CONTROL_POINT
handle: 0x001a, char properties: 0x08, char value handle: 0x001b, uuid: 0000ff05-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_REALTIME_STEPS
handle: 0x001c, char properties: 0x12, char value handle: 0x001d, uuid: 0000ff06-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_ACTIVITY_DATA
handle: 0x001f, char properties: 0x12, char value handle: 0x0020, uuid: 0000ff07-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_FIRMWARE_DATA
handle: 0x0022, char properties: 0x04, char value handle: 0x0023, uuid: 0000ff08-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_LE_PARAMS
handle: 0x0024, char properties: 0x0a, char value handle: 0x0025, uuid: 0000ff09-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_DATE_TIME
handle: 0x0026, char properties: 0x0a, char value handle: 0x0027, uuid: 0000ff0a-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_STATISTICS
handle: 0x0028, char properties: 0x0a, char value handle: 0x0029, uuid: 0000ff0b-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_BATTERY
handle: 0x002a, char properties: 0x12, char value handle: 0x002b, uuid: 0000ff0c-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_TEST
handle: 0x002d, char properties: 0x0a, char value handle: 0x002e, uuid: 0000ff0d-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_SENSOR_DATA
handle: 0x002f, char properties: 0x1a, char value handle: 0x0030, uuid: 0000ff0e-0000-1000-8000-00805f9b34fb

# UUID_CHARACTERISTIC_PAIR
handle: 0x0032, char properties: 0x0a, char value handle: 0x0033, uuid: 0000ff0f-0000-1000-8000-00805f9b34fb

Comments (2)

  1. Oscar Acena repo owner

    Yes, this is how the official application works. I need to add support for this in pygattlib, then update mibanda to add a "discover services" stage. Thanks for reporting :)

  2. Log in to comment