|
libtinylor
Single-file header library for controlling Light-O-Rama hardware
|

Functions | |
| static void | test_channel_format_header (const unsigned short cbits, const lor_channel_format expected) |
| Tests the channel format header byte selection. | |
| static void | test_channel_alignment (const lor_channel first, const unsigned short cbits, const lor_channel_set expected) |
| Tests the channel alignment calculation. | |
| static void | assert_frame (const unsigned char *b, const size_t written, const unsigned char *expected, const size_t expected_size) |
| Asserts an encoded frame matches the expected bytes exactly, and that the 0x00 frame delimiter does not appear between the two delimiters. | |
| static void | test_single_channel_byte (const lor_channel c, const unsigned char expected) |
| Tests the single channel byte encoding (0x80 | channel index). | |
| static void | test_channel_set_frame (const unsigned short cbits, const unsigned char *expected, const size_t expected_size) |
| Tests the encoded frame of a channel set request, from the leading 0x00 delimiter through the trailing one. | |
| static void | test_intensity_frame (const unsigned short cbits, const lor_intensity intensity, const unsigned char *expected, const size_t expected_size) |
| Tests that effect parameters are encoded before the channel bytes. | |
| static void | test_unit_set_add (const lor_unit unit) |
| Tests the unit set bit storage for a single unit. | |
| static void | test_unit_list_frame (const lor_unit *units, const size_t us, const unsigned char *expected, const size_t expected_size) |
| Tests the encoded frame of a request addressed to a set of units, from the leading 0x00 delimiter through the trailing one. | |
| int | main (void) |
|
static |
Asserts an encoded frame matches the expected bytes exactly, and that the 0x00 frame delimiter does not appear between the two delimiters.
| b | The buffer holding the encoded frame. |
| written | The number of bytes written to b. |
| expected | The expected frame bytes, including both delimiters. |
| expected_size | The number of bytes in expected. |

| int main | ( | void | ) |

|
static |
Tests the channel alignment calculation.
| first | The first channel to encode. |
| cbits | 16-bit bitset of channels relative to first to encode. |
| expected | The expected channel alignment result. |


|
static |
Tests the channel format header byte selection.
| cbits | 16-bit bitset of channels to encode. |
| expected | The expected channel format header byte. |


|
static |
Tests the encoded frame of a channel set request, from the leading 0x00 delimiter through the trailing one.
| cbits | 16-bit bitset of channels to encode. |
| expected | The expected frame bytes. |
| expected_size | The number of bytes in expected. |


|
static |
Tests that effect parameters are encoded before the channel bytes.
| cbits | 16-bit bitset of channels to encode. |
| intensity | The intensity parameter to encode. |
| expected | The expected frame bytes. |
| expected_size | The number of bytes in expected. |


|
static |
Tests the single channel byte encoding (0x80 | channel index).
| c | The 0-based channel index to encode. |
| expected | The expected channel byte. |


|
static |
Tests the encoded frame of a request addressed to a set of units, from the leading 0x00 delimiter through the trailing one.
| units | The units to include in the set. |
| us | The number of units in units. |
| expected | The expected frame bytes. |
| expected_size | The number of bytes in expected. |


|
static |
Tests the unit set bit storage for a single unit.
| unit | The unit to add to an otherwise empty set. |

