neonsoftware / kian

A transport agnostic single header C library for OSC over SLIP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Build Status

Kian

A transport agnostic single header C library for OSC over SLIP(RFC 1055)

While most OSC libraries available thend to embed and assume the use of network transport (UDP), few of them can easily be used with other means of transport, such as USB.

Kian aims to provide a bring-your-own-transport approach to OSC messaging.

The SLIP protocol (RFC 1055) is a very simple encoding system that allows to encapsulate the OSC messages and bundles into entities of information simlare to UDP datagrams, which can then be send to the transport stack and received on the other end.

Kian is :
  • completely transport agnostic, works on local buffers (no logic for network, or serial, etc .. it is up to you)

  • written in portable C89

  • only 3 header files

  • througly internally documented

  • tested

Usage

This is an extract from the integrated test suite. (WIP)

	tosc_message *new_msg = NULL;

	EXPECT(kian_next_message() == NULL);

	EXPECT(kian_write_message("/ceo", "s", "ciao") != 0);
	EXPECT(kian_write_message("/pdg", "s", "bonjour") != 0);

	EXPECT(io_echo() == 0);

	new_msg = kian_next_message();
	EXPECT(new_msg != NULL);
	EXPECT(strcmp("/ceo", tosc_getAddress(new_msg)) == 0);
	EXPECT(strcmp("ciao", tosc_getNextString(new_msg)) == 0);

	new_msg = kian_next_message();
	EXPECT(new_msg != NULL);
	EXPECT(strcmp("/pdg", tosc_getAddress(new_msg)) == 0);
	EXPECT(strcmp("bonjour", tosc_getNextString(new_msg)) == 0);

	EXPECT(kian_next_message() == NULL);
	EXPECT(kian_next_message() == NULL);
	EXPECT(kian_next_message() == NULL);

About

A transport agnostic single header C library for OSC over SLIP

License:GNU General Public License v3.0


Languages

Language:C 99.6%Language:Makefile 0.4%