UUID | Character | Length | Permission | Description |
---|---|---|---|---|
0xFFF1 | Control | 18 | Read/Write | Control the color/light/on/off of LED |
0xFFF2 | Delay On/Off | 8 | Read/Write | Set delay on/off for LED |
0xFFF3 | Delay On/Off Status | 2 | Read/Write | Query the status of delay on/off Query |
0xFFF4 | Delay On/Off Status | 10 | Notify | Notify the status of delay on/off Response |
0xFFF5 | Status Query | 1 | Read/Write | Query the status of LED |
0xFFF6 | Status Response | 20 | Notify | Notify the status of LED |
0xFFF7 | ColorFlow | 20 | Read/Write | Set the color flow for LED |
0xFFF8 | LED Name | 15 | Read/Write | Set the name of LED |
0xFFF9 | LED Name Response | 15 | Notify | Notify the name of LED |
0xFFFC | Effect Setting | 2 | Read/Write | Set the effect of color change |
Above is the table explaining the different bytes one needs to send and the length of the packets.
For example to turn the light on, one would send ,,,100,,,,,,,,,,,,
which is 18
chars long.
To turn it green, 0,255,0,100,,,,,,,
is also 18
.
I think you're right a map or array of strucs sounds best, as I want a datastructure, that means I can do something like
foo.WriteCharacteristic(YeelightService, ControlCharacteristic, buf)
Where:
YeelightService
is the main uuid needed for the Yeelight BLE (0xFFF0
).ControlCharacteristic
is0xFFF1
indacting where changing a control characteristic aka colour change for intance.buf
is the payload e.g.0,255,0,100,,,,,,,
I would want my packet creation method, to look at the datastructure above and know that a ControlCharacteristic
needs to be
of length 18
.
@katzien what do you think?