OSC meeseage tranceiver(Sender/Receiver) for Sparkfun CC3000 WiFi Shield. Supports the following boards: FRDM-KL25Z,ST Nucleo F401RE,ST Nucleo F030R8,LPCXpresso1549,Seeduino-Arch-Pro.
Dependencies: cc3000_hostdriver_mbedsocket mbed
OSCmsgCodec.h@1:e62251d890c1, 2014-09-03 (annotated)
- Committer:
- xshige
- Date:
- Wed Sep 03 13:12:02 2014 +0000
- Revision:
- 1:e62251d890c1
- Parent:
- 0:eadd1c588343
added supporting FRDM-K64F.;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
xshige | 0:eadd1c588343 | 1 | // OSC message Codec Header |
xshige | 0:eadd1c588343 | 2 | // 2013/10/28 |
xshige | 0:eadd1c588343 | 3 | #ifndef _OSCMSGCODEC_H |
xshige | 0:eadd1c588343 | 4 | #define _OSCMSGCODEC_H |
xshige | 0:eadd1c588343 | 5 | |
xshige | 0:eadd1c588343 | 6 | #include <string.h> |
xshige | 0:eadd1c588343 | 7 | |
xshige | 0:eadd1c588343 | 8 | int encOSCmsg(char *packet , union OSCarg *msg); |
xshige | 0:eadd1c588343 | 9 | // makes packet from OSC message and returns packet size |
xshige | 0:eadd1c588343 | 10 | |
xshige | 0:eadd1c588343 | 11 | void decOSCmsg(char *packet , union OSCarg *msg); |
xshige | 0:eadd1c588343 | 12 | // makes OSC message from packet |
xshige | 0:eadd1c588343 | 13 | |
xshige | 0:eadd1c588343 | 14 | union OSCarg { |
xshige | 0:eadd1c588343 | 15 | // char*, int and float are assumed four bytes |
xshige | 0:eadd1c588343 | 16 | char *address; |
xshige | 0:eadd1c588343 | 17 | char *typeTag; |
xshige | 0:eadd1c588343 | 18 | long int i; // int32 for Arduino(16bits) |
xshige | 0:eadd1c588343 | 19 | float f; |
xshige | 0:eadd1c588343 | 20 | char *s; |
xshige | 0:eadd1c588343 | 21 | struct { |
xshige | 0:eadd1c588343 | 22 | long int len; // is "int i" |
xshige | 0:eadd1c588343 | 23 | char *p; |
xshige | 0:eadd1c588343 | 24 | } |
xshige | 0:eadd1c588343 | 25 | blob; |
xshige | 0:eadd1c588343 | 26 | char m[4]; // for MIDI |
xshige | 0:eadd1c588343 | 27 | char _b[4]; // endian conversion temp variable |
xshige | 0:eadd1c588343 | 28 | }; |
xshige | 0:eadd1c588343 | 29 | |
xshige | 0:eadd1c588343 | 30 | #endif // _OSCMSGCODEC_H |