Refactor LED packet constructor

This commit is contained in:
2023-02-02 01:14:29 -06:00
parent c1bb243211
commit 9ccc5cbca0
2 changed files with 51 additions and 17 deletions
+15 -2
View File
@@ -61,6 +61,19 @@ set_sdk_connection_req_new (
const Message
set_system_led_req_new (
Client session,
struct SetSystemLedReq* msg ) {
return message_new(session, 0x3F, SET_SYSTEM_LED_CMDID, sizeof(struct SetSystemLedReq), msg);
uint8_t red,
uint8_t green,
uint8_t blue,
enum LEDCOMP comp,
uint16_t led_mask,
enum LEDEFFECT effect,
uint16_t t1,
uint16_t t2 ) {
const struct SetSystemLedReq msg = {
comp, led_mask,
{ effect, 7 },
red, green, blue,
0, t1, t2
};
return message_new(session, 0x3F, SET_SYSTEM_LED_CMDID, sizeof(msg), &msg);
}