Kinova.API.CommLayerUbuntu.h
Go to the documentation of this file.
00001 /*
00002  * Kinova.DLL.CommLayerUbuntu.h
00003  *
00004  *  Created on: Oct 16, 2012
00005  *      Author: H. Lamontagne, Kinova
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 // ***** E R R O R   C O D E S ******
00020 
00021 //No error, everything is fine.
00022 #define NO_ERROR_KINOVA 1
00023 
00024 //Unable to load the USB library.
00025 #define ERROR_LOAD_USB_LIBRARY 1001
00026 
00027 //Unable to access the Open method from the USB library.
00028 #define ERROR_OPEN_METHOD  1002
00029 
00030 //Unable to access the Write method from the USB library.
00031 #define ERROR_WRITE_METHOD  1003
00032 
00033 //Unable to access the Read method from the USB library.
00034 #define ERROR_READ_METHOD  1004
00035 
00036 //Unable to access the Read Int method from the USB library.
00037 #define ERROR_READ_INT_METHOD  1005
00038 
00039 //Unable to access the Free Library method from the USB library.
00040 #define ERROR_FREE_LIBRARY  1006
00041 
00042 //There is a problem with the USB connection between the device and the computer.
00043 #define ERROR_JACO_CONNECTION 1007
00044 
00045 //Unable to claim the USB interface.
00046 #define ERROR_CLAIM_INTERFACE 1008
00047 
00048 //Unknown type of device.
00049 #define ERROR_UNKNOWN_DEVICE 1009
00050 
00051 //The functionality you are trying to use has not been initialized.
00052 #define ERROR_NOT_INITIALIZED 1010
00053 
00054 //The USB library cannot find the device.
00055 #define ERROR_LIBUSB_NO_DEVICE 1011
00056 
00057 //The USB Library is bussy and could not perform the action.
00058 #define ERROR_LIBUSB_BUSY 1012
00059 
00060 //The functionality you are trying to perform is not supported by the version installed.
00061 #define ERROR_LIBUSB_NOT_SUPPORTED 1013
00062 
00063 //Unknown error while sending a packet.
00064 #define ERROR_SENDPACKET_UNKNOWN 1014
00065 
00066 //Cannot find the requested device.
00067 #define ERROR_NO_DEVICE_FOUND 1015
00068 
00069 // ***** E N D  O F  E R R O R   C O D E S ******
00070 
00071 
00072 //Total size of our packet in bytes.
00073 #define PACKET_SIZE 64
00074 
00075 //Data's size of a single packet.
00076 #define PACKET_DATA_SIZE 56
00077 
00078 //Header's size of a packet.
00079 #define PACKET_HEADER_SIZE 8
00080 
00081 //Max character count in our string.
00082 #define SERIAL_LENGTH 20
00083 
00084 //That represents a packet.
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 //That is simply a list of packet
00095 struct PacketList
00096 {
00097         std::vector<Packet> packets;
00098 };
00099 
00100 //That is a device you can communicate with via this library.
00101 struct KinovaDevice
00102 {
00103         //The serial number of the device. If you are communicating with more than 1 device, this will be used to identify
00104         //the devices.
00105         char SerialNumber[SERIAL_LENGTH];
00106 
00107         //This is a device ID used by the API. User should not use it.
00108         int DeviceID;
00109 };
00110 
00111 //Functions available outside of this library.
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 /* KINOVA_DLL_COMMLAYERUBUNTU_H_ */


jaco_driver
Author(s): Ilia Baranov (Clearpath) , Jeff Schmidt (Clearpath) , Alex Bencz (Clearpath) , Matt DeDonato (WPI), Braden Stenning
autogenerated on Mon Mar 2 2015 16:21:03