00001
00011
00012
00013
00014
00015
00016 #ifdef __cplusplus
00017 extern "C"{
00018 #endif
00019
00020
00021 #ifndef B_CAP_H
00022 #define B_CAP_H
00023
00024
00025
00026
00027 #if WIN32
00028 #define SERIAL_BAUDRATE 115200
00029 #else
00030 #define SERIAL_BAUDRATE 0x0000f
00031 #endif
00032
00036 typedef enum BCAP_HRESULT {
00037
00038 BCAP_S_OK = 0 ,
00039 BCAP_E_NOTIMPL = 0x80004001,
00040 BCAP_E_ABORT = 0x80004004,
00041 BCAP_E_FAIL = 0x80004005,
00042 BCAP_E_UNEXPECTED = 0x8000FFFF,
00043 BCAP_E_INVALIDRCVPACKET = 0x80010001,
00044
00045
00046
00047 BCAP_E_INVALIDSNDPACKET = 0x80010002,
00048 BCAP_E_INVALIDARGTYPE = 0x80010003,
00049 BCAP_E_ROBOTISBUSY = 0x80010004,
00050 BCAP_E_INVALIDCOMMAND = 0x80010005,
00051
00052 BCAP_E_PACKETSIZEOVER = 0x80010011,
00053
00054 BCAP_E_ARGSIZEOVER = 0x80010012,
00055 BCAP_E_ACCESSDENIED = 0x80070005,
00056 BCAP_E_HANDLE = 0x80070006,
00057 BCAP_E_OUTOFMEMORY = 0x8007000E,
00058 BCAP_E_INVALIDARG = 0x80070057,
00059 BCAP_E_BUF_FULL = 0x83201483
00060
00061 } BCAP_HRESULT;
00062
00063
00064
00065
00066 #define VT_EMPTY 0
00067 #define VT_NULL 1
00068 #define VT_ERROR 10
00069 #define VT_UI1 17
00070 #define VT_I2 2
00071 #define VT_UI2 18
00072 #define VT_I4 3
00073 #define VT_UI4 19
00074 #define VT_R4 4
00075 #define VT_R8 5
00076 #define VT_CY 6
00077 #define VT_DATE 7
00078 #define VT_BOOL 11
00079 #define VT_BSTR 8
00080
00081 #define VT_VARIANT 12
00082 #define VT_ARRAY 0x2000
00083
00084
00085
00086 #ifndef SUCCEEDED
00087 #define SUCCEEDED(Status) ((int)(Status) >= 0)
00088 #endif
00089
00090 #ifndef FAILED
00091 #define FAILED(Status) ((int)(Status) < 0)
00092 #endif
00093
00094
00095 #ifndef u_char
00096 typedef unsigned char u_char;
00097 #endif
00098 #ifndef u_short
00099 typedef unsigned short u_short;
00100 #endif
00101 #ifndef u_int
00102 typedef unsigned int u_int;
00103 #endif
00104
00105
00106
00107 typedef struct {
00108 u_short Type;
00109 u_int Arrays;
00110 union {
00111 u_char CharValue;
00112 u_short ShortValue;
00113 u_int LongValue;
00114 float FloatValue;
00115 double DoubleValue;
00116
00117 u_char String[40 + 1];
00118 float FloatArray[16];
00119 double DoubleArray[16];
00120
00121
00122
00123 } Value;
00124 } BCAP_VARIANT;
00125
00126
00127 BCAP_HRESULT bCap_Open(const char *pIPStr, int iPort, int *piSockFd);
00128 BCAP_HRESULT bCap_Close(int iSockFd);
00129
00130 BCAP_HRESULT bCap_ServiceStart(int iSockFd);
00131 BCAP_HRESULT bCap_ServiceStop(int iSockFd);
00132
00133
00134 BCAP_HRESULT bCap_ControllerConnect(int iSockFd,char *pStrCtrlname, char *pStrProvName, char *pStrPcName, char *pStrOption, u_int *plhController);
00135 BCAP_HRESULT bCap_ControllerDisconnect(int iSockFd, u_int lhController);
00136
00137 BCAP_HRESULT bCap_ControllerGetRobot(int iSockFd, u_int lhController, char *pStrRobotName, char *pStrOption, u_int *lhRobot);
00138 BCAP_HRESULT bCap_ControllerGetVariable(int iSockFd, u_int lhController, char *pVarName, char *pstrOption, u_int *plhVar);
00139 BCAP_HRESULT bCap_ControllerGetTask(int iSockFd, u_int lhController, char *pTskName, char *pstrOption, u_int *plhVar);
00140 BCAP_HRESULT bCap_ControllerExecute(int iSockFd, u_int lhController, char *pStrCommand, char *pStrOption, void *plResult);
00141 BCAP_HRESULT bCap_ControllerExecute2(int iSockFd, u_int lhController, char *pStrCommand, BCAP_VARIANT *pVntOption, BCAP_VARIANT *pvntResult);
00142
00143
00144 BCAP_HRESULT bCap_RobotRelease(int iSockFd, u_int lhRobot);
00145 BCAP_HRESULT bCap_RobotGetVariable(int iSockFd, u_int lhRobot, char *pVarName, char *pStrOption, u_int *lhVarCurJnt);
00146 BCAP_HRESULT bCap_RobotExecute(int iSockFd, u_int lhRobot, char *pStrCommand, char *pStrOption, void *plResult);
00147 BCAP_HRESULT bCap_RobotChange(int iSockFd, u_int lhRobot, char *pStrCommand);
00148 BCAP_HRESULT bCap_RobotMove(int iSockFd, u_int lhRobot, long lComp, char *pStrPose, char *pStrOption);
00149 BCAP_HRESULT bCap_RobotExecuteSlaveMove(int iSockFd, u_int lhRobot, char *pStrCommand, float *pfOption, void *pResult);
00150 BCAP_HRESULT bCap_RobotExecute2(int iSockFd, u_int lhRobot, char *pStrCommand, BCAP_VARIANT *pVntOption, BCAP_VARIANT *pvntResult);
00151
00152
00153 BCAP_HRESULT bCap_TaskRelease(int iSockFd, u_int lhTask);
00154 BCAP_HRESULT bCap_TaskGetVariable(int iSockFd, u_int lhTask, char *pVarName, char *pstrOption, u_int *plhVar);
00155 BCAP_HRESULT bCap_TaskStart(int iSockFd, u_int lhTask, long lMode, char *pStrOption);
00156 BCAP_HRESULT bCap_TaskStop(int iSockFd, u_int lhTask, long lMode, char *pStrOption);
00157
00158
00159 BCAP_HRESULT bCap_VariableRelease(int iSockFd, u_int lhVar);
00160 BCAP_HRESULT bCap_VariableGetValue(int iSockFd, u_int lhVar, void *pVntValue);
00161 BCAP_HRESULT bCap_VariablePutValue(int iSockFd, u_int lhVar, u_short iType, u_int lArrays, void *pVntValue);
00162
00163 #endif
00164
00165 #ifdef __cplusplus
00166 }
00167 #endif