Program the control the fischertechnik robo interface or intelligent interface via tcp socket or via a java gui.

Dependencies:   mbed ConfigFile

Committer:
networker
Date:
Fri Dec 31 14:01:14 2010 +0000
Revision:
0:7f26f0680202
initial release: comprises ftlib (no usb), ft-over-ip socket server, and the http server (the html page and java jar I still have to publish somewhere)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
networker 0:7f26f0680202 1 #ifndef DATA_H
networker 0:7f26f0680202 2 #define DATA_H
networker 0:7f26f0680202 3
networker 0:7f26f0680202 4
networker 0:7f26f0680202 5 #include <stdint.h>
networker 0:7f26f0680202 6 typedef uint8_t UINT8;
networker 0:7f26f0680202 7 typedef uint16_t UINT16;
networker 0:7f26f0680202 8 typedef uint8_t BOOL8;
networker 0:7f26f0680202 9 typedef int16_t INT16;
networker 0:7f26f0680202 10 typedef int32_t INT32;
networker 0:7f26f0680202 11 typedef uint16_t BOOL16;
networker 0:7f26f0680202 12 typedef uint8_t UCHAR8;
networker 0:7f26f0680202 13 typedef uint32_t UINT32;
networker 0:7f26f0680202 14 typedef uint32_t BOOL32;
networker 0:7f26f0680202 15
networker 0:7f26f0680202 16 #include "ROBO_TX_FW.h" //"../PC_programming_RoboTXC_V1-2_11_Dec_2009/PC_Programming_RoboTXC/Demo_Static_Lib_C/Inc/"
networker 0:7f26f0680202 17
networker 0:7f26f0680202 18 typedef struct
networker 0:7f26f0680202 19 { UINT16 start;
networker 0:7f26f0680202 20 union //the message format is HL, the native format is LH, receiver routine swaps HL to LH, send routine writes as HL
networker 0:7f26f0680202 21 { UINT16 bytes;
networker 0:7f26f0680202 22 struct
networker 0:7f26f0680202 23 { UINT8 bytesH, bytesL;
networker 0:7f26f0680202 24 }/*anonymous*/; //as_bytes;
networker 0:7f26f0680202 25 };//winavr allows anonymous structs and unions
networker 0:7f26f0680202 26 UINT32 snd, rec;
networker 0:7f26f0680202 27 UINT16 trans, session;
networker 0:7f26f0680202 28 UINT32 cmd, structs, ta_id;//ta_id is normally not considered part of the header but part of the payload, it is repeated for each struct
networker 0:7f26f0680202 29 } header;
networker 0:7f26f0680202 30
networker 0:7f26f0680202 31
networker 0:7f26f0680202 32 typedef struct
networker 0:7f26f0680202 33 { UINT16 chksum;
networker 0:7f26f0680202 34 UCHAR8 etx;
networker 0:7f26f0680202 35 } trailer;
networker 0:7f26f0680202 36
networker 0:7f26f0680202 37 typedef struct
networker 0:7f26f0680202 38 { header hdr;
networker 0:7f26f0680202 39 union
networker 0:7f26f0680202 40 { struct { TA_OUTPUT output; trailer trl;} cmd002;//set outputs
networker 0:7f26f0680202 41 struct { TA_CONFIG config; trailer trl;} cmd005;//initialize
networker 0:7f26f0680202 42 struct { trailer trl;} cmd006;//extension request
networker 0:7f26f0680202 43 struct { DISPLAY_MSG disp; trailer trl;} cmd008;//display message
networker 0:7f26f0680202 44 struct { char name[20]; trailer trl;} cmd009;//change name, 20 = DEV_NAME_LEN+1+3padding
networker 0:7f26f0680202 45 struct { TA_INPUT input; trailer trl;} cmd102;//reply to cmd002
networker 0:7f26f0680202 46 struct { trailer trl;} cmd105;//reply to cmd005
networker 0:7f26f0680202 47 struct { TA_INFO info; trailer trl;} cmd106;//reply to cmd006
networker 0:7f26f0680202 48 struct { trailer trl;} cmd108;//reply to cmd008
networker 0:7f26f0680202 49 struct { trailer trl;} cmd109;//reply to cmd009
networker 0:7f26f0680202 50 struct { trailer trl;} empty; //empty reply (cmd108,109)
networker 0:7f26f0680202 51 } body;
networker 0:7f26f0680202 52 } message;
networker 0:7f26f0680202 53
networker 0:7f26f0680202 54 #define SLAVES 8
networker 0:7f26f0680202 55
networker 0:7f26f0680202 56 extern struct _conf config[SLAVES];
networker 0:7f26f0680202 57 extern message msg;
networker 0:7f26f0680202 58 extern unsigned char thisindex;
networker 0:7f26f0680202 59 void store_index();
networker 0:7f26f0680202 60 #define BYTES(m) ((m->hdr.bytesH<<8)|m->hdr.bytesL)
networker 0:7f26f0680202 61
networker 0:7f26f0680202 62 #endif