84#if !defined(AFX_XBUS_H__F4580A3F_2CF2_4ED2_A747_B4B015A0328E__INCLUDED_)
85#define AFX_XBUS_H__F4580A3F_2CF2_4ED2_A747_B4B015A0328E__INCLUDED_
105#ifndef INVALID_SET_FILE_POINTER
106#define INVALID_SET_FILE_POINTER ((DWORD)(-1))
110#define IND_PREAMBLE 0
117#define IND_DATAEXT0 6
122#define PREAMBLE (const unsigned char)0xFA
123#define BID_MASTER (const unsigned char)0xFF
124#define BID_MT (const unsigned char)0x01
125#define EXTLENCODE 0xFF
127#define LEN_MSGHEADER (const unsigned short)4
128#define LEN_MSGEXTHEADER (const unsigned short)6
129#define LEN_MSGHEADERCS (const unsigned short)5
130#define LEN_MSGEXTHEADERCS (const unsigned short)7
131#define LEN_CHECKSUM (const unsigned short)1
132#define LEN_UNSIGSHORT (const unsigned short)2
133#define LEN_UNSIGINT (const unsigned short)4
134#define LEN_FLOAT (const unsigned short)4
137#define MAXDATALEN (const unsigned short)2048
138#define MAXSHORTDATALEN (const unsigned short)254
139#define MAXMSGLEN (const unsigned short)(MAXDATALEN+7)
140#define MAXSHORTMSGLEN (const unsigned short)(MAXSHORTDATALEN+5)
144#define DID_TYPEH_MASK (const unsigned long)0x00F00000
145#define DID_TYPEH_MT (const unsigned long)0x00000000
146#define DID_TYPEH_XM (const unsigned long)0x00100000
147#define DID_TYPEH_MTI_MTX (const unsigned long)0x00300000
151#define MID_WAKEUP (const unsigned char)0x3E
152#define MID_WAKEUPACK (const unsigned char)0x3F
155#define MID_REQDID (const unsigned char)0x00
156#define MID_DEVICEID (const unsigned char)0x01
157#define LEN_DEVICEID (const unsigned short)4
158#define MID_INITBUS (const unsigned char)0x02
159#define MID_INITBUSRESULTS (const unsigned char)0x03
160#define LEN_INITBUSRESULTS (const unsigned short)4
161#define MID_REQPERIOD (const unsigned char)0x04
162#define MID_REQPERIODACK (const unsigned char)0x05
163#define LEN_PERIOD (const unsigned short)2
164#define MID_SETPERIOD (const unsigned char)0x04
165#define MID_SETPERIODACK (const unsigned char)0x05
167#define MID_SETBID (const unsigned char)0x06
168#define MID_SETBIDACK (const unsigned char)0x07
169#define MID_AUTOSTART (const unsigned char)0x06
170#define MID_AUTOSTARTACK (const unsigned char)0x07
171#define MID_BUSPWROFF (const unsigned char)0x08
172#define MID_BUSPWROFFACK (const unsigned char)0x09
174#define MID_REQDATALENGTH (const unsigned char)0x0A
175#define MID_DATALENGTH (const unsigned char)0x0B
176#define LEN_DATALENGTH (const unsigned short)2
177#define MID_REQCONFIGURATION (const unsigned char)0x0C
178#define MID_CONFIGURATION (const unsigned char)0x0D
179#define LEN_CONFIGURATION (const unsigned short)118
180#define MID_RESTOREFACTORYDEF (const unsigned char)0x0E
181#define MID_RESTOREFACTORYDEFACK (const unsigned char)0x0F
183#define MID_GOTOMEASUREMENT (const unsigned char)0x10
184#define MID_GOTOMEASUREMENTACK (const unsigned char)0x11
185#define MID_REQFWREV (const unsigned char)0x12
186#define MID_FIRMWAREREV (const unsigned char)0x13
187#define LEN_FIRMWAREREV (const unsigned short)3
189#define MID_REQBTDISABLE (const unsigned char)0x14
190#define MID_REQBTDISABLEACK (const unsigned char)0x15
191#define MID_DISABLEBT (const unsigned char)0x14
192#define MID_DISABLEBTACK (const unsigned char)0x15
193#define MID_REQOPMODE (const unsigned char)0x16
194#define MID_REQOPMODEACK (const unsigned char)0x17
195#define MID_SETOPMODE (const unsigned char)0x16
196#define MID_SETOPMODEACK (const unsigned char)0x17
198#define MID_REQBAUDRATE (const unsigned char)0x18
199#define MID_REQBAUDRATEACK (const unsigned char)0x19
200#define LEN_BAUDRATE (const unsigned short)1
201#define MID_SETBAUDRATE (const unsigned char)0x18
202#define MID_SETBAUDRATEACK (const unsigned char)0x19
204#define MID_REQSYNCMODE (const unsigned char)0x1A
205#define MID_REQSYNCMODEACK (const unsigned char)0x1B
206#define MID_SETSYNCMODE (const unsigned char)0x1A
207#define MID_SETSYNCMODEACK (const unsigned char)0x1B
209#define MID_REQPRODUCTCODE (const unsigned char)0x1C
210#define MID_PRODUCTCODE (const unsigned char)0x1D
212#define MID_REQOUTPUTMODE (const unsigned char)0xD0
213#define MID_REQOUTPUTMODEACK (const unsigned char)0xD1
214#define LEN_OUTPUTMODE (const unsigned short)2
215#define MID_SETOUTPUTMODE (const unsigned char)0xD0
216#define MID_SETOUTPUTMODEACK (const unsigned char)0xD1
218#define MID_REQOUTPUTSETTINGS (const unsigned char)0xD2
219#define MID_REQOUTPUTSETTINGSACK (const unsigned char)0xD3
220#define LEN_OUTPUTSETTINGS (const unsigned short)4
221#define MID_SETOUTPUTSETTINGS (const unsigned char)0xD2
222#define MID_SETOUTPUTSETTINGSACK (const unsigned char)0xD3
224#define MID_REQOUTPUTSKIPFACTOR (const unsigned char)0xD4
225#define MID_REQOUTPUTSKIPFACTORACK (const unsigned char)0xD5
226#define LEN_OUTPUTSKIPFACTOR (const unsigned short)2
227#define MID_SETOUTPUTSKIPFACTOR (const unsigned char)0xD4
228#define MID_SETOUTPUTSKIPFACTORACK (const unsigned char)0xD5
230#define MID_REQSYNCINSETTINGS (const unsigned char)0xD6
231#define MID_REQSYNCINSETTINGSACK (const unsigned char)0xD7
232#define LEN_SYNCINMODE (const unsigned short)2
233#define LEN_SYNCINSKIPFACTOR (const unsigned short)2
234#define LEN_SYNCINOFFSET (const unsigned short)4
235#define MID_SETSYNCINSETTINGS (const unsigned char)0xD6
236#define MID_SETSYNCINSETTINGSACK (const unsigned char)0xD7
238#define MID_REQSYNCOUTSETTINGS (const unsigned char)0xD8
239#define MID_REQSYNCOUTSETTINGSACK (const unsigned char)0xD9
240#define LEN_SYNCOUTMODE (const unsigned short)2
241#define LEN_SYNCOUTSKIPFACTOR (const unsigned short)2
242#define LEN_SYNCOUTOFFSET (const unsigned short)4
243#define LEN_SYNCOUTPULSEWIDTH (const unsigned short)4
244#define MID_SETSYNCOUTSETTINGS (const unsigned char)0xD8
245#define MID_SETSYNCOUTSETTINGSACK (const unsigned char)0xD9
247#define MID_REQERRORMODE (const unsigned char)0xDA
248#define MID_REQERRORMODEACK (const unsigned char)0xDB
249#define LEN_ERRORMODE (const unsigned short)2
250#define MID_SETERRORMODE (const unsigned char)0xDA
251#define MID_SETERRORMODEACK (const unsigned char)0xDB
253#define MID_REQTRANSMITDELAY (const unsigned char)0xDC
254#define MID_REQTRANSMITDELAYACK (const unsigned char)0xDD
255#define LEN_TRANSMITDELAY (const unsigned short)2
256#define MID_SETTRANSMITDELAY (const unsigned char)0xDC
257#define MID_SETTRANSMITDELAYACK (const unsigned char)0xDD
260#define MID_REQXMERRORMODE (const unsigned char)0x82
261#define MID_REQXMERRORMODEACK (const unsigned char)0x83
262#define LEN_XMERRORMODE (const unsigned short)2
263#define MID_SETXMERRORMODE (const unsigned char)0x82
264#define MID_SETXMERRORMODEACK (const unsigned char)0x83
266#define MID_REQBUFFERSIZE (const unsigned char)0x84
267#define MID_REQBUFFERSIZEACK (const unsigned char)0x85
268#define LEN_BUFFERSIZE (const unsigned short)2
269#define MID_SETBUFFERSIZE (const unsigned char)0x84
270#define MID_SETBUFFERSIZEACK (const unsigned char)0x85
273#define MID_REQHEADING (const unsigned char)0x82
274#define MID_REQHEADINGACK (const unsigned char)0x83
275#define LEN_HEADING (const unsigned short)4
276#define MID_SETHEADING (const unsigned char)0x82
277#define MID_SETHEADINGACK (const unsigned char)0x83
279#define MID_REQLOCATIONID (const unsigned char)0x84
280#define MID_REQLOCATIONIDACK (const unsigned char)0x85
281#define LEN_LOCATIONID (const unsigned short)2
282#define MID_SETLOCATIONID (const unsigned char)0x84
283#define MID_SETLOCATIONIDACK (const unsigned char)0x85
285#define MID_REQEXTOUTPUTMODE (const unsigned char)0x86
286#define MID_REQEXTOUTPUTMODEACK (const unsigned char)0x87
287#define LEN_EXTOUTPUTMODE (const unsigned short)2
288#define MID_SETEXTOUTPUTMODE (const unsigned char)0x86
289#define MID_SETEXTOUTPUTMODEACK (const unsigned char)0x87
292#define MID_REQBATLEVEL (const unsigned char)0x88
293#define MID_BATLEVEL (const unsigned char)0x89
296#define MID_REQINITTRACKMODE (const unsigned char)0x88
297#define MID_REQINITTRACKMODEACK (const unsigned char)0x89
298#define LEN_INITTRACKMODE (const unsigned short)2
299#define MID_SETINITTRACKMODE (const unsigned char)0x88
300#define MID_SETINITTRACKMODEACK (const unsigned char)0x89
302#define MID_STOREFILTERSTATE (const unsigned char)0x8A
303#define MID_STOREFILTERSTATEACK (const unsigned char)0x8B
306#define MID_GOTOCONFIG (const unsigned char)0x30
307#define MID_GOTOCONFIGACK (const unsigned char)0x31
308#define MID_BUSDATA (const unsigned char)0x32
309#define MID_MTDATA (const unsigned char)0x32
312#define MID_PREPAREDATA (const unsigned char)0x32
313#define MID_REQDATA (const unsigned char)0x34
314#define MID_REQDATAACK (const unsigned char)0x35
318#define LEN_RAWDATA (const unsigned short)20
319#define LEN_CALIBDATA (const unsigned short)36
320#define LEN_CALIB_ACCDATA (const unsigned short)12
321#define LEN_CALIB_GYRDATA (const unsigned short)12
322#define LEN_CALIB_MAGDATA (const unsigned short)12
323#define LEN_ORIENT_QUATDATA (const unsigned short)16
324#define LEN_ORIENT_EULERDATA (const unsigned short)12
325#define LEN_ORIENT_MATRIXDATA (const unsigned short)36
326#define LEN_SAMPLECNT (const unsigned short)2
327#define LEN_TEMPDATA (const unsigned short)4
330#define LEN_CALIBDATA_FLT (const unsigned short)9
331#define LEN_ORIENT_QUATDATA_FLT (const unsigned short)4
332#define LEN_ORIENT_EULERDATA_FLT (const unsigned short)3
333#define LEN_ORIENT_MATRIXDATA_FLT (const unsigned short)9
338#define IND_RAW_ACCX 0
339#define IND_RAW_ACCY 2
340#define IND_RAW_ACCZ 4
341#define IND_RAW_GYRX 6
342#define IND_RAW_GYRY 8
343#define IND_RAW_GYRZ 10
344#define IND_RAW_MAGX 12
345#define IND_RAW_MAGY 14
346#define IND_RAW_MAGZ 16
347#define IND_RAW_TEMP 18
349#define IND_CALIB_ACCX 0
350#define IND_CALIB_ACCY 4
351#define IND_CALIB_ACCZ 8
352#define IND_CALIB_GYRX 12
353#define IND_CALIB_GYRY 16
354#define IND_CALIB_GYRZ 20
355#define IND_CALIB_MAGX 24
356#define IND_CALIB_MAGY 28
357#define IND_CALIB_MAGZ 32
359#define IND_ORIENT_Q0 0
360#define IND_ORIENT_Q1 4
361#define IND_ORIENT_Q2 8
362#define IND_ORIENT_Q3 12
364#define IND_ORIENT_ROLL 0
365#define IND_ORIENT_PITCH 4
366#define IND_ORIENT_YAW 8
368#define IND_ORIENT_A 0
369#define IND_ORIENT_B 4
370#define IND_ORIENT_C 8
371#define IND_ORIENT_D 12
372#define IND_ORIENT_E 16
373#define IND_ORIENT_F 20
374#define IND_ORIENT_G 24
375#define IND_ORIENT_H 28
376#define IND_ORIENT_I 32
378#define IND_SAMPLECNTH 0
379#define IND_SAMPLECNTL 1
383#define FLDNUM_RAW_ACCX 0
384#define FLDNUM_RAW_ACCY 1
385#define FLDNUM_RAW_ACCZ 2
386#define FLDNUM_RAW_GYRX 3
387#define FLDNUM_RAW_GYRY 4
388#define FLDNUM_RAW_GYRZ 5
389#define FLDNUM_RAW_MAGX 6
390#define FLDNUM_RAW_MAGY 7
391#define FLDNUM_RAW_MAGZ 8
392#define FLDNUM_RAW_TEMP 9
394#define FLDNUM_CALIB_ACCX 0
395#define FLDNUM_CALIB_ACCY 1
396#define FLDNUM_CALIB_ACCZ 2
397#define FLDNUM_CALIB_GYRX 3
398#define FLDNUM_CALIB_GYRY 4
399#define FLDNUM_CALIB_GYRZ 5
400#define FLDNUM_CALIB_MAGX 6
401#define FLDNUM_CALIB_MAGY 7
402#define FLDNUM_CALIB_MAGZ 8
404#define FLDNUM_ORIENT_Q0 0
405#define FLDNUM_ORIENT_Q1 1
406#define FLDNUM_ORIENT_Q2 2
407#define FLDNUM_ORIENT_Q3 3
409#define FLDNUM_ORIENT_ROLL 0
410#define FLDNUM_ORIENT_PITCH 1
411#define FLDNUM_ORIENT_YAW 2
413#define FLDNUM_ORIENT_A 0
414#define FLDNUM_ORIENT_B 1
415#define FLDNUM_ORIENT_C 2
416#define FLDNUM_ORIENT_D 3
417#define FLDNUM_ORIENT_E 4
418#define FLDNUM_ORIENT_F 5
419#define FLDNUM_ORIENT_G 6
420#define FLDNUM_ORIENT_H 7
421#define FLDNUM_ORIENT_I 8
424#define LEN_RAW_ACCX 2
425#define LEN_RAW_ACCY 2
426#define LEN_RAW_ACCZ 2
427#define LEN_RAW_GYRX 2
428#define LEN_RAW_GYRY 2
429#define LEN_RAW_GYRZ 2
430#define LEN_RAW_MAGX 2
431#define LEN_RAW_MAGY 2
432#define LEN_RAW_MAGZ 2
433#define LEN_RAW_TEMP 2
435#define LEN_CALIB_ACCX 4
436#define LEN_CALIB_ACCY 4
437#define LEN_CALIB_ACCZ 4
438#define LEN_CALIB_GYRX 4
439#define LEN_CALIB_GYRY 4
440#define LEN_CALIB_GYRZ 4
441#define LEN_CALIB_MAGX 4
442#define LEN_CALIB_MAGY 4
443#define LEN_CALIB_MAGZ 4
445#define LEN_ORIENT_Q0 4
446#define LEN_ORIENT_Q1 4
447#define LEN_ORIENT_Q2 4
448#define LEN_ORIENT_Q3 4
450#define LEN_ORIENT_ROLL 4
451#define LEN_ORIENT_PITCH 4
452#define LEN_ORIENT_YAW 4
454#define LEN_ORIENT_A 4
455#define LEN_ORIENT_B 4
456#define LEN_ORIENT_C 4
457#define LEN_ORIENT_D 4
458#define LEN_ORIENT_E 4
459#define LEN_ORIENT_F 4
460#define LEN_ORIENT_G 4
461#define LEN_ORIENT_H 4
462#define LEN_ORIENT_I 4
465#define VALUE_RAW_ACC 0
466#define VALUE_RAW_GYR 1
467#define VALUE_RAW_MAG 2
468#define VALUE_RAW_TEMP 3
469#define VALUE_CALIB_ACC 4
470#define VALUE_CALIB_GYR 5
471#define VALUE_CALIB_MAG 6
472#define VALUE_ORIENT_QUAT 7
473#define VALUE_ORIENT_EULER 8
474#define VALUE_ORIENT_MATRIX 9
475#define VALUE_SAMPLECNT 10
478#define INVALIDSETTINGVALUE 0xFFFFFFFF
482#define MID_RESET (const unsigned char)0x40
483#define MID_RESETACK (const unsigned char)0x41
484#define MID_ERROR (const unsigned char)0x42
485#define LEN_ERROR (const unsigned short)1
487#define MID_XMPWROFF (const unsigned char)0x44
490#define MID_REQFILTERSETTINGS (const unsigned char)0xA0
491#define MID_REQFILTERSETTINGSACK (const unsigned char)0xA1
492#define LEN_FILTERSETTINGS (const unsigned short)4
493#define MID_SETFILTERSETTINGS (const unsigned char)0xA0
494#define MID_SETFILTERSETTINGSACK (const unsigned char)0xA1
495#define MID_REQAMD (const unsigned char)0xA2
496#define MID_REQAMDACK (const unsigned char)0xA3
497#define LEN_AMD (const unsigned short)2
498#define MID_SETAMD (const unsigned char)0xA2
499#define MID_SETAMDACK (const unsigned char)0xA3
500#define MID_RESETORIENTATION (const unsigned char)0xA4
501#define MID_RESETORIENTATIONACK (const unsigned char)0xA5
502#define LEN_RESETORIENTATION (const unsigned short)2
506#define MSG_WAKEUPLEN 5
507#define MSG_WAKEUPACK (const unsigned char *)"\xFA\xFF\x3F\x00"
508#define MSG_WAKEUPACKLEN 4
510#define MSG_REQDID (const unsigned char *)"\xFA\xFF\x00\x00"
511#define MSG_REQDIDLEN 4
512#define MSG_DEVICEIDLEN 9
513#define MSG_INITBUS (const unsigned char *)"\xFA\xFF\x02\x00"
514#define MSG_INITBUSLEN 4
515#define MSG_INITBUSRESMAXLEN (5 + 4 * MAXSENSORS)
516#define MSG_REQPERIOD (const unsigned char *)"\xFA\xFF\x04\x00"
517#define MSG_REQPERIODLEN 4
518#define MSG_REQPERIODACKLEN 7
519#define MSG_SETPERIOD (const unsigned char *)"\xFA\xFF\x04\x02"
520#define MSG_SETPERIODLEN 6
521#define MSG_SETPERIODACKLEN 5
522#define MSG_SETBID (const unsigned char *)"\xFA\xFF\x06\x05"
523#define MSG_SETBIDLEN 9
524#define MSG_SETBIDACKLEN 5
525#define MSG_AUTOSTART (const unsigned char *)"\xFA\xFF\x06\x00"
526#define MSG_AUTOSTARTLEN 4
527#define MSG_AUTOSTARTACKLEN 5
528#define MSG_BUSPWROFF (const unsigned char *)"\xFA\xFF\x08\x00"
529#define MSG_BUSPWROFFLEN 4
530#define MSG_BUSPWROFFACKLEN 5
531#define MSG_RESTOREFACTORYDEF (const unsigned char *)"\xFA\xFF\x0E\x00"
532#define MSG_RESTOREFACTORYDEFLEN 4
533#define MSG_RESTOREFACTORYDEFACKLEN 5
534#define MSG_REQDATALENGTH (const unsigned char *)"\xFA\xFF\x0A\x00"
535#define MSG_REQDATALENGTHLEN 4
536#define MSG_DATALENGTHLEN 7
537#define MSG_REQCONFIGURATION (const unsigned char *)"\xFA\xFF\x0C\x00"
538#define MSG_REQCONFIGURATIONLEN 4
539#define MSG_GOTOMEASUREMENT (const unsigned char *)"\xFA\xFF\x10\x00"
540#define MSG_GOTOMEASUREMENTLEN 4
541#define MSG_GOTOMEASMAN (const unsigned char *)"\xFA\x01\x10\x00"
542#define MSG_GOTOMEASMANLEN 4
543#define MSG_GOTOMEASACKLEN 5
544#define MSG_REQFWREV (const unsigned char *)"\xFA\xFF\x12\x00"
545#define MSG_REQFWREVLEN 4
546#define MSG_FIRMWAREREVLEN 8
547#define MSG_REQBTDISABLED (const unsigned char *)"\xFA\xFF\x14\x00"
548#define MSG_REQBTDISABLEDLEN 4
549#define MSG_REQBTDISABLEDACKLEN 6
550#define MSG_DISABLEBT (const unsigned char *)"\xFA\xFF\x14\x01"
551#define MSG_DISABLEBTLEN 5
552#define MSG_DISABLEBTACKLEN 5
553#define MSG_REQOPMODE (const unsigned char *)"\xFA\xFF\x16\x00"
554#define MSG_REQOPMODELEN 4
555#define MSG_REQOPMODEACKLEN 6
556#define MSG_SETOPMODE (const unsigned char *)"\xFA\xFF\x16\x01"
557#define MSG_SETOPMODELEN 5
558#define MSG_SETOPMODEACKLEN 5
559#define MSG_REQBAUDRATE (const unsigned char *)"\xFA\xFF\x18\x00"
560#define MSG_REQBAUDRATELEN 4
561#define MSG_REQBAUDRATEACKLEN 6
562#define MSG_SETBAUDRATE (const unsigned char *)"\xFA\xFF\x18\x01"
563#define MSG_SETBAUDRATELEN 5
564#define MSG_SETBAUDRATEACKLEN 5
565#define MSG_REQSYNCMODE (const unsigned char *)"\xFA\xFF\x1A\x00"
566#define MSG_REQSYNCMODELEN 4
567#define MSG_REQSYNCMODEACKLEN 6
568#define MSG_SETSYNCMODE (const unsigned char *)"\xFA\xFF\x1A\x01"
569#define MSG_SETSYNCMODELEN 5
570#define MSG_SETSYNCMODEACKLEN 6
571#define MSG_REQMTS (const unsigned char *)"\xFA\xFF\x90\x01"
572#define MSG_REQMTSLEN 5
573#define MSG_MTSDATA 61
574#define MSG_STORECUSMTS (const unsigned char *)"\xFA\xFF\x92\x58"
575#define MSG_STORECUSMTSLEN 92
576#define MSG_STORECUSMTSACKLEN 5
577#define MSG_REVTOORGMTS (const unsigned char *)"\xFA\xFF\x94\x00"
578#define MSG_REVTOORGMTSLEN 4
579#define MSG_REVTOORGMTSACKLEN 5
580#define MSG_STOREMTS (const unsigned char *)"\xFA\xFF\x96\x41"
581#define MSG_STOREMTSLEN 69
582#define MSG_STOREMTSACKLEN 5
583#define MSG_REQSYNCOUTMODE (const unsigned char *)"\xFA\xFF\xD8\x01\x00"
584#define MSG_REQSYNCOUTMODELEN 5
585#define MSG_REQSYNCOUTSKIPFACTOR (const unsigned char *)"\xFA\xFF\xD8\x01\x01"
586#define MSG_REQSYNCOUTSKIPFACTORLEN 5
587#define MSG_REQSYNCOUTOFFSET (const unsigned char *)"\xFA\xFF\xD8\x01\x02"
588#define MSG_REQSYNCOUTOFFSETLEN 5
589#define MSG_REQSYNCOUTPULSEWIDTH (const unsigned char *)"\xFA\xFF\xD8\x01\x03"
590#define MSG_REQSYNCOUTPULSEWIDTHLEN 5
591#define MSG_REQERRORMODE (const unsigned char *)"\xFA\xFF\xDA\x00"
592#define MSG_REQERRORMODELEN 4
593#define MSG_REQERRORMODEACKLEN 7
595#define MSG_GOTOCONFIG (const unsigned char *)"\xFA\xFF\x30\x00"
596#define MSG_GOTOCONFIGLEN 4
597#define MSG_GOTOCONFIGACKLEN 5
599#define MSG_GOTOCONFIGM (const unsigned char *)"\xFA\x01\x30\x00"
600#define MSG_GOTOCONFIGMLEN 4
601#define MSG_GOTOCONFIGMACKLEN 5
602#define MSG_PREPAREDATA (const unsigned char *)"\xFA\x01\x32\x00"
603#define MSG_PREPAREDATALEN 4
604#define MSG_REQDATA (const unsigned char *)"\xFA\x01\x34\x00"
605#define MSG_REQDATALEN 4
607#define MSG_RESET (const unsigned char *)"\xFA\xFF\x40\x00"
608#define MSG_RESETLEN 4
609#define MSG_RESETACKLEN 5
610#define MSG_XMPWROFF (const unsigned char *)"\xFA\xFF\x44\x00"
611#define MSG_XMPWROFFLEN 4
612#define MSG_XMPWROFFACKLEN 5
615#define BAUDRATE_9K6 0x09
616#define BAUDRATE_14K4 0x08
617#define BAUDRATE_19K2 0x07
618#define BAUDRATE_28K8 0x06
619#define BAUDRATE_38K4 0x05
620#define BAUDRATE_57K6 0x04
621#define BAUDRATE_76K8 0x03
622#define BAUDRATE_115K2 0x02
623#define BAUDRATE_230K4 0x01
624#define BAUDRATE_460K8 0x00
625#define BAUDRATE_921K6 0x80
628#define ERROR_NOBUSCOMM 0x01
629#define ERROR_BUSNOTREADY 0x02
630#define ERROR_PERIODINVALID 0x03
631#define ERROR_MESSAGEINVALID 0x04
632#define ERROR_INITOFBUSFAILED1 0x10
633#define ERROR_INITOFBUSFAILED2 0x11
634#define ERROR_INITOFBUSFAILED3 0x12
635#define ERROR_SETBIDPROCFAILED1 0x14
636#define ERROR_SETBIDPROCFAILED2 0x15
637#define ERROR_MEASUREMENTFAILED1 0x18
638#define ERROR_MEASUREMENTFAILED2 0x19
639#define ERROR_MEASUREMENTFAILED3 0x1A
640#define ERROR_MEASUREMENTFAILED4 0x1B
641#define ERROR_MEASUREMENTFAILED5 0x1C
642#define ERROR_MEASUREMENTFAILED6 0x1D
643#define ERROR_TIMEROVERFLOW 0x1E
644#define ERROR_BAUDRATEINVALID 0x20
645#define ERROR_PARAMETERINVALID 0x21
646#define ERROR_MEASUREMENTFAILED7 0x23
649#define ERRORMODE_IGNORE 0x0000
650#define ERRORMODE_INCSAMPLECNT 0x0001
651#define ERRORMODE_INCSAMPLECNT_SENDERROR 0x0002
652#define ERRORMODE_SENDERROR_GOTOCONFIG 0x0003
655#define CONF_MASTERDID 0
657#define CONF_OUTPUTSKIPFACTOR 6
658#define CONF_SYNCIN_MODE 8
659#define CONF_SYNCIN_SKIPFACTOR 10
660#define CONF_SYNCIN_OFFSET 12
663#define CONF_NUMDEVICES 96
666#define CONF_DATALENGTH 102
667#define CONF_OUTPUTMODE 104
668#define CONF_OUTPUTSETTINGS 106
669#define CONF_BLOCKLEN 20
672#define CONF_MASTERDIDLEN 4
673#define CONF_PERIODLEN 2
674#define CONF_OUTPUTSKIPFACTORLEN 2
675#define CONF_SYNCIN_MODELEN 2
676#define CONF_SYNCIN_SKIPFACTORLEN 2
677#define CONF_SYNCIN_OFFSETLEN 4
678#define CONF_DATELEN 8
679#define CONF_TIMELEN 8
680#define CONF_RESERVED_CLIENTLEN 32
681#define CONF_RESERVED_HOSTLEN 32
682#define CONF_NUMDEVICESLEN 2
685#define CONF_DATALENGTHLEN 2
686#define CONF_OUTPUTMODELEN 2
687#define CONF_OUTPUTSETTINGSLEN 4
690#define SYNC_CLOCKFREQ 29.4912e6
693#define PARAM_SYNCIN_MODE (const unsigned char)0x00
694#define PARAM_SYNCIN_SKIPFACTOR (const unsigned char)0x01
695#define PARAM_SYNCIN_OFFSET (const unsigned char)0x02
698#define SYNCIN_DISABLED 0x0000
699#define SYNCIN_EDGE_RISING 0x0001
700#define SYNCIN_EDGE_FALLING 0x0002
701#define SYNCIN_EDGE_BOTH 0x0003
702#define SYNCIN_TYPE_SENDLASTDATA 0x0004
703#define SYNCIN_TYPE_DOSAMPLING 0x0000
704#define SYNCIN_EDGE_MASK 0x0003
705#define SYNCIN_TYPE_MASK 0x000C
708#define PARAM_SYNCOUT_MODE (const unsigned char)0x00
709#define PARAM_SYNCOUT_SKIPFACTOR (const unsigned char)0x01
710#define PARAM_SYNCOUT_OFFSET (const unsigned char)0x02
711#define PARAM_SYNCOUT_PULSEWIDTH (const unsigned char)0x03
714#define SYNCOUT_DISABLED 0x0000
715#define SYNCOUT_TYPE_TOGGLE 0x0001
716#define SYNCOUT_TYPE_PULSE 0x0002
717#define SYNCOUT_POL_NEG 0x0000
718#define SYNCOUT_POL_POS 0x0010
719#define SYNCOUT_TYPE_MASK 0x000F
720#define SYNCOUT_POL_MASK 0x0010
723#define PERIOD_10HZ 0x2D00
724#define PERIOD_12HZ 0x2580
725#define PERIOD_15HZ 0x1E00
726#define PERIOD_16HZ 0x1C20
727#define PERIOD_18HZ 0x1900
728#define PERIOD_20HZ 0x1680
729#define PERIOD_24HZ 0x12C0
730#define PERIOD_25HZ 0x1200
731#define PERIOD_30HZ 0x0F00
732#define PERIOD_32HZ 0x0E10
733#define PERIOD_36HZ 0x0C80
734#define PERIOD_40HZ 0x0B40
735#define PERIOD_45HZ 0x0A00
736#define PERIOD_48HZ 0x0960
737#define PERIOD_50HZ 0x0900
738#define PERIOD_60HZ 0x0780
739#define PERIOD_64HZ 0x0708
740#define PERIOD_72HZ 0x0640
741#define PERIOD_75HZ 0x0600
742#define PERIOD_80HZ 0x05A0
743#define PERIOD_90HZ 0x0500
744#define PERIOD_96HZ 0x04B0
745#define PERIOD_100HZ 0x0480
746#define PERIOD_120HZ 0x03C0
747#define PERIOD_128HZ 0x0384
748#define PERIOD_144HZ 0x0320
749#define PERIOD_150HZ 0x0300
750#define PERIOD_160HZ 0x02D0
751#define PERIOD_180HZ 0x0280
752#define PERIOD_192HZ 0x0258
753#define PERIOD_200HZ 0x0240
754#define PERIOD_225HZ 0x0200
755#define PERIOD_240HZ 0x01E0
756#define PERIOD_256HZ 0x01C2
757#define PERIOD_288HZ 0x0190
758#define PERIOD_300HZ 0x0180
759#define PERIOD_320HZ 0x0168
760#define PERIOD_360HZ 0x0140
761#define PERIOD_384HZ 0x012C
762#define PERIOD_400HZ 0x0120
763#define PERIOD_450HZ 0x0100
764#define PERIOD_480HZ 0x00F0
765#define PERIOD_512HZ 0x00E1
768#define OUTPUTMODE_MT9 0x8000
769#define OUTPUTMODE_XM 0x0000
770#define OUTPUTMODE_RAW 0x4000
771#define OUTPUTMODE_TEMP 0x0001
772#define OUTPUTMODE_CALIB 0x0002
773#define OUTPUTMODE_ORIENT 0x0004
776#define OUTPUTSETTINGS_XM 0x00000001
777#define OUTPUTSETTINGS_TIMESTAMP_NONE 0x00000000
778#define OUTPUTSETTINGS_TIMESTAMP_SAMPLECNT 0x00000001
779#define OUTPUTSETTINGS_ORIENTMODE_QUATERNION 0x00000000
780#define OUTPUTSETTINGS_ORIENTMODE_EULER 0x00000004
781#define OUTPUTSETTINGS_ORIENTMODE_MATRIX 0x00000008
782#define OUTPUTSETTINGS_CALIBMODE_ACCGYRMAG 0x00000000
783#define OUTPUTSETTINGS_CALIBMODE_ACC 0x00000060
784#define OUTPUTSETTINGS_CALIBMODE_ACCGYR 0x00000040
785#define OUTPUTSETTINGS_CALIBMODE_ACCMAG 0x00000020
786#define OUTPUTSETTINGS_CALIBMODE_GYR 0x00000050
787#define OUTPUTSETTINGS_CALIBMODE_GYRMAG 0x00000010
788#define OUTPUTSETTINGS_CALIBMODE_MAG 0x00000030
789#define OUTPUTSETTINGS_DATAFORMAT_FLOAT 0x00000000
790#define OUTPUTSETTINGS_DATAFORMAT_F1220 0x00000100
791#define OUTPUTSETTINGS_TIMESTAMP_MASK 0x00000003
792#define OUTPUTSETTINGS_ORIENTMODE_MASK 0x0000000C
793#define OUTPUTSETTINGS_CALIBMODE_ACC_MASK 0x00000010
794#define OUTPUTSETTINGS_CALIBMODE_GYR_MASK 0x00000020
795#define OUTPUTSETTINGS_CALIBMODE_MAG_MASK 0x00000040
796#define OUTPUTSETTINGS_CALIBMODE_MASK 0x00000070
797#define OUTPUTSETTINGS_DATAFORMAT_MASK 0x00000300
800#define EXTOUTPUTMODE_DISABLED 0x0000
801#define EXTOUTPUTMODE_EULER 0x0001
804#define FACTORYOUTPUTMODE_DISABLE 0x0000
805#define FACTORYOUTPUTMODE_DEFAULT 0x0001
806#define FACTORYOUTPUTMODE_CUSTOM 0x0002
809#define INITTRACKMODE_DISABLED 0x0000
810#define INITTRACKMODE_ENABLED 0x0001
813#define PARAM_FILTER_GAIN (const unsigned char)0x00
814#define PARAM_FILTER_RHO (const unsigned char)0x01
815#define DONOTSTORE 0x00
819#define AMDSETTING_DISABLED 0x0000
820#define AMDSETTING_ENABLED 0x0001
823#define RESETORIENTATION_STORE 0
824#define RESETORIENTATION_HEADING 1
825#define RESETORIENTATION_GLOBAL 2
826#define RESETORIENTATION_OBJECT 3
827#define RESETORIENTATION_ALIGN 4
830#define SENDRAWSTRING_INIT 0
831#define SENDRAWSTRING_DEFAULT 1
832#define SENDRAWSTRING_SEND 2
835#define TO_DEFAULT 500
841#define PBR_9600 CBR_9600
842#define PBR_14K4 CBR_14400
843#define PBR_19K2 CBR_19200
844#define PBR_28K8 28800
845#define PBR_38K4 CBR_38400
846#define PBR_57K6 CBR_57600
847#define PBR_76K8 76800
848#define PBR_115K2 CBR_115200
849#define PBR_230K4 230400
850#define PBR_460K8 460800
851#define PBR_921K6 921600
853#define PBR_9600 B9600
854#define PBR_14K4 B14400
855#define PBR_19K2 B19200
856#define PBR_28K8 B28800
857#define PBR_38K4 B38400
858#define PBR_57K6 B57600
859#define PBR_76K8 B76800
860#define PBR_115K2 B115200
861#define PBR_230K4 B230400
862#define PBR_460K8 B460800
863#define PBR_921K6 B921600
868#define FILEPOS_BEGIN FILE_BEGIN
869#define FILEPOS_CURRENT FILE_CURRENT
870#define FILEPOS_END FILE_END
872#define FILEPOS_BEGIN SEEK_SET
873#define FILEPOS_CURRENT SEEK_CUR
874#define FILEPOS_END SEEK_END
879#define MTRV_NOTSUCCESSFUL 1
880#define MTRV_TIMEOUT 2
881#define MTRV_TIMEOUTNODATA 3
882#define MTRV_CHECKSUMFAULT 4
884#define MTRV_RECVERRORMSG 6
885#define MTRV_OUTOFMEMORY 7
886#define MTRV_UNKNOWDATA 8
887#define MTRV_INVALIDTIMEOUT 9
888#define MTRV_UNEXPECTEDMSG 10
889#define MTRV_INPUTCANNOTBEOPENED 11
890#define MTRV_ANINPUTALREADYOPEN 12
891#define MTRV_ENDOFFILE 13
892#define MTRV_NOINPUTINITIALIZED 14
893#define MTRV_NOVALIDMODESPECIFIED 15
895#define MTRV_INVALIDVALUESPEC 16
896#define MTRV_INVALIDFORFILEINPUT 17
908 short openPort(
const int portNumber,
const unsigned long baudrate =
PBR_115K2,
const unsigned long inqueueSize = 4096,
const unsigned long outqueueSize = 1024);
909 short openPort(
const char *portName,
const unsigned long baudrate =
PBR_115K2,
const unsigned long inqueueSize = 4096,
const unsigned long outqueueSize = 1024);
910 short openFile(
const char *fileName,
bool createAlways =
false);
913 int readData(
unsigned char* msgBuffer,
const int nBytesToRead);
914 int writeData(
const unsigned char* msgBuffer,
const int nBytesToWrite);
917 void setPortQueueSize(
const unsigned long inqueueSize = 4096,
const unsigned long outqueueSize = 1024);
923 short readMessage(
unsigned char &mid,
unsigned char data[],
short &dataLen,
unsigned char *bid = NULL);
925 short readMessageRaw(
unsigned char *msgBuffer,
short *msgBufferLength);
926 short writeMessage(
const unsigned char mid,
const unsigned long dataValue = 0,
927 const unsigned char dataValueLen = 0,
const unsigned char bid =
BID_MASTER);
929 const unsigned short &dataLen,
const unsigned char bid =
BID_MASTER);
930 short waitForMessage(
const unsigned char mid,
unsigned char data[] = NULL,
short *dataLen = NULL,
unsigned char *bid = NULL);
933 short reqSetting(
const unsigned char mid,
unsigned long &value,
const unsigned char bid =
BID_MASTER);
934 short reqSetting(
const unsigned char mid,
const unsigned char param,
unsigned long &value,
937 short reqSetting(
const unsigned char mid,
const unsigned char param,
float &value,
940 unsigned char data[],
short &dataLen,
const unsigned char bid =
BID_MASTER);
942 unsigned char dataIn[],
short dataInLen,
943 unsigned char dataOut[],
short &dataOutLen,
945 short reqSetting(
const unsigned char mid,
const unsigned char param,
946 unsigned char data[],
short &dataLen,
const unsigned char bid =
BID_MASTER);
948 const unsigned long value,
const unsigned short valuelen,
950 short setSetting(
const unsigned char mid,
const unsigned char param,
951 const unsigned long value,
const unsigned short valuelen,
953 short setSetting(
const unsigned char mid,
const float value,
const unsigned char bid =
BID_MASTER);
954 short setSetting(
const unsigned char mid,
const unsigned char param,
955 const float value,
const unsigned char bid =
BID_MASTER);
956 short setSetting(
const unsigned char mid,
const unsigned char param,
957 const float value,
const bool store,
const unsigned char bid =
BID_MASTER);
960 short setDeviceMode(
unsigned long OutputMode,
unsigned long OutputSettings,
const unsigned char bid =
BID_MASTER);
961 short getMode(
unsigned long &OutputMode,
unsigned long &OutputSettings,
unsigned short &dataLength,
963 short setMode(
unsigned long OutputMode,
unsigned long OutputSettings,
const unsigned char bid =
BID_MASTER);
964 short getValue(
const unsigned long valueSpec,
unsigned short &value,
const unsigned char data[],
965 const unsigned char bid =
BID_MT);
966 short getValue(
const unsigned long valueSpec,
unsigned short value[],
const unsigned char data[],
967 const unsigned char bid =
BID_MT);
968 short getValue(
const unsigned long valueSpec,
float value[],
const unsigned char data[],
969 const unsigned char bid =
BID_MT);
975 static void swapEndian(
const unsigned char input[],
unsigned char output[],
const short length);
976 void calcChecksum(
unsigned char *msgBuffer,
const int msgBufferLength);
977 bool checkChecksum(
const unsigned char *msgBuffer,
const int msgBufferLength);
short readMessage(unsigned char &mid, unsigned char data[], short &dataLen, unsigned char *bid=NULL)
int readData(unsigned char *msgBuffer, const int nBytesToRead)
short setSetting(const unsigned char mid, const unsigned long value, const unsigned short valuelen, const unsigned char bid=BID_MASTER)
short setDeviceMode(unsigned long OutputMode, unsigned long OutputSettings, const unsigned char bid=BID_MASTER)
void escape(unsigned long function)
short readDataMessage(unsigned char data[], short &dataLen)
short openPort(const int portNumber, const unsigned long baudrate=PBR_115K2, const unsigned long inqueueSize=4096, const unsigned long outqueueSize=1024)
unsigned long m_storedOutputMode[MAXDEVICES+1]
unsigned char m_tempBuffer[MAXMSGLEN]
short openFile(const char *fileName, bool createAlways=false)
short getFileSize(unsigned long &fileSize)
short getLastDeviceError()
short setMode(unsigned long OutputMode, unsigned long OutputSettings, const unsigned char bid=BID_MASTER)
short readMessageRaw(unsigned char *msgBuffer, short *msgBufferLength)
short waitForMessage(const unsigned char mid, unsigned char data[]=NULL, short *dataLen=NULL, unsigned char *bid=NULL)
short getValue(const unsigned long valueSpec, unsigned short &value, const unsigned char data[], const unsigned char bid=BID_MT)
void calcChecksum(unsigned char *msgBuffer, const int msgBufferLength)
short setTimeOut(short timeOutMs)
void setPortQueueSize(const unsigned long inqueueSize=4096, const unsigned long outqueueSize=1024)
unsigned long m_storedDataLength[MAXDEVICES+1]
static void swapEndian(const unsigned char input[], unsigned char output[], const short length)
bool checkChecksum(const unsigned char *msgBuffer, const int msgBufferLength)
short getMode(unsigned long &OutputMode, unsigned long &OutputSettings, unsigned short &dataLength, const unsigned char bid=BID_MASTER)
short setFilePos(long relPos, unsigned long moveMethod=FILEPOS_BEGIN)
unsigned long m_storedOutputSettings[MAXDEVICES+1]
short reqSetting(const unsigned char mid, unsigned long &value, const unsigned char bid=BID_MASTER)
int writeData(const unsigned char *msgBuffer, const int nBytesToWrite)
short getDeviceMode(unsigned short *numDevices=NULL)
short writeMessage(const unsigned char mid, const unsigned long dataValue=0, const unsigned char dataValueLen=0, const unsigned char bid=BID_MASTER)
function[xhat, yhat, F, H]