vrmodel
annotate 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 |
rev | line source |
---|---|
nuclear@2 | 1 #ifndef PROTO_H_ |
nuclear@2 | 2 #define PROTO_H_ |
nuclear@2 | 3 |
nuclear@2 | 4 #define DEF_PORT 0x6d0f |
nuclear@2 | 5 |
nuclear@2 | 6 #define MAGIC 0x6d0f |
nuclear@2 | 7 /* requests */ |
nuclear@2 | 8 #define REQ_DISCOVER 1 |
nuclear@2 | 9 #define REQ_START 2 |
nuclear@2 | 10 #define REQ_STOP 3 |
nuclear@2 | 11 /* responses */ |
nuclear@2 | 12 #define RSP_OK 0 |
nuclear@2 | 13 #define RSP_ERR 255 |
nuclear@4 | 14 /* events */ |
nuclear@4 | 15 #define EV_STATE MAGIC |
nuclear@4 | 16 #define EV_MOTION 16 |
nuclear@4 | 17 #define EV_BUTTON 17 |
nuclear@2 | 18 |
nuclear@4 | 19 struct msg_ev_data { |
nuclear@4 | 20 float x, y, z; |
nuclear@4 | 21 unsigned int bnmask; |
nuclear@4 | 22 }; |
nuclear@2 | 23 |
nuclear@2 | 24 struct message { |
nuclear@2 | 25 int magic; |
nuclear@2 | 26 int type; |
nuclear@4 | 27 |
nuclear@4 | 28 union { |
nuclear@4 | 29 char raw[24]; |
nuclear@4 | 30 struct msg_ev_data event; |
nuclear@4 | 31 } data; |
nuclear@2 | 32 }; |
nuclear@2 | 33 |
nuclear@2 | 34 |
nuclear@2 | 35 #endif /* PROTO_H_ */ |