A simple multiclient network protocol for your blinkenlights.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sebastian 2035657f8a Channels not used by any priority level should be zero 6 years ago
include Remove portability wrappers for memset and memcopy 6 years ago
.gitignore Initial commit 6 years ago
README.md Added some minimal docs 6 years ago
twinkl.c Channels not used by any priority level should be zero 6 years ago

README.md

twinkl

A simple multiclient network protocol for your blinkenlights.

Pseudocode Client

#include "twinkl.h"

char twinkl_server[] = "127.0.0.1:1337";

struct twinkl_message msg;

// Initialization (required if msg is on the heap, optional here)
twinkl_init_message(&msg);

twinkl_set_priority(&msg, 0);

twinkl_set_value(&msg, 23, 42);
twinkl_set_value(&msg, 46, 5);
// ... more stuff

// Just send it to your twinkl server somehow
udp_send_stuff(twinkl_server, &msg, sizeof(twinkl_msg));

Pseudocode Server

#include "twinkl.h"

twinkl_init();

struct twinkl_message msg;

unit8_t buffer[TWINKL_CHANNEL_COUNT];

while(1) {
	while(!twinkl_has_changes()) {
		if(upd_receive_stuff(&msg, sizeof(twinkl_msg))) {
			twinkl_process_message(&msg);
		}
	}

	twinkl_render(buffer);

	update_your_lights(buffer);
}