diff options
| author | bzztbomb <skinny@knowhere.net> | 2010-04-15 12:13:53 -0700 |
|---|---|---|
| committer | bzztbomb <skinny@knowhere.net> | 2010-04-15 12:13:53 -0700 |
| commit | cc23a46941106a6515b3fe958daba0f3a1551883 (patch) | |
| tree | 280dad14cdb4c8c806e212c8c143f25e652338ba /Libraries/OSC/OSCMessage.h | |
Initial commit of working OSC parsing over Wifi
Diffstat (limited to 'Libraries/OSC/OSCMessage.h')
| -rw-r--r-- | Libraries/OSC/OSCMessage.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/Libraries/OSC/OSCMessage.h b/Libraries/OSC/OSCMessage.h new file mode 100644 index 0000000..2660b91 --- /dev/null +++ b/Libraries/OSC/OSCMessage.h @@ -0,0 +1,104 @@ +/* + + ArdOSC - OSC Library for Arduino. + + -------- Lisence ----------------------------------------------------------- + + ArdOSC + + The MIT License + + Copyright (c) 2009 - 2010 recotana( http://recotana.com ) All right reserved + + */ + + + + +#ifndef OSCMessage_h +#define OSCMessage_h + + +#include "OSCcommon.h" + + +class OSCMessage{ + +private: + + uint16_t allPackSize; // + char *oscAddress; // "/ard" + uint16_t oscAdrSize; // "/ard" ->4 + uint16_t oscAdrPacSize; // "/ard\0\0\0\0" ->8 + + char *typeTag; // "iif" + uint16_t typeTagSize; // ",iif" -> 4 + uint16_t typeTagPacSize; // ",iif\0\0\0\0" -> 8 + + + void **arguments; + uint16_t argsNum; // "iif" -> 3 + uint16_t argsPacSize; // "iif" -> 4 + 4 + 4 = 12 + + uint8_t ipAddress[4]; //{192,168,0,10} + uint16_t portNumber; //10000 + +public: + + + + OSCMessage(); + OSCMessage(const char *_oscAddress); + ~OSCMessage(); + + void flush(); + + + uint16_t getAllPackSize(); + uint16_t getStrPackSize(const char* data); + uint16_t getPackSize(uint16_t size); + + + + void setAddress(uint8_t *_ip , uint16_t _port); + + void setIpAddress( uint8_t *_ip ); + void setIpAddress( uint8_t _ip1, uint8_t _ip2, uint8_t _ip3, uint8_t _ip4); + + uint8_t *getIpAddress(); + void setPortNumber(uint16_t _port); + uint16_t getPortNumber(); + + int16_t setOSCMessage( const char *_address ,char *types , ... ); + int16_t getArgsNum(); + + int16_t setOSCAddress(const char *_address); + char *getOSCAddress(); + + int16_t setTypeTags(const char *_tags); + char *getTypeTags(); + char getTypeTag(uint16_t _index); + + + + int32_t getInteger32(uint16_t _index); + +#ifdef _USE_FLOAT_ + float getFloat(uint16_t _index); +#endif + +#ifdef _USE_STRING_ + char *getString(uint16_t _index); +#endif + + + + friend class OSCServer; + friend class OSCClient; + friend class OSCDecoder; + friend class OSCEncoder; + +}; + + +#endif |
