summaryrefslogtreecommitdiff
path: root/Libraries/OSC/OSCDecoder.cpp
blob: 4a75179108d95a5a9899dde85ce2b3b4e43cf42c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*

 ArdOSC - OSC Library for Arduino.

 -------- Lisence -----------------------------------------------------------

 ArdOSC

 The MIT License

 Copyright (c) 2009 - 2010 recotana( http://recotana.com ) All right reserved

 */

#include <stdlib.h>
#include <string.h>

#include "OSCcommon.h"
#include "OSCDecoder.h"



int16_t OSCDecoder::decode( OSCMessage::OSCMessage *mes ,const uint8_t *recData ){


//===========  BIN -> OSC Address(String) Decode   ===========

	const uint8_t *packStartPtr=recData;

	mes->setOSCAddress((char*)packStartPtr);

	packStartPtr += mes->oscAdrPacSize;



//===========  BIN -> TypeTag (String) Decode   ===========

	mes->setTypeTags((char*)(packStartPtr+1));

	packStartPtr += mes->typeTagPacSize;


//===========  BIN -> Auguments Decode   ===========

	mes->argStart = packStartPtr;
	mes->argsPacSize=mes->argsNum * 4;

	return 0;
}