-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include "Message.h" | ||
|
||
#include "HSBColor.h" | ||
|
||
namespace RGBStrip { | ||
|
||
class ColorListMessage : public Message { | ||
public: | ||
static const uint8_t Type = 0x03; | ||
|
||
struct Key{ | ||
HSBColor color __attribute__((packed)); | ||
uint16_t index __attribute__((packed)); | ||
}; | ||
|
||
static uint16_t size(uint16_t count) { | ||
return sizeof(ColorListMessage) + sizeof(Key) * count; | ||
} | ||
|
||
public: | ||
uint16_t offset; | ||
uint16_t count; | ||
|
||
Key keys[0]; | ||
|
||
void fillHeader(uint16_t count) { | ||
header.identifier = Identifier; | ||
header.type = Type; | ||
header.length = size(count); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters