libroboint
roboint.h
Go to the documentation of this file.
1 
2 /*******************************************************************************
3  * (c) by Knobloch GmbH
4  * Weedgasse 14
5  * D-55234 Erbes-Büdesheim
6  *
7  * Header: FtLib.h Headerfile for fischertechnik USB-Library
8  *
9  * Version: 0.60
10  * Date: 10. May 2006
11  *
12  * Revision:
13  * 0.60: 10. May 2006
14  * New Name: GetAnzFtUsbDevice() --> GetNumFtUsbDevice()
15  * ClearFtMessagePuffer() --> ClearFtMessageBuffer()
16  ********************************************************************************/
17 
18 
19 #ifndef _FT_LIBRARY_H_
20 #define _FT_LIBRARY_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
27 #define DWORD long int
28 #define BYTE unsigned char
29 #define USHORT unsigned short int
30 #define UINT unsigned int
31 #define UCHAR unsigned char
32 
33 #define HANDLE int
34 #define HWND int
35 #define __stdcall
36 #define LPCSTR char *
37 #define LPVOID void *
41 typedef struct _FT_TRANSFER_AREA
42 {
45  unsigned char E_Main;
46 
49  unsigned char E_Sub1;
52  unsigned char E_Sub2;
55  unsigned char E_Sub3;
56 
59  unsigned char rsvd1[8];
60 
63  unsigned char Distance;
64 
66  unsigned char rsvd2;
67 
91  unsigned char IRKeys;
92 
94  unsigned char res_1;
95 
100  unsigned short AX;
105  unsigned short AY;
110  unsigned short A1;
115  unsigned short A2;
120  unsigned short AZ;
125  unsigned short AV;
130  unsigned short D1;
135  unsigned short D2;
136 
140  unsigned short AXS1;
144  unsigned short AXS2;
148  unsigned short AXS3;
149 
153  unsigned short DS1;
157  unsigned short DS2;
158 
161  unsigned short ZE;
162 
165  unsigned char rsvd3[4];
166 
170  unsigned short Timer1ms;
174  unsigned short Timer10ms;
178  unsigned short Timer100ms;
182  unsigned short Timer1s;
186  unsigned short Timer10s;
190  unsigned short Timer1min;
191 
194  unsigned short res_bF;
197  unsigned char res_bT;
198 
201  unsigned char rsvd4[1];
202 
206  unsigned char M_Main;
210  unsigned char M_Sub1;
214  unsigned char M_Sub2;
218  unsigned char M_Sub3;
219 
222  unsigned char rsvd5[4];
223 
228  unsigned char MES_Main;
232  unsigned char MES_Sub1;
236  unsigned char MES_Sub2;
240  unsigned char MES_Sub3;
241 
244  unsigned char rsvd6[1];
245 
248  unsigned char reserved_l1;
251  unsigned char reserved_l2;
254  unsigned char reserved_l3;
255 
266  unsigned char MPWM_Main[8];
267 
278  unsigned char MPWM_Sub1[8];
279 
290  unsigned char MPWM_Sub2[8];
291 
302  unsigned char MPWM_Sub3[8];
303 
306  unsigned char rsvd7[32];
307 
308 
312  unsigned short A1S1;
316  unsigned short A1S2;
320  unsigned short A1S3;
321 
325  unsigned short AVS1;
329  unsigned short AVS2;
333  unsigned short AVS3;
334 
337  unsigned char rsvd8[4];
338 
341  unsigned short AX_R;
342 
344  unsigned short AY_R;
345 
347  unsigned short AXS1_R;
348 
350  unsigned short AXS2_R;
351 
353  unsigned short AXS3_R;
354 
357  unsigned char rsvd10[54];
358 
361  unsigned char Mode;
362 
365  unsigned char MPWM_Update;
366 
371  unsigned char TransferAktiv;
372 
375  unsigned char rsvd11[3];
376 
381  unsigned char BusModules;
382 
385  unsigned char SlotModule1;
386 
389  unsigned char SlotModule2;
390 
393  unsigned char rsvd12[7];
394 
395 
401  unsigned char ChangeEg;
402 
408  unsigned char ChangeAn;
409 
414  unsigned char ChangeIr;
415 
416 
419  unsigned char rsvd13[13];
420 
421 
432  unsigned short E16_Main[8];
443  unsigned short E16_Sub1[8];
454  unsigned short E16_Sub2[8];
465  unsigned short E16_Sub3[8];
470  unsigned short Distance16[2];
471 
474  unsigned char rsvd14[12];
475 
489  unsigned short IRKeys16[11];
492  unsigned char rsvd15[10];
493 
507  unsigned short IRKeys16Code1[11];
508 
512  unsigned char rsvd16[10];
513 
527  unsigned short IRKeys16Code2[11];
528 
532  unsigned char rsvd17[10];
533 
537  unsigned short RfStatus;
538 
542  unsigned short RfPower;
543 
547  unsigned short RfError;
548 
552  unsigned short MsgNumInBuffer;
553 
557  unsigned short RfModulNr;
558 
561  unsigned char rsvd19[2];
562 
565  DWORD dwTC;
566 
569  unsigned char rsvd20[64];
570 
576 #include <usb.h>
577 #include <pthread.h>
578 #include <semaphore.h>
579 #include <termios.h>
580 
582 typedef struct ft_handle_devices {
586  struct usb_device *dev;
588  usb_dev_handle *device;
590  long int sdev;
592  long int type;
594  pthread_t t;
596  sem_t lock;
598  struct termios saveioset;
600  struct termios newioset;
604  unsigned int query_time;
606  unsigned char interface_connected;
614 FT_HANDLE OpenFtCommDevice(char *sDevice, long int dwTyp, long int dwZyklus);
615 int GetFtStatus(FT_HANDLE hFt, int *num);
616 long int GetFtDeviceTypeString(FT_HANDLE hft, char *dest, int len);
617 char *GetLibVersionStrg();
618 long int SetRFMode(FT_HANDLE hFt, long int frequency, long int callSign);
619 long int GetRFMode(FT_HANDLE hFt, long int *frequency, long int *callSign);
620 long int SetRealSerial(FT_HANDLE hFt, unsigned char bOn);
622 
623  // Numbers from GetFtDeviceTyp()
624 #define NO_FT_DEVICE 0 // No ft Device connected
625 #define FT_AUTO_TYPE 1 // Search for Device
626 #define FT_INTELLIGENT_IF 10 // FT-Intelligent Interface connect (serial)
627 #define FT_INTELLIGENT_IF_SLAVE 20 // FT-Intelligent Interface with Extension connect (serial)
628 #define FT_ROBO_IF_IIM 50 // FT-Robo Interface with Intelligent-Interface-Modus connect (serial)
629 #define FT_ROBO_IF_USB 60 // FT-Robo Interface connect with USB-Port
630 #define FT_ROBO_IF_COM 70 // FT-Robo Interface connect with COM- (serial-) Port
631 #define FT_ROBO_IF_OVER_RF 80 // FT-Robo Interface connect over RF-Data-Link
632 #define FT_ROBO_IO_EXTENSION 90 // FT-Robo I/O-Extension
633 #define FT_ROBO_LT_CONTROLLER 91 // FT-Robo LT Controller
634 #define FT_ROBO_RF_DATA_LINK 110 // FT-Robo RF Data Link
635 #define FT_SOUND_AND_LIGHTS 120 // FT-Sound + Lights Module
636 #define ROBO_CONNECT_BOX 200 // Robo-Connect-Box (USB-Product for old Interfaces with parallel- or serial- port)
637 #define EDU_LINE_MODULE 300 // education line module
638 #define EDU_LINE_CROSSROADS 301 // education line - Module: CrossRoads (www.knobloch-gmbh.de)
639 #define EDU_LINE_TRAFFICLIGHTS 302 // education line - Module: Trafic Lights
640 #define EDU_LINE_SIGNAL 303 // education line - Module: Signal
641 #define EDU_LINE_EASY_PH 304 // education line - Module: easy pH
642 #define EDU_LINE_LIFT_01 305 // education line - Module: Lift (Aufzug)
643 #define FT_MAX_TYP_NUMBER 999 // Max Typ Number
644 
645 
646 #define FT_ANALOG_CYCLE 5 // Standard: 5*Read Digital Inputs, then EX, EY
647  // Only for old Intelligent Interface { for OpenFtCommDevice() }
648 
649 
650 #define PORT_NONE 0
651 #define PORT_COM 1 // Standard: COM1
652 #define PORT_COM1 1
653 #define PORT_COM2 2
654 #define PORT_COM3 3
655 #define PORT_COM4 4
656 #define PORT_USB 50
657 
658  // Moduletypes for Robo Interface
659 #define MODULE_NOT_INSTALLED 0 // Not installed
660 #define MODULE_RF1 1 // RF Data Link Module is installed
661 
662 
663 #define LEN_STRG1 30 // Length of SN / FW Strings
664 #define LEN_STRG2 255 // Length of Name-Strigs
665 #define ANZ_DISTANCE_TYPES 2 // Number of supported Distance-Modes
666 #define LEN_DIST_TYPE_NAMES 30 // Lenght of Mode-Names
667 #define LEN_DIST_VAR_NAMES 20 // Lenght of Variable-Names
668 #define NAME_LEN 85 // Lenght of Prog-Names
669 
670 
671 #define MEM_FLASH1 0 // Use Memory FLASH-1 Block
672 #define MEM_FLASH2 1 // Use Memory FLASH-2 Block
673 #define MEM_RAM 2 // Use Memory RAM Block
674 #define MEM_NO_ACCESS -1 // No Memory Select (for SetFtProgramActiv() )
675 #define DOWNLOAD_PROG_NAMELEN 80 // Max. 80 characters/bytes for the programname
676 
677  // Values for "dwParameter" from DownloadFtProgram()
678 #define PROG_TYP_NORMAL 1 // Program can bei Start with Software and Switch
679 #define PROG_TYP_AUTOSTART 2 // Program is startable at Power-On
680 
681 
682  // COM-Modes for SetFtDeviceCommMode()
683 #define IF_COM_ONLINE 1 // Online Mode
684 #define IF_COM_MESSAGE 3 // Messagemode
685 #define IF_COM_DATA 4 // Datatransfer
686 #define IF_COM_PARAMETER 5 // Get Mode
687 
688 
689  // Message-System
690 #define MSG_HWID_SELF 0 // Message for himself
691 #define MSG_HWID_SER 1 // Message for the Robo-Interface serial port
692 #define MSG_HWID_RF 2 // Message for other Interfaces (over RF)
693 #define MSG_HWID_RF_SELF 3 // Message for other Interfaces (over RF) and for himself (back over RF)
694 
695 #define MSG_BUFF_SER 1 // SER-Messagebuffer (for ClearRfMessage() )
696 #define MSG_BUFF_RF 2 // RF-Messagebuffer (for ClearRfMessage() )
697 #define MSG_BUFF_SELF 4 // SELF-Messagebuffer (for ClearRfMessage() )
698 
699 #define MSG_SEND_NORMAL 0 // Message send "normal"
700 #define MSG_SEND_OTHER_THAN_LAST 1 // Message send "if not the same as the last message"
701 #define MSG_SEND_IF_NOT_PRESENT 2 // Message send "if not present in the send buffer"
702 
703 
704 
705  // Interface Distancesensor-Inputs Type
706 #define IF_DS_INPUT_VOLTAGE 0 // Voltage
707 #define IF_DS_INPUT_DISTANCE 1 // Distance
708 #define IF_DS_INPUT_TOL_STD 20 // Toleranz (Standard)
709 #define IF_DS_INPUT_REP_STD 3 // Repeat (Standard)
710 
711 
712 
713  #pragma pack( push, 1 )
714  typedef union
715  {
716  BYTE aucMsg[6];
717 
718  struct
719  {
720  BYTE ucHwId;
721  BYTE ucSubId;
722  BYTE ucB0;
723  BYTE ucB1;
724  BYTE ucB2;
725  BYTE ucB3;
726  } B;
727 
728  struct
729  {
730  BYTE ucHwId;
731  BYTE ucSubId;
732  USHORT uiMsgId;
733  USHORT uiMsg;
734  } W;
735 
736  struct
737  {
738  BYTE ucHwId;
739  BYTE ucSubId;
740  DWORD dw;
741  } L;
742  } SMESSAGE;
743  #pragma pack( pop )
744 
745 
746  //typedef void * FT_HANDLE;
747  typedef void (*DATA_UPDATE_CALLBACK)(void* Context);
748  typedef void (*MSG_UPDATE_CALLBACK)(SMESSAGE *);
749 
750 
751 
752  // Important:
753  // Initialise all unused Variables in this Structure with "NULL"
754  //
755  // Every Time the driver reads new information from the Device
756  // the Library checks this structure
757  typedef struct _NOTIFICATION_EVENTS
758  {
759  // Callback-Procedure
760  DATA_UPDATE_CALLBACK NotificationCallback; // Pointer to the Callback-Procedure
761  void* Context; // Pointer to the Context for the Callback-Procedure
762 
763  // for SetEvent()
764  HANDLE hEvent;
765 
766  // for posting a Message (PostMessage() with wParam & lParam = 0)
767  HWND WindowsHandle; // handle to the destination window
768  DWORD Message; // message ID
769 
770 
771  // Callback-Procedure for Messaging
772  MSG_UPDATE_CALLBACK CallbackMessage; // Pointer to the Callback-Procedure for Receiving Messages
773 
774  }
775  NOTIFICATION_EVENTS;
776 
777 
778 
779 
780  typedef struct _FT_SERIAL_NUMBER
781  {
782  DWORD dwSn; // actually Serial Number at Power On
783  DWORD dwSn1; // Serial Number-1
784  DWORD dwSn2; // Serial Number-2
785  DWORD dwSnAktiv; // Serial Number Activ (1/2) for next Power On
786  } FT_SERIAL_NUMBER;
787 
788 
789 
790  typedef struct _FT_DISTANCE // Robo Interface Distance Sensor
791  {
792  unsigned char aDistModeNames[LEN_DIST_TYPE_NAMES]; // RO Names for the Modes
793 
794  DWORD dwEnableDisVal1; // RO 1=Ask for Distance Value 1
795  unsigned char aDisVal1Name[LEN_DIST_VAR_NAMES]; // RO Value 1 Name
796  DWORD dwDisVal1; // RW Value 1
797 
798  DWORD dwEnableDisVal2; // RO 1=Ask for Distance Value 2
799  unsigned char aDisVal2Name[LEN_DIST_VAR_NAMES]; // RO Value 2 Name
800  DWORD dwDisVal2; // RW Value 2
801 
802  DWORD dwEnableDisVal3; // RO 1=Ask for Distance Value 3
803  unsigned char aDisVal3Name[LEN_DIST_VAR_NAMES]; // RO Value 3 Name
804  DWORD dwDisVal3; // RW Value 3
805 
806  DWORD dwEnableDisVal4; // RO 1=Ask for Distance Value 4
807  unsigned char aDisVal4Name[LEN_DIST_VAR_NAMES]; // RO Value 4 Name
808  DWORD dwDisVal4; // RW Value 4
809 
810  DWORD dwEnableDisVal5; // RO 1=Ask for Distance Value 5
811  unsigned char aDisVal5Name[LEN_DIST_VAR_NAMES]; // RO Value 5 Name
812  DWORD dwDisVal5; // RW Value 5
813 
814  DWORD dwEnableDisVal6; // RO 1=Ask for Distance Value 6
815  unsigned char aDisVal6Name[LEN_DIST_VAR_NAMES]; // RO Value 6 Name
816  DWORD dwDisVal6; // RW Value 6
817 
818  DWORD dwEnableDisVal7; // RO 1=Ask for Distance Value 7
819  unsigned char aDisVal7Name[LEN_DIST_VAR_NAMES]; // RO Value 7 Name
820  DWORD dwDisVal7; // RW Value 7
821 
822  DWORD dwEnableDisVal8; // RO 1=Ask for Distance Value 8
823  unsigned char aDisVal8Name[LEN_DIST_VAR_NAMES]; // RO Value 8 Name
824  DWORD dwDisVal8; // RW Value 8
825  } FT_DISTANCE;
826 
827 
828 
829  typedef union _FT_SETTING
830  {
831  struct // RO = Read Only, RW = Read / Write
832  {
833  DWORD dwIfTyp; // RO Type of connected Device
834  // possible Values:
835  // NO_FT_DEVICE no answer from the Device - is it gone ?
836  // FT_INTELLIGENT_IF FT-Intelligent Interface connect (serial)
837  // FT_ROBO_IF_IIM FT-Robo Interface with Intelligent-Interface-Modus connect (serial)
838  // FT_ROBO_IF_USB FT-Robo Interface connect with USB-Port
839  // FT_ROBO_IF_COM FT-Robo Interface connect with COM- (serial-) Port
840  // FT_ROBO_IO_EXTENSION FT-Robo I/O-Extension
841  // FT_ROBO_RF_DATA_LINK FT-Robo RF Data Link
842  // FT_ROBO_IF_OVER_RF FT-Robo Interface connect over RF-Data-Link
843 
844  // Serial numbers section
845  DWORD dwSn; // RO actually Serial Number at Power On
846  DWORD dwSn1; // RW Serial Number-1 (only FT-Robo Products)
847  DWORD dwSn2; // RO Serial Number-2 (only FT-Robo Products)
848  DWORD dwSnAktiv; // RW Set Serial Number Activ (1/2) for next Power On
849 
850  DWORD dwFw; // RO Is Firmware Version for this product (only FT-Robo Products)
851 
852  unsigned char aSnStrg[LEN_STRG1]; // RO String with Serialnumber (only FT-Robo Products)
853  unsigned char aSn1Strg[LEN_STRG1]; // RO String with Serialnumber1 (only FT-Robo Products)
854  unsigned char aSn2Strg[LEN_STRG1]; // RO String with Serialnumber2 (only FT-Robo Products)
855  unsigned char aFwStrg[LEN_STRG1]; // RO String with Firmware (only FT-Robo Products)
856  unsigned char aSNaStrg[LEN_STRG2]; // RO String with Short-Name (only FT-Robo Products)
857  unsigned char aLNaStrg[LEN_STRG2]; // RO String with Long-Name (only FT-Robo Products)
858 
859  DWORD dwFwRoboIfVerAtLibIsMade; // RO Robo-If Firmware Version as this Lib is made
860  DWORD dwFwIoExtVerAtLibIsMade; // RO IO-Extension Firmware Version as this Lib is made
861  DWORD dwFwRfDataVerAtLibIsMade; // RO RF-DataLink Firmware Version as this Lib is made
862  unsigned char aFwRoboIfVerAtLibIsMadeStrg[LEN_STRG1]; // RO String with Robo-If Firmware Version as this Lib is made
863  unsigned char aFwIoExtVerAtLibIsMadeStrg[LEN_STRG1]; // RO String with IO-Extension Firmware Version as this Lib is made
864  unsigned char aFwRfDataVerAtLibIsMadeStrg[LEN_STRG1]; // RO String with Rf-Data-Link Firmware Version as this Lib is made
865 
866  DWORD dwReserved; // Reserved for later use
867 
868 
869  // Output Section
870  DWORD dwOutputAutoOff[4]; // RW M1=[0]...M4=[3] Energy saver:
871  // "1" = "Power Off" motor driver when both outputs logical "0" (reduces Energy)
872  // "0" = do not automatically disable the motor driver
873  DWORD dwOutputPwmType; // RW PWM-Type (Today only "0" supported)
874 
875 
876  // Robo Interface Distance Sensor
877  DWORD dwAnzDistanceModes; // RO Number of supported Distance Modes (Array Entries)
878  DWORD dwDistanceMode; // RW Type and Mode for Distance-Sensor (Index-Number in the range 0...ANZ_DISTANCE_TYPES)
879  FT_DISTANCE sDistance[ANZ_DISTANCE_TYPES]; // RW Values for setting
880 
881 
882  // Robo Interface Memory Section
883  DWORD dwProg[3]; // RO 1=Program is saved in the Memory block; [0]=Flash-1 [1]=Flash-2 [2]=Ram
884  unsigned char aProgNames[3][NAME_LEN]; // RO [0]=Flash-1 Prog Name; [1]=Flash-2 Prog Name; [2]=Ram Prog-Name
885  DWORD dwF1AutoStart; // RO 1=Autostart Flash-1 programm, 0=no autostart
886 
887 
888  // Robo Interface Module Section
889  DWORD dwMod1Typ; // RO Type of left Module (only Robo-If)
890  DWORD dwMod2Typ; // RO Type of right Module (only Robo-If)
891  // possible Values:
892  // MODULE_NOT_INSTALLED No Module is installed
893  // MODULE_RF1 RF Data Link is installed
894 
895  unsigned char aMod1Strg[LEN_STRG1]; // RO String with Module-1 Name (only FT-Robo Products)
896  unsigned char aMod2Strg[LEN_STRG1]; // RO String with Module-2 Name (only FT-Robo Products)
897 
898 
899  // Robo Interface & RF Data Link Section
900  DWORD dwRfOn; // RW 0=disable RF 1=Enable RF
901  DWORD dwRfChannel; // RW Channel-Number (2..80) for RF-Communication
902  DWORD dwRfSubChannel; // RW Sub-Channel of Device for the specified Channel (1..3)
903  DWORD dwRfMessage; // RW 0=Disable Message-Router Function 1=Enable Message-Rounter Function
904  DWORD dwRfWrite; // W 0=write values permanent (FLASH); 1=write values temporary (RAM)
905  DWORD dwRfFw; // RO Firmwareversion of RF-Module
906  unsigned char aRfFwStrg[LEN_STRG1]; // RO String with Firmware of RF-Module
907 
908  // Information for the PC-RF Module
909  DWORD dwRfStopTransferOnError; // RW 1=Stop the RF-Transfer Thread on bad RF Connection
910 
911  // Information for the Interface RF-Module
912  DWORD dwRfMotorOffOnError; // RW 1=Motor Off on bad RF Connection
913  } sIf;
914  } FT_SETTING;
915 
916 
917  // ****** Function Prototypes ******
918  DWORD __stdcall GetLibVersion(void);
919  DWORD __stdcall InitFtLib(void);
920  DWORD __stdcall CloseFtLib(void);
921  DWORD __stdcall IsFtLibInit(void);
922  DWORD __stdcall InitFtUsbDeviceList(void);
923  UINT __stdcall GetNumFtUsbDevice(void);
924  FT_HANDLE __stdcall GetFtUsbDeviceHandle(UCHAR ucDevNr);
925  FT_HANDLE __stdcall GetFtUsbDeviceHandleSerialNr(DWORD dwSN, DWORD dwTyp);
926  DWORD __stdcall OpenFtUsbDevice(FT_HANDLE hFt);
927  //FT_HANDLE __stdcall OpenFtCommDevice(DWORD dwPort, DWORD dwTyp, DWORD dwZyklus, DWORD *pdwError);
928  DWORD __stdcall SetFtDeviceCommMode (FT_HANDLE hFt, DWORD dwMode, DWORD dwParameter, USHORT *puiValue);
929  DWORD __stdcall CloseAllFtDevices(void);
930  DWORD __stdcall CloseFtDevice(FT_HANDLE hFt);
931  DWORD __stdcall GetFtDeviceTyp(FT_HANDLE hFt);
932  LPCSTR __stdcall GetFtSerialNrStrg(FT_HANDLE hFt);
933  DWORD __stdcall GetFtSerialNr(FT_HANDLE hFt);
934  LPCSTR __stdcall GetFtFirmwareStrg(FT_HANDLE hFt);
935  DWORD __stdcall GetFtFirmware(FT_HANDLE hFt);
936  LPCSTR __stdcall GetFtManufacturerStrg(FT_HANDLE hFt);
937  LPCSTR __stdcall GetFtShortNameStrg(FT_HANDLE hFt);
938  LPCSTR __stdcall GetFtLongNameStrg(FT_HANDLE hFt);
939  LPCSTR __stdcall GetFtLibErrorString(DWORD dwErrorCode, DWORD dwTyp);
940  DWORD __stdcall GetFtDeviceSetting(FT_HANDLE hFt, FT_SETTING *pSet);
941  DWORD __stdcall SetFtDeviceSetting(FT_HANDLE hFt, FT_SETTING *pSet);
942  DWORD __stdcall SetFtDistanceSensorMode(FT_HANDLE hFt, DWORD dwMode, DWORD dwTol1, DWORD dwTol2,
943  DWORD dwSchwell1, DWORD dwSchwell2, DWORD dwRepeat1, DWORD dwRepeat2);
944 
945 
946  DWORD __stdcall StartFtTransferArea(FT_HANDLE hFt, NOTIFICATION_EVENTS* sNEvent );
947  DWORD __stdcall StartFtTransferAreaWithCommunication(FT_HANDLE hFt, NOTIFICATION_EVENTS* sNEvent );
948  DWORD __stdcall StopFtTransferArea(FT_HANDLE hFt);
950  DWORD __stdcall IsFtTransferActiv(FT_HANDLE hFt);
951  DWORD __stdcall ResetFtTransfer (FT_HANDLE hFt);
952 
953 
954  DWORD __stdcall GetFtMemoryLayout(FT_HANDLE hFt, BYTE * pbArray, DWORD dwSize);
955  DWORD __stdcall DownloadFtProgram(FT_HANDLE hFt, DWORD dwMemBlock, BYTE* pbArray, DWORD dwSize, DWORD dwParameter, BYTE *pbName, DWORD dwNameLen);
956  DWORD __stdcall StartFtProgram(FT_HANDLE hFt, DWORD dwMemBlock);
957  DWORD __stdcall StopFtProgram(FT_HANDLE hFt);
958  DWORD __stdcall DeleteFtProgram(FT_HANDLE hFt, DWORD dwMemBlock);
959  DWORD __stdcall SetFtProgramActiv(FT_HANDLE hFt, DWORD dwMemBlock);
960  DWORD __stdcall GetFtProgramName(FT_HANDLE hFt, DWORD dwMemBlock, DWORD dwSize, LPVOID pName);
961  DWORD __stdcall WriteFtMemoryData(FT_HANDLE hFt, DWORD dwData, DWORD dwAddress);
962  DWORD __stdcall GetFtMemoryData(FT_HANDLE hFt, BYTE * pbArray, DWORD dwSize, DWORD dwAddress);
963 
964 
965  DWORD __stdcall SendFtMessage(FT_HANDLE hFt, BYTE bHwId, BYTE bSubId, DWORD dwMessage, DWORD dwWaitTime, DWORD dwOption);
966  DWORD __stdcall ClearFtMessageBuffer(FT_HANDLE hFt);
967 
968 
969 
970 
971 //
972 // FTLIB Error Codes
973 //
974  #define FTLIB_ERR_SUCCESS 0x00000000L
975  #define FTLIB_ERR_CRC 0xE0000001L
976  #define FTLIB_ERR_BTSTUFF 0xE0000002L
977  #define FTLIB_ERR_DATA_TOGGLE_MISMATCH 0xE0000003L
978  #define FTLIB_ERR_STALL_PID 0xE0000004L
979  #define FTLIB_ERR_DEV_NOT_RESPONDING 0xE0000005L
980  #define FTLIB_ERR_PID_CHECK_FAILURE 0xE0000006L
981  #define FTLIB_ERR_UNEXPECTED_PID 0xE0000007L
982  #define FTLIB_ERR_DATA_OVERRUN 0xE0000008L
983  #define FTLIB_ERR_DATA_UNDERRUN 0xE0000009L
984  #define FTLIB_ERR_RESERVED1 0xE000000AL
985  #define FTLIB_ERR_RESERVED2 0xE000000BL
986  #define FTLIB_ERR_BUFFER_OVERRUN 0xE000000CL
987  #define FTLIB_ERR_BUFFER_UNDERRUN 0xE000000DL
988  #define FTLIB_ERR_NOT_ACCESSED 0xE000000FL
989  #define FTLIB_ERR_FIFO 0xE0000010L
990  #define FTLIB_ERR_XACT_ERROR 0xE0000011L
991  #define FTLIB_ERR_BABBLE_DETECTED 0xE0000012L
992  #define FTLIB_ERR_DATA_BUFFER_ERROR 0xE0000013L
993 
994  #define FTLIB_ERR_ENDPOINT_HALTED 0xE0000030L
995  #define FTLIB_ERR_NO_MEMORY 0xE0000100L
996  #define FTLIB_ERR_INVALID_URB_FUNCTION 0xE0000200L
997  #define FTLIB_ERR_INVALID_PARAMETER 0xE0000300L
998  #define FTLIB_ERR_ERROR_BUSY 0xE0000400L
999  #define FTLIB_ERR_INVALID_PIPE_HANDLE 0xE0000600L
1000  #define FTLIB_ERR_NO_BANDWIDTH 0xE0000700L
1001  #define FTLIB_ERR_INTERNAL_HC_ERROR 0xE0000800L
1002  #define FTLIB_ERR_ERROR_SHORT_TRANSFER 0xE0000900L
1003  #define FTLIB_ERR_BAD_START_FRAME 0xE0000A00L
1004  #define FTLIB_ERR_ISOCH_REQUEST_FAILED 0xE0000B00L
1005  #define FTLIB_ERR_FRAME_CONTROL_OWNED 0xE0000C00L
1006  #define FTLIB_ERR_FRAME_CONTROL_NOT_OWNED 0xE0000D00L
1007  #define FTLIB_ERR_NOT_SUPPORTED 0xE0000E00L
1008  #define FTLIB_ERR_INVALID_CONFIGURATION_DESCRIPTOR 0xE0000F00L
1009 
1010  #define FTLIB_ERR_INSUFFICIENT_RESOURCES 0xE8001000L
1011  #define FTLIB_ERR_SET_CONFIG_FAILED 0xE0002000L
1012  #define FTLIB_ERR_USBD_BUFFER_TOO_SMALL 0xE0003000L
1013  #define FTLIB_ERR_USBD_INTERFACE_NOT_FOUND 0xE0004000L
1014  #define FTLIB_ERR_INVALID_PIPE_FLAGS 0xE0005000L
1015  #define FTLIB_ERR_USBD_TIMEOUT 0xE0006000L
1016  #define FTLIB_ERR_DEVICE_GONE 0xE0007000L
1017  #define FTLIB_ERR_STATUS_NOT_MAPPED 0xE0008000L
1018 
1019  #define FTLIB_ERR_CANCELED 0xE0010000L
1020  #define FTLIB_ERR_ISO_NOT_ACCESSED_BY_HW 0xE0020000L
1021  #define FTLIB_ERR_ISO_TD_ERROR 0xE0030000L
1022  #define FTLIB_ERR_ISO_NA_LATE_USBPORT 0xE0040000L
1023  #define FTLIB_ERR_ISO_NOT_ACCESSED_LATE 0xE0050000L
1024 
1025  #define FTLIB_ERR_FAILED 0xE0001000L
1026  #define FTLIB_ERR_INVALID_INBUFFER 0xE0001001L
1027  #define FTLIB_ERR_INVALID_OUTBUFFER 0xE0001002L
1028  #define FTLIB_ERR_OUT_OF_MEMORY 0xE0001003L
1029  #define FTLIB_ERR_PENDING_REQUESTS 0xE0001004L
1030  #define FTLIB_ERR_ALREADY_CONFIGURED 0xE0001005L
1031  #define FTLIB_ERR_NOT_CONFIGURED 0xE0001006L
1032  #define FTLIB_ERR_OPEN_PIPES 0xE0001007L
1033  #define FTLIB_ERR_ALREADY_BOUND 0xE0001008L
1034  #define FTLIB_ERR_NOT_BOUND 0xE0001009L
1035  #define FTLIB_ERR_DEVICE_NOT_PRESENT 0xE000100AL
1036  #define FTLIB_ERR_CONTROL_NOT_SUPPORTED 0xE000100BL
1037  #define FTLIB_ERR_TIMEOUT 0xE000100CL
1038  #define FTLIB_ERR_INVALID_RECIPIENT 0xE000100DL
1039  #define FTLIB_ERR_INVALID_TYPE 0xE000100EL
1040  #define FTLIB_ERR_INVALID_IOCTL 0xE000100FL
1041  #define FTLIB_ERR_INVALID_DIRECTION 0xE0001010L
1042  #define FTLIB_ERR_TOO_MUCH_ISO_PACKETS 0xE0001011L
1043  #define FTLIB_ERR_POOL_EMPTY 0xE0001012L
1044  #define FTLIB_ERR_PIPE_NOT_FOUND 0xE0001013L
1045  #define FTLIB_ERR_INVALID_ISO_PACKET 0xE0001014L
1046  #define FTLIB_ERR_OUT_OF_ADDRESS_SPACE 0xE0001015L
1047  #define FTLIB_ERR_INTERFACE_NOT_FOUND 0xE0001016L
1048  #define FTLIB_ERR_INVALID_DEVICE_STATE 0xE0001017L
1049  #define FTLIB_ERR_INVALID_PARAM 0xE0001018L
1050  #define FTLIB_ERR_INVALID_POWER_STATE 0xE000101AL
1051  #define FTLIB_ERR_POWER_DOWN 0xE000101BL
1052  #define FTLIB_ERR_VERSION_MISMATCH 0xE000101CL
1053  #define FTLIB_ERR_SET_CONFIGURATION_FAILED 0xE000101DL
1054 
1055  #define FTLIB_ERR_VID_RESTRICTION 0xE0001080L
1056  #define FTLIB_ERR_ISO_RESTRICTION 0xE0001081L
1057  #define FTLIB_ERR_BULK_RESTRICTION 0xE0001082L
1058  #define FTLIB_ERR_EP0_RESTRICTION 0xE0001083L
1059  #define FTLIB_ERR_PIPE_RESTRICTION 0xE0001084L
1060  #define FTLIB_ERR_PIPE_SIZE_RESTRICTION 0xE0001085L
1061  #define FTLIB_ERR_CONTROL_RESTRICTION 0xE0001086L
1062  #define FTLIB_ERR_INTERRUPT_RESTRICTION 0xE0001087L
1063 
1064  #define FTLIB_ERR_DEVICE_NOT_FOUND 0xE0001100L
1065  #define FTLIB_ERR_SOME_DEVICES_ARE_OPEN 0xE0001101L
1066  #define FTLIB_ERR_DEVICE_IS_OPEN 0xE0001102L
1067  #define FTLIB_ERR_DEVICE_NOT_OPEN 0xE0001103L
1068  #define FTLIB_ERR_NO_SUCH_DEVICE_INSTANCE 0xE0001104L
1069  #define FTLIB_ERR_INVALID_FUNCTION_PARAM 0xE0001105L
1070  #define FTLIB_ERR_DESTROY_DEVICE_LIST 0xE0001106L
1071  #define FTLIB_ERR_USB_NOT_SUPPORTET_FROM_OS 0xE0001107L
1072  #define FTLIB_ERR_CLOSE_DEVICE 0xE0001108L
1073 
1074  #define FTLIB_ERR_DEVICE_NOT_SUPPORTET 0xE0001281L
1075  #define FTLIB_ERR_WRONG_DEVICE_NUMBER 0xE0001282L
1076  #define FTLIB_ERR_UNKNOWN_DEVICE_HANDLE 0xE0001283L
1077  #define FTLIB_ERR_WRONG_USB_HANDLE 0xE0001284L
1078  #define FTLIB_ERR_WRONG_PATHNAME 0xE0001285L
1079  #define FTLIB_ERR_LIB_IS_INITIALIZED 0xE0001286L
1080  #define FTLIB_ERR_LIB_IS_NOT_INITIALIZED 0xE0001287L
1081  #define FTLIB_ERR_SERIAL_NR_UNKNOWN 0xE0001288L
1082  #define FTLIB_ERR_POWER_TOO_LOW 0xE0001289L
1083  #define FTLIB_ERR_WRONG_RETURN_VALUE 0xE000128AL
1084  #define FTLIB_ERR_USB_SUPPORT_IS_NOT_INITIALIZED 0xE000128BL
1085 
1086  #define FTLIB_ERR_USB_MUT0 0xE0001290L
1087  #define FTLIB_ERR_USB_MUT1 0xE0001291L
1088  #define FTLIB_ERR_USB_MUT2 0xE0001292L
1089  #define FTLIB_ERR_USB_MUT3 0xE0001293L
1090  #define FTLIB_ERR_USB_DEVICE_IS_IN_USE 0xE0001295L
1091 
1092  #define FTLIB_ERR_THREAD_NOT_STARTABLE 0xE00012A0L
1093  #define FTLIB_ERR_THREAD_NOT_STARTABLE_X1 0xE00012A1L
1094  #define FTLIB_ERR_THREAD_NOT_STARTABLE_X2 0xE00012A2L
1095  #define FTLIB_ERR_THREAD_NOT_STARTABLE_X3 0xE00012A3L
1096  #define FTLIB_ERR_OTHER_THREAD_FOR_SAME_DEVICE_IS_RUN 0xE00012A4L
1097  #define FTLIB_ERR_THREAD_IS_RUNNING 0xE00012A5L
1098  #define FTLIB_ERR_THREAD_NOT_RUNNING 0xE00012A6L
1099  #define FTLIB_ERR_THREAD_X1 0xE00012A7L
1100  #define FTLIB_ERR_THREAD_X2 0xE00012A8L
1101  #define FTLIB_ERR_THREAD_WRITE_USB 0xE00012A9L
1102  #define FTLIB_ERR_THREAD_READ_USB 0xE00012AAL
1103  #define FTLIB_ERR_THREAD_IS_NORMAL_STOPPED 0xE00012ABL
1104  #define FTLIB_ERR_THREAD_WAIT_TIMEOUT 0xE00012ACL
1105  #define FTLIB_ERR_THREAD_WRITE_COM 0xE00012ADL
1106  #define FTLIB_ERR_THREAD_READ_COM 0xE00012AEL
1107 
1108  #define FTLIB_ERR_DOWNLOAD 0xE00012C0L
1109  #define FTLIB_ERR_DOWNLOAD_WRONG_PARAMETER 0xE00012C1L
1110  #define FTLIB_ERR_DOWNLOAD_WRONG_MEM_BLOCK 0xE00012C2L
1111  #define FTLIB_ERR_DOWNLOAD_DATA_SIZE_IS_NULL 0xE00012C3L
1112  #define FTLIB_ERR_DOWNLOAD_DATA_SIZE_TOO_BIG 0xE00012C4L
1113  #define FTLIB_ERR_DOWNLOAD_DATA_SIZE 0xE00012C5L
1114  #define FTLIB_ERR_DOWNLOAD_ERASE 0xE00012C6L
1115  #define FTLIB_ERR_DOWNLOAD_F5 0xE00012C7L
1116  #define FTLIB_ERR_DOWNLOAD_PROG_SNF1 0xE00012C8L
1117  #define FTLIB_ERR_DOWNLOAD_PROG_SNF2 0xE00012C9L
1118  #define FTLIB_ERR_DOWNLOAD_BLOCK 0xE00012CAL
1119  #define FTLIB_ERR_DOWNLOAD_BLOCK_NR 0xE00012CBL
1120  #define FTLIB_ERR_DOWNLOAD_CRC 0xE00012CDL
1121 
1122  #define FTLIB_ERR_IF_NO_PROGRAM 0xE00012E0L
1123  #define FTLIB_ERR_IF_PROGRAM_IS_RUNNING 0xE00012E1L
1124  #define FTLIB_ERR_IF_NO_PROGRAM_IS_RUNNING 0xE00012E2L
1125  #define FTLIB_ERR_IF_WRONG_PROG_NUMBER 0xE00012E3L
1126  #define FTLIB_ERR_IF_BUFFER_TOO_SMALL 0xE00012E4L
1127  #define FTLIB_ERR_IF_MEM_ADDRESS 0xE00012E5L
1128  #define FTLIB_ERR_IF_MEM_VERIFY 0xE00012E6L
1129  #define FTLIB_ERR_IF_NOT_SUPPORTET_MODUS 0xE00012E7L
1130  #define FTLIB_ERR_IF_FUNCTION_NOT_SUPPORT 0xE00012E8L
1131  #define FTLIB_ERR_FUNCTION_OVER_RF_NOT_ALLOWED 0xE00012E9L
1132 
1133 
1134  #define FTLIB_INFO_PROGRAM_0_IS_RUNNING 0xE0001600L
1135  #define FTLIB_INFO_PROGRAM_1_IS_RUNNING 0xE0001601L
1136  #define FTLIB_INFO_PROGRAM_2_IS_RUNNING 0xE0001602L
1137  #define FTLIB_INFO_ONLINE_MODUS 0xE0001620L
1138 
1139  #define FTLIB_FIRMWARE_UPDATE_FILE_WRONG_0 0xE0001800L
1140  #define FTLIB_FIRMWARE_UPDATE_CRC 0xE0001801L
1141  #define FTLIB_FIRMWARE_UPDATE_FILE_OLD 0xE0001802L
1142  #define FTLIB_FIRMWARE_UPDATE_FILE_WRONG_1 0xE0001803L
1143 
1144 
1145  #define FTLIB_ERR_PORT_NUMBER 0xE0001900L
1146  #define FTLIB_ERR_WRONG_PORT 0xE0001901L
1147  #define FTLIB_ERR_PORT_NUMBER_IS_NULL 0xE0001902L
1148  #define FTLIB_ERR_TYP 0xE0001903L
1149  #define FTLIB_ERR_PORT_NOT_FOUND 0xE0001904L
1150  #define FTLIB_ERR_ACCESS_DENIED 0xE0001905L
1151  #define FTLIB_ERR_OPEN_COM 0xE0001906L
1152  #define FTLIB_ERR_CLOSE_COM 0xE0001907L
1153  #define FTLIB_ERR_INIT_COM 0xE0001908L
1154  #define FTLIB_ERR_INIT_COM_TIMEOUT 0xE0001909L
1155  #define FTLIB_ERR_WRITE_COM 0xE000190AL
1156  #define FTLIB_ERR_READ_COM 0xE000190BL
1157  #define FTLIB_ERR_READ_COM_NUMBER 0xE000190CL
1158  #define FTLIB_ERR_READ_COM_NOTHING 0xE000190DL
1159 
1160  #define FTLIB_ERR_RF_NOT_INSTALLED 0xE0001A00L
1161  #define FTLIB_ERR_RF_WRONG_CHANNEL 0xE0001A01L
1162  #define FTLIB_ERR_RF_WRONG_SUB_CHANNEL 0xE0001A02L
1163  #define FTLIB_ERR_RF_NO_CONNECTION 0xE0001A03L
1164  #define FTLIB_ERR_RF_NO_CONNECTION_A 0xE0001A04L
1165  #define FTLIB_ERR_RF_NO_CONNECTION_B 0xE0001A05L
1166  #define FTLIB_ERR_RF_NO_CONNECTION_C 0xE0001A06L
1167  #define FTLIB_ERR_RF_TIMEOUT_1 0xE0001A08L
1168  #define FTLIB_ERR_RF_TIMEOUT_2 0xE0001A09L
1169  #define FTLIB_ERR_RF_FW_OLD1 0xE0001A0AL
1170  #define FTLIB_ERR_RF_INTERNAL_1 0xE0001A0DL
1171  #define FTLIB_ERR_RF_NO_INTERFACE_MODULE_FOUND 0xE0001A0EL
1172 
1173  #define FTLIB_ERR_DLL_NOT_LOADABLE 0xE0001B00L
1174  #define FTLIB_ERR_DLL_FUNCTION_ERROR 0xE0001B01L
1175 
1176  #define FTLIB_ERR_MSG_HWID_WRONG 0xE0001C00L
1177  #define FTLIB_ERR_MSG_BUFFER_FULL_TIMEOUT 0xE0001C01L
1178 
1179  #define FTLIB_ERR_UNKNOWN_OPTION_VALUE 0xE0001D00L
1180 
1181  #define FTLIB_ERR_INTERFACE_00 0xE0001F00L
1182  #define FTLIB_ERR_INTERFACE_01 0xE0001F01L
1183  #define FTLIB_ERR_INTERFACE_02 0xE0001F02L
1184  #define FTLIB_ERR_INTERFACE_03 0xE0001F03L
1185  #define FTLIB_ERR_INTERFACE_04 0xE0001F04L
1186  #define FTLIB_ERR_INTERFACE_05 0xE0001F05L
1187  #define FTLIB_ERR_INTERFACE_06 0xE0001F06L
1188  #define FTLIB_ERR_INTERFACE_07 0xE0001F07L
1189  #define FTLIB_ERR_INTERFACE_08 0xE0001F08L
1190  #define FTLIB_ERR_INTERFACE_09 0xE0001F09L
1191  #define FTLIB_ERR_INTERFACE_0A 0xE0001F0AL
1192  #define FTLIB_ERR_INTERFACE_0B 0xE0001F0BL
1193  #define FTLIB_ERR_INTERFACE_0C 0xE0001F0CL
1194  #define FTLIB_ERR_INTERFACE_0D 0xE0001F0DL
1195  #define FTLIB_ERR_INTERFACE_0E 0xE0001F0EL
1196  #define FTLIB_ERR_INTERFACE_0F 0xE0001F0FL
1197 
1198  #define FTLIB_ERR_INTERFACE_D0 0xE0001FD0L
1199  #define FTLIB_ERR_INTERFACE_D1 0xE0001FD1L
1200  #define FTLIB_ERR_INTERFACE_D2 0xE0001FD2L
1201  #define FTLIB_ERR_INTERFACE_D3 0xE0001FD3L
1202  #define FTLIB_ERR_INTERFACE_D4 0xE0001FD4L
1203  #define FTLIB_ERR_INTERFACE_D5 0xE0001FD5L
1204  #define FTLIB_ERR_INTERFACE_D6 0xE0001FD6L
1205  #define FTLIB_ERR_INTERFACE_D7 0xE0001FD7L
1206  #define FTLIB_ERR_INTERFACE_D8 0xE0001FD8L
1207  #define FTLIB_ERR_INTERFACE_D9 0xE0001FD9L
1208  #define FTLIB_ERR_INTERFACE_DA 0xE0001FDAL
1209  #define FTLIB_ERR_INTERFACE_DB 0xE0001FDBL
1210  #define FTLIB_ERR_INTERFACE_DC 0xE0001FDCL
1211  #define FTLIB_ERR_INTERFACE_DD 0xE0001FDDL
1212  #define FTLIB_ERR_INTERFACE_DE 0xE0001FDEL
1213  #define FTLIB_ERR_INTERFACE_DF 0xE0001FDFL
1214 
1215  #define FTLIB_ERR_INTERFACE_E0 0xE0001FE0L
1216  #define FTLIB_ERR_INTERFACE_E1 0xE0001FE1L
1217  #define FTLIB_ERR_INTERFACE_E2 0xE0001FE2L
1218  #define FTLIB_ERR_INTERFACE_E3 0xE0001FE3L
1219  #define FTLIB_ERR_INTERFACE_E4 0xE0001FE4L
1220  #define FTLIB_ERR_INTERFACE_E5 0xE0001FE5L
1221  #define FTLIB_ERR_INTERFACE_E6 0xE0001FE6L
1222  #define FTLIB_ERR_INTERFACE_E7 0xE0001FE7L
1223  #define FTLIB_ERR_INTERFACE_E8 0xE0001FE8L
1224  #define FTLIB_ERR_INTERFACE_E9 0xE0001FE9L
1225  #define FTLIB_ERR_INTERFACE_EA 0xE0001FEAL
1226  #define FTLIB_ERR_INTERFACE_EB 0xE0001FEBL
1227  #define FTLIB_ERR_INTERFACE_EC 0xE0001FECL
1228  #define FTLIB_ERR_INTERFACE_ED 0xE0001FEDL
1229  #define FTLIB_ERR_INTERFACE_EE 0xE0001FEEL
1230  #define FTLIB_ERR_INTERFACE_EF 0xE0001FEFL
1231 
1232  #define FTLIB_ERR_INTERFACE_F0 0xE0001FF0L
1233  #define FTLIB_ERR_INTERFACE_F1 0xE0001FF1L
1234  #define FTLIB_ERR_INTERFACE_F2 0xE0001FF2L
1235  #define FTLIB_ERR_INTERFACE_F3 0xE0001FF3L
1236  #define FTLIB_ERR_INTERFACE_F4 0xE0001FF4L
1237  #define FTLIB_ERR_INTERFACE_F5 0xE0001FF5L
1238  #define FTLIB_ERR_INTERFACE_F6 0xE0001FF6L
1239  #define FTLIB_ERR_INTERFACE_F7 0xE0001FF7L
1240  #define FTLIB_ERR_INTERFACE_F8 0xE0001FF8L
1241  #define FTLIB_ERR_INTERFACE_F9 0xE0001FF9L
1242  #define FTLIB_ERR_INTERFACE_FA 0xE0001FFAL
1243  #define FTLIB_ERR_INTERFACE_FB 0xE0001FFBL
1244  #define FTLIB_ERR_INTERFACE_FC 0xE0001FFCL
1245  #define FTLIB_ERR_INTERFACE_FD 0xE0001FFDL
1246  #define FTLIB_ERR_INTERFACE_FE 0xE0001FFEL
1247  #define FTLIB_ERR_INTERFACE_FF 0xE0001FFFL
1248 
1251 #ifdef __cplusplus
1252 }
1253 #endif
1254 
1255 #endif
1256 
1257 
1258 
long int DownloadFtProgram(FT_HANDLE hFt, long int dwMemBlock, unsigned char *pbArray, long int dwSize, long int dwParameter, unsigned char *pbName, long int dwNameLen)
Upload a program to the interface.
Definition: libroboint.c:1308
long int CloseAllFtDevices()
Close all ft devices.
Definition: libroboint.c:1895
char IsFtInterfaceConnected(FT_HANDLE hFt)
Tells if we successfuly got a connection to the Interface.
Definition: libroboint.c:2270
long int StartFtTransferArea(FT_HANDLE hFt, NOTIFICATION_EVENTS *ignored)
Starts the communication thread.
Definition: libroboint.c:1188
long int GetFtDeviceTyp(FT_HANDLE hFt)
Returns type of the interface.
Definition: libroboint.c:668
long int InitFtLib()
Library initialization (dummy)
Definition: libroboint.c:308
char * GetFtLibErrorString(long int dwErrorCode, long int dwTyp)
Gets the description of an error.
Definition: libroboint.c:2288
long int StopFtTransferArea(FT_HANDLE hFt)
Stops the communication thread.
Definition: libroboint.c:1256
char * GetFtLongNameStrg(FT_HANDLE hFt)
Gets the long name of the Interface.
Definition: libroboint.c:2244
long int ResetFtTransfer(FT_HANDLE hFt)
reset outputs
Definition: libroboint.c:1163
long int GetRFMode(FT_HANDLE hFt, long int *frequency, long int *callSign)
Gets the frequency and call sign of a Robo Interface or RF Data Link.
Definition: libroboint.c:2050
long int CloseFtLib()
Library deinitialization (dummy)
Definition: libroboint.c:835
long int GetFtDeviceTypeString(FT_HANDLE hFt, char *dest, int len)
Returns a string that identifies the interface with human words.
Definition: libroboint.c:689
long int SetRealSerial(FT_HANDLE hFt, unsigned char bOn)
Switches between the real serial and 0001 of a device.
Definition: libroboint.c:2098
FT_TRANSFER_AREA * GetFtTransferAreaAddress(FT_HANDLE hFt)
Get the transfer area.
Definition: libroboint.c:1236
long int GetFtProgramName(FT_HANDLE hFt, long int dwMemBlock, long int dwSize, void *pName)
Get the name of a program.
Definition: libroboint.c:1603
long int CloseFtDevice(FT_HANDLE hFt)
Close the ft Device.
Definition: libroboint.c:783
unsigned int GetNumFtUsbDevice()
Get the count of found ft Interfaces over USB.
Definition: libroboint.c:414
long int SetFtDistanceSensorMode(FT_HANDLE hFt, long int dwMode, long int dwTol1, long int dwTol2, long int dwLevel1, long int dwLevel2, long int dwRepeat1, long int dwRepeat2)
Set the inputs D1 and D2 to distance oder voltage measuring.
Definition: libroboint.c:1923
long int IsFtLibInit()
Check for Library initialization (dummy)
Definition: libroboint.c:847
long int SetRFMode(FT_HANDLE hFt, long int frequency, long int callSign)
Sets the frequency and call sign for a Robo Interface or RF Data Link.
Definition: libroboint.c:1992
char * GetFtShortNameStrg(FT_HANDLE hFt)
Gets the short name of the Interface.
Definition: libroboint.c:2215
FT_HANDLE GetFtUsbDeviceHandle(unsigned char Num)
Gets the handle to a ft USB device.
Definition: libroboint.c:502
long int StartFtProgram(FT_HANDLE hFt, long int dwMemBlock)
Start a program.
Definition: libroboint.c:1426
char * GetFtFirmwareStrg(FT_HANDLE hFt)
Get the firmware number of this interface.
Definition: libroboint.c:1763
int GetFtStatus(FT_HANDLE hFt, int *num)
Checks if a program is running.
Definition: libroboint.c:1649
long int StopFtProgram(FT_HANDLE hFt)
Stop a program.
Definition: libroboint.c:1469
char * GetFtSerialNrStrg(FT_HANDLE hFt)
Get the serial number of this interface.
Definition: libroboint.c:1868
long int GetFtSerialNr(FT_HANDLE hFt)
Get the serial number of this interface.
Definition: libroboint.c:1785
char * GetFtManufacturerStrg(FT_HANDLE hFt)
Gets the Manufacturer of the Interface.
Definition: libroboint.c:2186
char * GetLibVersionStrg()
Returns lib version.
Definition: libroboint.c:288
long int GetFtFirmware(FT_HANDLE hFt)
Get the firmware number of this interface.
Definition: libroboint.c:1694
long int OpenFtUsbDevice(FT_HANDLE hFt)
Opens this USB device.
Definition: libroboint.c:757
FT_HANDLE OpenFtCommDevice(char *sDevice, long int dwTyp, long int dwZyklus)
Gets the handle to a ft serial device.
Definition: libroboint.c:605
long int StartFtTransferAreaWithCommunication(FT_HANDLE hFt, NOTIFICATION_EVENTS *ignored)
Starts the communication thread.
Definition: libroboint.c:1223
long int InitFtUsbDeviceList()
Initiates and scans the USB bus.
Definition: libroboint.c:322
long int GetLibVersion()
Returns lib version.
Definition: libroboint.c:274
long int IsFtTransferActiv(FT_HANDLE hFt)
check if transfer is active.
Definition: libroboint.c:1282
long int DeleteFtProgram(FT_HANDLE hFt, long int dwMemBlock)
Delete a program.
Definition: libroboint.c:1513
long int SetFtProgramActiv(FT_HANDLE hFt, long int dwMemBlock)
Activate a program.
Definition: libroboint.c:1557
FT_HANDLE GetFtUsbDeviceHandleSerialNr(long int dwSN, long int dwTyp)
Gets the handle to a ft USB device with a specific serial number.
Definition: libroboint.c:571
struct _FT_TRANSFER_AREA FT_TRANSFER_AREA
Communication Area for ft-Device.
struct ft_handle_devices * FT_HANDLE
Handle for the ft Interface.
Communication Area for ft-Device.
Definition: roboint.h:42
unsigned char MES_Sub1
Outputs of extension module 1 ( energy saver mode )
Definition: roboint.h:232
unsigned char MPWM_Sub1[8]
Outputs of slave module 1 (PWM values, range =0..7)
Definition: roboint.h:278
unsigned short RfPower
Signal Power of the RF Signal entering the RF input (only Onlinemodus, 7 bit, 0..127)
Definition: roboint.h:542
unsigned short A1S1
Analoginput of slave module 1 (Update-Time: 20ms)
Definition: roboint.h:312
unsigned char rsvd15[10]
Reserved Base+0x166..0x16F.
Definition: roboint.h:492
unsigned short A1S2
Analoginput of slave module 2 (Update-Time: 20ms)
Definition: roboint.h:316
unsigned short AXS2_R
Base+0xA6..0xA7: AX (Slave 2 Modul) Resistor-Value (0..5662 Ohm)
Definition: roboint.h:350
unsigned char rsvd4[1]
Reserved Base+0x3F.
Definition: roboint.h:201
unsigned char reserved_l2
Reserved Base+0x4E:
Definition: roboint.h:251
unsigned char E_Sub1
Digital Inputs Extension Modules 1 Base+0x01: | E16| E15| E14| E13| E12| E11| E10| E9 |.
Definition: roboint.h:49
unsigned short AX
Analoginput of main module.
Definition: roboint.h:100
unsigned char rsvd5[4]
Reserved Base+0x44..0x47.
Definition: roboint.h:222
unsigned short D2
Analoginput of main module.
Definition: roboint.h:135
unsigned short Timer100ms
16-Bit Timer
Definition: roboint.h:178
unsigned char rsvd14[12]
Reserved Base+0x144..0x14F.
Definition: roboint.h:474
unsigned short RfModulNr
Number of Interface-RF-Modul if installed or "-1" if not installed.
Definition: roboint.h:557
unsigned char rsvd1[8]
Reserved Base+0x04..0x0B.
Definition: roboint.h:59
unsigned short A2
Analoginput of main module.
Definition: roboint.h:115
unsigned char rsvd12[7]
Reserved Base+0xE9..0xEF.
Definition: roboint.h:393
unsigned char TransferAktiv
Base+0xE2.
Definition: roboint.h:371
unsigned char IRKeys
IR-Receiver input code.
Definition: roboint.h:91
unsigned short Timer1ms
16-Bit Timer
Definition: roboint.h:170
unsigned short MsgNumInBuffer
Number of Messages inside the Buffer.
Definition: roboint.h:552
unsigned char MPWM_Sub2[8]
Outputs of slave module 2 (PWM values, range =0..7)
Definition: roboint.h:290
unsigned char M_Sub1
Outputs of extension module 1.
Definition: roboint.h:210
unsigned char M_Sub2
Outputs of extension module 2.
Definition: roboint.h:214
unsigned short Timer1min
16-Bit Timer
Definition: roboint.h:190
unsigned short DS2
Detection limit for distance sensor 2 ( to generate digital from analog input )
Definition: roboint.h:157
unsigned short AXS1_R
Base+0xA4..0xA5: AX (Slave 1 Modul) Resistor-Value (0..5662 Ohm)
Definition: roboint.h:347
unsigned short AXS1
Analoginput of slave module 1.
Definition: roboint.h:140
unsigned char rsvd17[10]
Reserved.
Definition: roboint.h:532
unsigned short ZE
Reserved Base+0x2A..0x2B.
Definition: roboint.h:161
unsigned short AV
Analoginput of main module.
Definition: roboint.h:125
unsigned char M_Main
Outputs of the main module ( polarity )
Definition: roboint.h:206
unsigned char MPWM_Main[8]
Outputs of the main module (PWM values, range =0..7)
Definition: roboint.h:266
unsigned short IRKeys16[11]
IR-Keys as 16 bit values (independent of code)
Definition: roboint.h:489
unsigned char rsvd7[32]
Reserved Base+0x70..0x8F.
Definition: roboint.h:306
unsigned short Timer10ms
16-Bit Timer
Definition: roboint.h:174
unsigned short AX_R
Reserved Base+0xA0..0xA1: AX (Interface) Resistor-Value (0..5662 Ohm)
Definition: roboint.h:341
unsigned char E_Sub2
Digital Inputs Extension Modules 2 Base+0x02: | E24| E23| E22| E21| E20| E19| E18| E17|.
Definition: roboint.h:52
unsigned char MES_Sub3
Outputs of extension module 3 ( energy saver mode )
Definition: roboint.h:240
unsigned char rsvd13[13]
Reserved Base+0xF3..0xFF.
Definition: roboint.h:419
unsigned short IRKeys16Code1[11]
IR-Keys as 16 bit values (code 1)
Definition: roboint.h:507
unsigned char ChangeEg
Change Bytes.
Definition: roboint.h:401
unsigned short AZ
Analoginput of main module.
Definition: roboint.h:120
unsigned char MPWM_Update
Output PWM update (0x01=always, 0x02=once) Base+0xE1: | 0 | 0 | 0 | 0 | 0 | 0 |ONCE|ALWA|.
Definition: roboint.h:365
unsigned short E16_Sub2[8]
Digital inputs as 16 bit values.
Definition: roboint.h:454
unsigned char res_bT
Reserved Base+0x3E.
Definition: roboint.h:197
unsigned char ChangeAn
1 = Analog Inputs (Master AX, AY, A1, A2, AV, AZ or Extension 1..3 AX,AY,AV)
Definition: roboint.h:408
unsigned short E16_Sub3[8]
Digital inputs as 16 bit values.
Definition: roboint.h:465
unsigned short AXS3
Analoginput of slave module 1.
Definition: roboint.h:148
unsigned char rsvd10[54]
Reserved Base+0xAA..0xDF.
Definition: roboint.h:357
unsigned short AXS2
Analoginput of slave module 1.
Definition: roboint.h:144
DWORD dwTC
Reserved for Internal Use Base+0x1BC..0x1BF.
Definition: roboint.h:565
unsigned char SlotModule2
Slot 2 connected extension module type Base+0xE8: ?
Definition: roboint.h:389
unsigned char res_1
Base+0x0F: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |.
Definition: roboint.h:94
unsigned char ChangeIr
1 = Infrared Input (Robo-IF) or RfStatus have changed
Definition: roboint.h:414
unsigned short AXS3_R
Base+0xA8..0xA9: AX (Slave 3 Modul) Resistor-Value (0..5662 Ohm)
Definition: roboint.h:353
unsigned short res_bF
Reserved Base+0x3C..0x3D.
Definition: roboint.h:194
unsigned char reserved_l1
Reserved Base+0x4D:
Definition: roboint.h:248
unsigned char E_Sub3
Digital Inputs Extension Modules 3 Base+0x03: | E32| E31| E30| E29| E28| E27| E26| E25|.
Definition: roboint.h:55
unsigned char rsvd8[4]
Reserved Base+0x9C..0x9F.
Definition: roboint.h:337
unsigned short AY
Analoginput of main module.
Definition: roboint.h:105
unsigned short RfError
Rf-Error Count (0..250)
Definition: roboint.h:547
unsigned char Mode
Operation mode Base+0xE0: 0x00=online, 0x01=binary download.
Definition: roboint.h:361
unsigned short D1
Analoginput of main module.
Definition: roboint.h:130
unsigned char rsvd3[4]
Reserved Base+0x2C..0x2F.
Definition: roboint.h:165
unsigned char E_Main
Digital Inputs Main Module Base+0x00: | E8 | E7 | E6 | E5 | E4 | E3 | E2 | E1 |.
Definition: roboint.h:45
unsigned short AVS2
Analoginput of slave modules 2 (Update-Time: 20ms)
Definition: roboint.h:329
unsigned short AY_R
Base+0xA2..0xA3: AY (Interface) Resistor-Value (0..5662 Ohm)
Definition: roboint.h:344
unsigned char rsvd6[1]
Reserved Base+0x4C.
Definition: roboint.h:244
unsigned char MES_Sub2
Outputs of extension module 2 ( energy saver mode )
Definition: roboint.h:236
unsigned char Distance
Abstandsensoren (1=detektiert) Base+0x0C: | 0 | 0 | 0 | 0 | 0 | 0 | D2 | D1 |.
Definition: roboint.h:63
unsigned short RfStatus
1 = RfError (0x1B4..0x1B5) is > 25. We think, Rf connection (only Onlinemodus) is lost
Definition: roboint.h:537
unsigned short DS1
Detection limit for distance sensor 1 ( to generate digital from analog input )
Definition: roboint.h:153
unsigned short AVS3
Analoginput of slave modules 3 (Update-Time: 20ms)
Definition: roboint.h:333
unsigned char rsvd16[10]
Reserved.
Definition: roboint.h:512
unsigned char MES_Main
Outputs of the main module ( energy saver mode )
Definition: roboint.h:228
unsigned char M_Sub3
Outputs of extension module 3.
Definition: roboint.h:218
unsigned char MPWM_Sub3[8]
Outputs of slave module 3 (PWM values, range =0..7)
Definition: roboint.h:302
unsigned char BusModules
I/O Extension modules connected.
Definition: roboint.h:381
unsigned char SlotModule1
Slot 1 connected extension module type Base+0xE7: ?
Definition: roboint.h:385
unsigned short IRKeys16Code2[11]
IR-Keys as 16 bit values (code 1)
Definition: roboint.h:527
unsigned short A1
Analoginput of main module.
Definition: roboint.h:110
unsigned char rsvd19[2]
Reserved Base+0x1BA..0x1BB.
Definition: roboint.h:561
unsigned short Timer1s
16-Bit Timer
Definition: roboint.h:182
unsigned short A1S3
Analoginput of slave module 3 (Update-Time: 20ms)
Definition: roboint.h:320
unsigned char rsvd20[64]
Reserved Base+0x1C0..0x1FF.
Definition: roboint.h:569
unsigned char rsvd11[3]
Reserved Base+0xE3..0xE5.
Definition: roboint.h:375
unsigned short E16_Main[8]
Digital inputs as 16 bit values.
Definition: roboint.h:432
unsigned char reserved_l3
Reserved Base+0x4F:
Definition: roboint.h:254
unsigned short AVS1
Analoginput of slave modules 1 (Update-Time: 20ms)
Definition: roboint.h:325
unsigned char rsvd2
Base+0x0D: reserved.
Definition: roboint.h:66
unsigned short Timer10s
16-Bit Timer
Definition: roboint.h:186
unsigned short Distance16[2]
Distance sensors D1 & D2 (Master Modul)
Definition: roboint.h:470
unsigned short E16_Sub1[8]
Digital inputs as 16 bit values.
Definition: roboint.h:443
Handle for the ft Interface.
Definition: roboint.h:582
long int sdev
Serial device.
Definition: roboint.h:590
long int type
Type of device.
Definition: roboint.h:592
int analogcycle
Anaylog cycle time (II only)
Definition: roboint.h:602
sem_t lock
Lock for communication.
Definition: roboint.h:596
FT_TRANSFER_AREA transfer_area
Place to hold the transfer area.
Definition: roboint.h:584
struct usb_device * dev
Pointer to the usb device.
Definition: roboint.h:586
unsigned char interface_connected
0 = no connection to the interface
Definition: roboint.h:606
struct termios saveioset
Serial settings.
Definition: roboint.h:598
unsigned int query_time
Query time for the Interface.
Definition: roboint.h:604
struct termios newioset
Serial settings.
Definition: roboint.h:600
pthread_t t
Communication Thread.
Definition: roboint.h:594
usb_dev_handle * device
Handle for USB communication.
Definition: roboint.h:588