xLAB - acutators / led-mrf-osc-legacy-code

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers OSCmsg.h Source File

OSCmsg.h

00001 /*
00002  
00003     Transport Type: 
00004       CAN
00005  
00006     Features: 
00007      Packet Parsing (Slave)
00008      Packet Construction (Master)
00009      Bundle NOT Support
00010  
00011     Type Support: 
00012      i: int32
00013      b: blob
00014      s: string
00015      f: float32
00016      m: MIDI message(port id, status byte, data1, data2) // I don't know the detail
00017  
00018 */   
00019     
00020 class OSCmsg{
00021 
00022     char address[6];
00023     char type;
00024     char msg;
00025     int length;
00026     public:
00027          OSCmsg();
00028         
00029         //Setter and getter for the address field. Limiting it to just one character for now.
00030         
00031         int setAddr(char* addr);
00032         char* getAddr();
00033         
00034         //Setter and Getter for the type field.
00035         
00036         int setType(char mtype);
00037         char getType();
00038         
00039         //Setter and Getter for the actual message. Limiting it to just 2 bytesfor now.
00040         
00041         int setArgs(char msgs);
00042         char getArgs();
00043         
00044         //Get the legth of the message
00045         int getLen();
00046         
00047         friend class OSCclass;
00048         
00049         
00050 };
00051 
00052 /***************class to send and receive the OSC message ***********/
00053 
00054 class OSCclass{
00055 
00056     char   rcvBuff[8]; 
00057     char packet[9];
00058     int   buflength;
00059     char msgs;
00060     char ttype;
00061     char addr[5];
00062     OSCmsg *temp;
00063     CANMessage msg;
00064     
00065     OSCmsg *receive_msg;
00066     OSCmsg *send_msg;
00067      
00068     public:
00069         OSCclass();
00070         void sendOSCmsg(OSCmsg *msg);
00071         OSCmsg* getOSCmsg(char *recv);
00072         
00073 };
00074        
00075         
00076         
00077         
00078         
00079         
00080         
00081         
00082         
00083         
00084         
00085         
00086         
00087         
00088