Skip to content

Instantly share code, notes, and snippets.

View rodb70's full-sized avatar

Rod Boyce rodb70

View GitHub Profile
@rodb70
rodb70 / client.c
Created May 15, 2018 16:56 — forked from inaz2/client.c
IPv6 server & client in C
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
void ping(int s, char *message)
{
char buf[8192];
@rodb70
rodb70 / avl.c
Created May 15, 2018 16:12 — forked from tonious/avl.c
A quick AVL tree implementation in c.
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
#include <assert.h>
struct avl_node_s {
@rodb70
rodb70 / tpm2.md
Last active August 29, 2015 14:20 — forked from jblang/tpm2.md

TPM2 Protocol Implementation

Introduction

Frame data is transferred inside packets (similar to DMX, for example). A frame is an image representing a matrix or a light scene.

The packets start and end with one-byte characters. In between are a few control bytes followed by the payload. There is no set size for a payload; it is transmitted with each packet. This makes the protocol quite flexible. There are enough bytes in a single packet for an RGB matrix with 21,845 pixels, but if you just want to control an RGBW lamp, that only requires 9 bytes. The variable frame size means there is no overhead, allowing for maximum transfer speed.

TPM2 Packet Structure