Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef KINOVA_DLL_COMMLAYERUBUNTU_H_
00009 #define KINOVA_DLL_COMMLAYERUBUNTU_H_
00010
00011 #ifdef KINOVADLLCOMMLAYER_EXPORTS
00012 #define KINOVADLLCOMMLAYER_API __declspec(dllexport)
00013 #else
00014 #define KINOVADLLCOMMLAYER_API __declspec(dllimport)
00015 #endif
00016
00017 #include <vector>
00018
00019
00020
00021
00022 #define NO_ERROR_KINOVA 1
00023
00024
00025 #define ERROR_LOAD_USB_LIBRARY 1001
00026
00027
00028 #define ERROR_OPEN_METHOD 1002
00029
00030
00031 #define ERROR_WRITE_METHOD 1003
00032
00033
00034 #define ERROR_READ_METHOD 1004
00035
00036
00037 #define ERROR_READ_INT_METHOD 1005
00038
00039
00040 #define ERROR_FREE_LIBRARY 1006
00041
00042
00043 #define ERROR_JACO_CONNECTION 1007
00044
00045
00046 #define ERROR_CLAIM_INTERFACE 1008
00047
00048
00049 #define ERROR_UNKNOWN_DEVICE 1009
00050
00051
00052 #define ERROR_NOT_INITIALIZED 1010
00053
00054
00055 #define ERROR_LIBUSB_NO_DEVICE 1011
00056
00057
00058 #define ERROR_LIBUSB_BUSY 1012
00059
00060
00061 #define ERROR_LIBUSB_NOT_SUPPORTED 1013
00062
00063
00064 #define ERROR_SENDPACKET_UNKNOWN 1014
00065
00066
00067 #define ERROR_NO_DEVICE_FOUND 1015
00068
00069
00070
00071
00072
00073 #define PACKET_SIZE 64
00074
00075
00076 #define PACKET_DATA_SIZE 56
00077
00078
00079 #define PACKET_HEADER_SIZE 8
00080
00081
00082 #define SERIAL_LENGTH 20
00083
00084
00085 struct Packet
00086 {
00087 short IdPacket;
00088 short TotalPacketCount;
00089 short IdCommand;
00090 short TotalDataSize;
00091 unsigned char Data[PACKET_DATA_SIZE];
00092 };
00093
00094
00095 struct PacketList
00096 {
00097 std::vector<Packet> packets;
00098 };
00099
00100
00101 struct KinovaDevice
00102 {
00103
00104
00105 char SerialNumber[SERIAL_LENGTH];
00106
00107
00108 int DeviceID;
00109 };
00110
00111
00112 extern "C" __attribute__ ((visibility ("default"))) int InitCommunication(void);
00113
00114 extern "C" __attribute__ ((visibility ("default"))) int CloseCommunication(void);
00115
00116 extern "C" __attribute__ ((visibility ("default"))) int GetDeviceCount(int &result);
00117
00118 extern "C" __attribute__ ((visibility ("default"))) Packet SendPacket(Packet &packetOut, Packet &packetIn, int &result);
00119
00120 extern "C" __attribute__ ((visibility ("default"))) int ScanForNewDevice();
00121
00122 extern "C" __attribute__ ((visibility ("default"))) int GetDevices(std::vector<KinovaDevice>& list, int &result);
00123
00124 extern "C" __attribute__ ((visibility ("default"))) int SetActiveDevice(KinovaDevice device);
00125
00126 #endif