vrmodel

view include/proto.h @ 4:a32b151fb3c6

moving along slowly
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 11 Sep 2014 00:08:23 +0300
parents be91b72ce3f9
children
line source
1 #ifndef PROTO_H_
2 #define PROTO_H_
4 #define DEF_PORT 0x6d0f
6 #define MAGIC 0x6d0f
7 /* requests */
8 #define REQ_DISCOVER 1
9 #define REQ_START 2
10 #define REQ_STOP 3
11 /* responses */
12 #define RSP_OK 0
13 #define RSP_ERR 255
14 /* events */
15 #define EV_STATE MAGIC
16 #define EV_MOTION 16
17 #define EV_BUTTON 17
19 struct msg_ev_data {
20 float x, y, z;
21 unsigned int bnmask;
22 };
24 struct message {
25 int magic;
26 int type;
28 union {
29 char raw[24];
30 struct msg_ev_data event;
31 } data;
32 };
35 #endif /* PROTO_H_ */