• Well, I can't find the info - googling GATT_Specification_Supplement_v8-1 doesn't return anything, so I can't really confirm if it's right or not, but as far as I can see what you're doing looks good.

    However the use of Uint16Array in build_battery_status does look a bit suspect, as that's going to create 6 bytes of data (when I assume that wasn't what was needed).

    You might need:

    new Uint8Array([battery_status_flags, power_state_flags>>8, power_state_flags&255, battery_level]).buffer
    

    Which would give you 4 bytes (with power_state_flags as little endian 16 bit) - but again I'm not sure what's required so I'm just guessing.

  • Oops sorry my bad, it's this GATT_Specification_Supplement_v8 the -1 was appended by windows I guess it's stopped using (1) to indicate duplicate files. I've added screenshots from the specification directly. Do you know why the specification is so difficult to implement, seems like it's raising the barrier of entry for no reason. Specially since they provide basically no information on how to actually implement it. Do you think you have any reference implementations or blogs that can help.


    3 Attachments

    • Screenshot 2023-03-15 183736.png
    • Screenshot 2023-03-15 183758.png
    • Screenshot 2023-03-15 183824.png