Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

hairmare/PoscHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PoscHP - OSC for PHP

INTRO

Right now all i have here is a proof of concept binary stream parser
based on a simple state machine. This was written mainly to show that
such a thing is feasible without needing to hack much C. For a fully
working OSC implementation for PHP this still needs heaps of work.

FEATURES

PoscHP supports parsing of OSC messages and OSC bundles. 

Its supports the following variable types.

- integers (i/h)
- strings (s/S) and char (c)
- boolean (T/F)
- special numbers (I/N)
- arrays ([/])
- timestamps (t) implemented but rather untested

An example implementation of the parser is given in the Osc_LogDaemon
component which uses pears System_Daemon and Log subsystems to demonstrate
what can be done with PoscHP.

QUICKSTART

clone the github repo

 git clone git://github.com/hairmare/PoscHP.git
 cd PoscHP

start server/receiver in one shell

 php osctest.php

send some packages in another shell

 php oscsend.php

DEVELOPERS

You will need phpcs on your system. Most distros should have a package for
it and it is available as a PEAR package.

Please use the build hooks in the build dir as follows

 ln -s ../../build/pre-commit .git/hooks/

TODO (in no particular order)

- stable logging and exception handling
- fix OSC Float support (maybe andy schmeders code contains the hint)
- add tons of documentation
- find a way to read the dest ip and port
  socket_recvfrom uses recvfrom and that does not have dest
  rcvmsg has a way of getting to the data (man 7 ip -> IP_PKTINFO)
- support blobs
- support timestamped bundles (execute in future and/or ignore stale)
- message dispatching and pattern matching as per osc specs
- this means real multicasting of incoming data
- and some kind of session managment (session_id via context?)
- test/hack this so it might also run on LE machines (anyone?)

About

OSC for PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published