You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

490 lines
13 KiB

7 years ago
​
​
​
​
​
​
​
​
7 years ago
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
7 years ago
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
7 years ago
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
  1. #include "protocolPTZ_PELCO.h"
  2. #include "../../hardware/uart/serialPort.h"
  3. #define LOG( X ) m_pLog->Log( "Proto[PELCO]", this, X )
  4. #define LOG_ERROR( X ) m_pLog->Log( "Proto[PELCO]", this, _LOG_ERROR, X )
  5. protocolPTZ_PELCO::protocolPTZ_PELCO(config_setting_t *Settings) :protocolPTZ(Settings), m_mInquiryMutex(){
  6. m_pDataTransport = NULL;
  7. m_bReplyRequired = false;
  8. m_bDPlusEna = false;
  9. m_bCAM_ID = 2;
  10. m_bLastCommandIssued = CMD_PTZ_NOOP;
  11. };
  12. protocolPTZ_PELCO::~protocolPTZ_PELCO(){
  13. if (m_pDataTransport!=NULL)delete((serialPort*)m_pDataTransport);
  14. };
  15. U8 protocolPTZ_PELCO::finishUpPackage(U8 *pBuffer){
  16. U8 nChecksum = 0;
  17. pBuffer[SYNC_IDX] = 0xFF;
  18. pBuffer[ADR_IDX] = m_bCAM_ID;
  19. for (U8 i = ADR_IDX; i < CHKSUM_IDX; i++) nChecksum += pBuffer[i];
  20. pBuffer[CHKSUM_IDX] = nChecksum;
  21. return 7;
  22. };
  23. int protocolPTZ_PELCO::packetChecker(U8* Buffer, size_t BufferSize) {
  24. if( Buffer[0] == 0xFF ) {
  25. if( BufferSize > 1 ){
  26. if( Buffer[1] == 0x00 || Buffer[1] == m_bCAM_ID ) {
  27. U8 tChSumm;
  28. // Check 4 Bytes Responce
  29. if( BufferSize > 3 ){
  30. tChSumm = 0;
  31. for (U8 i = 1; i< 4; i++) tChSumm += Buffer[i];
  32. if (Buffer[4] == tChSumm){
  33. #ifdef DEBUG
  34. LOG("PacketChecker: 4 Byte Packet Is Recognized");
  35. #endif
  36. return 0;
  37. };
  38. };
  39. // Check 7 Bytes Responce
  40. if( BufferSize > 6 ){
  41. U8 tChSumm = 0;
  42. for( U8 i=1; i< 6; i++ ) tChSumm += Buffer[ i ];
  43. if( Buffer[6] == tChSumm ){
  44. #ifdef DEBUG
  45. LOG("PacketChecker: 7 Byte Packet Is Recognized");
  46. #endif
  47. return 0;
  48. };
  49. };
  50. // Check 18 Bytes Responce
  51. if (BufferSize > 17){
  52. U8 tChSumm = 0;
  53. for( U8 i = 1; i< 17; i++ ) tChSumm += Buffer[i];
  54. if( Buffer[17] == tChSumm ){
  55. #ifdef DEBUG
  56. LOG("PacketChecker: 18 Byte Packet Is Recognized");
  57. #endif
  58. return 0;
  59. };
  60. };
  61. } else return -1;
  62. };
  63. return 1;
  64. };
  65. #ifdef DEBUG
  66. LOG("PacketChecker: Packet Not Recognized");
  67. #endif
  68. return -1;
  69. };
  70. protocolPackage *protocolPTZ_PELCO::packetExtractor(unsigned char *Buffer, size_t BufferSize){
  71. protocolPackage *RetVal;
  72. if( BufferSize < 4 ) return NULL;
  73. RetVal = (protocolPackage*)malloc(sizeof(protocolPackage));
  74. if( RetVal != NULL ){
  75. RetVal->m_pData = (U8*) malloc(18);
  76. if (RetVal->m_pData != NULL){
  77. U8 tChSumm = 0;
  78. U8 i;
  79. RetVal->m_pData[tChSumm] = Buffer[tChSumm];
  80. for (i = 1; i < 18; i++){
  81. tChSumm += RetVal->m_pData[i] = Buffer[i];
  82. if ((i == 17 || i == 6 || i == 3) && (Buffer[i] == tChSumm)){
  83. RetVal->m_nSize = i + 1;
  84. return RetVal;
  85. };
  86. };
  87. free(RetVal->m_pData);
  88. };
  89. free(RetVal);
  90. };
  91. return NULL;
  92. };
  93. bool protocolPTZ_PELCO::packetHandler(protocolPackage *Package){
  94. U8 Com_Mode;
  95. U8 Cat_Code;
  96. LOG( "PacketHandler: Packet Is Handling");
  97. Com_Mode = Package->m_pData[1];
  98. Cat_Code = Package->m_pData[2];
  99. m_bLastCommandIssued = CMD_PTZ_NOOP;
  100. free( Package->m_pData );
  101. free( Package );
  102. return true;
  103. };
  104. bool protocolPTZ_PELCO::create( void ){
  105. config_setting_t *pSetting;
  106. int tPort, tSpeed;
  107. if (!protocolPTZ::create()) return false;
  108. m_bStatus = 0;
  109. pSetting = config_setting_get_member(m_pSettings, PPTZ_TAG_COM_PORT);
  110. if (pSetting == NULL) return false;
  111. tPort = config_setting_get_int(pSetting);
  112. pSetting = config_setting_get_member(m_pSettings, PPTZ_TAG_COM_SPEED);
  113. if (pSetting == NULL) return false;
  114. tSpeed = config_setting_get_int(pSetting);
  115. pSetting = config_setting_get_member(m_pSettings, PPTZ_TAG_CAM_ID);
  116. if (pSetting == NULL) return false;
  117. m_bCAM_ID = (U8)config_setting_get_int(pSetting);
  118. pSetting = config_setting_get_member(m_pSettings, PELCO_D_PLUS_ENABLE);
  119. if (pSetting != NULL) {
  120. m_bDPlusEna = (bool)config_setting_get_bool(pSetting);
  121. };
  122. char tBuf[16];
  123. #ifdef __linux__
  124. sprintf( tBuf,"/dev/ttyS%d",tPort);
  125. #else
  126. sprintf(tBuf, "com%d", tPort);
  127. #endif
  128. m_pDataTransport = new serialPort(tBuf,tSpeed);
  129. if (m_pDataTransport != NULL){
  130. if (m_pDataTransport->addRecipient(this)){
  131. setConnectionStatus(CS_CONNECTED);
  132. m_bStatus = 1;
  133. return true;
  134. };
  135. };
  136. return false;
  137. };
  138. bool protocolPTZ_PELCO::initCamera(void){
  139. return setPowerSaveMode( false );
  140. };
  141. bool protocolPTZ_PELCO::setPowerSaveMode( bool nMode ){
  142. U8 Buffer[8];
  143. if (m_bStatus == 0) return false;
  144. //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  145. m_bPowerSave_Mode = !nMode;
  146. m_bLastCommandIssued =( m_bPowerSave_Mode )?CMD_PTZ_POWER_ON:CMD_PTZ_POWER_OFF;
  147. memset(Buffer, 0, 8);
  148. Buffer[DCMD1_IDX] = (m_bPowerSave_Mode) ? 0x88 : 0x08;
  149. LOG("Sending POWER ON/OFF");
  150. return m_pDataTransport->sendData(Buffer, finishUpPackage(Buffer));
  151. };
  152. bool protocolPTZ_PELCO::getPowerSaveMode( void ){
  153. U8 Buffer[16];
  154. if (m_bStatus == 0) return false;
  155. //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  156. Buffer[0] = 0x80 + m_bCAM_ID;
  157. Buffer[1]=0x09;
  158. Buffer[2]=0x04;
  159. Buffer[3]=0x00;
  160. Buffer[4]=0xFF;
  161. m_mInquiryMutex.lock();
  162. LOG("Ask POWER mode");
  163. m_pDataTransport->sendData( Buffer, 5 );
  164. m_mInquiryMutex.lock();
  165. m_mInquiryMutex.unlock();
  166. LOG("Ask POWER mode -> Done");
  167. return m_bPowerSave_Mode;
  168. };
  169. bool protocolPTZ_PELCO::startZoomWide( void ){
  170. U8 Buffer[16];
  171. if (m_bStatus == 0) return false;
  172. //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  173. Buffer[0] = 0x80 + m_bCAM_ID;
  174. Buffer[1]=0x01;
  175. Buffer[2]=0x04;
  176. Buffer[3]=0x07;
  177. Buffer[4]=0x03;
  178. Buffer[5]=0xFF;
  179. LOG("Start Zoom Wide(standard)");
  180. m_pDataTransport->sendData( Buffer, 6 );
  181. return true;
  182. };
  183. bool protocolPTZ_PELCO::startZoomTele( void ){
  184. U8 Buffer[16];
  185. if (m_bStatus == 0) return false;
  186. //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  187. Buffer[0] = 0x80 + m_bCAM_ID;
  188. Buffer[1]=0x01;
  189. Buffer[2]=0x04;
  190. Buffer[3]=0x07;
  191. Buffer[4]=0x02;
  192. Buffer[5]=0xFF;
  193. LOG("Start Zoom Tele(standard)");
  194. m_pDataTransport->sendData( Buffer, 6 );
  195. return true;
  196. };
  197. bool protocolPTZ_PELCO::startZoomWide( double nSpeed ){
  198. U8 Buffer[16];
  199. if (m_bStatus == 0) return false;
  200. //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  201. Buffer[0] = 0x80 + m_bCAM_ID;
  202. Buffer[1]=0x01;
  203. Buffer[2]=0x04;
  204. Buffer[3]=0x07;
  205. U8 Param;
  206. Param = ((U8)( 2 + nSpeed * 5 )) & 0x07;
  207. Buffer[4]=0x30 | Param;
  208. Buffer[5]=0xFF;
  209. LOG("Start Zoom Wide(parameter)");
  210. m_pDataTransport->sendData( Buffer, 6 );
  211. return true;
  212. };
  213. bool protocolPTZ_PELCO::startZoomTele( double nSpeed ){
  214. U8 Buffer[16];
  215. if (m_bStatus == 0) return false;
  216. //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  217. Buffer[0] = 0x80 + m_bCAM_ID;
  218. Buffer[1]=0x01;
  219. Buffer[2]=0x04;
  220. Buffer[3]=0x07;
  221. U8 Param;
  222. Param = ((U8)( 2 + nSpeed * 5 )) & 0x07;
  223. Buffer[4]=0x20 | Param;
  224. Buffer[5]=0xFF;
  225. LOG("Start Zoom Tele(parameter)");
  226. m_pDataTransport->sendData( Buffer, 6 );
  227. return true;
  228. };
  229. bool protocolPTZ_PELCO::stopZoom( void ){
  230. U8 Buffer[16];
  231. if (m_bStatus == 0) return false;
  232. //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  233. Buffer[0] = 0x80 + m_bCAM_ID;
  234. Buffer[1]=0x01;
  235. Buffer[2]=0x04;
  236. Buffer[3]=0x07;
  237. Buffer[4]=0x00;
  238. Buffer[5]=0xFF;
  239. LOG("Stop Zoom");
  240. m_pDataTransport->sendData( Buffer, 6 );
  241. return true;
  242. };
  243. /*double protocolPTZ_PELCO::getZoom( void ){
  244. U8 Buffer[16];
  245. if (m_bStatus == 0) return false;
  246. if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  247. Buffer[0] = 0x80 + m_bCAM_ID;
  248. Buffer[1]=0x09;
  249. Buffer[2]=0x04;
  250. Buffer[3]=0x47;
  251. Buffer[4]=0xFF;
  252. m_mInquiryMutex.lock();
  253. LOG("Ask Zoom");
  254. m_pDataTransport->sendData( Buffer, 5 );
  255. m_mInquiryMutex.lock();
  256. m_mInquiryMutex.unlock();
  257. LOG("Ask Zoom -> Done");
  258. return m_dZoom;
  259. };
  260. */
  261. bool protocolPTZ_PELCO::resetPTZDrive( void ){
  262. U8 Buffer[16];
  263. if (m_bStatus == 0) return false;
  264. memset(Buffer, 0, 8);
  265. Buffer[DCMD1_IDX] = 0x00;
  266. Buffer[DCMD2_IDX] = 0x0F;
  267. Buffer[DATA1_IDX] = 0x00;
  268. Buffer[DATA2_IDX] = 0x00;
  269. LOG("Reset PTZ");
  270. return m_pDataTransport->sendData(Buffer, finishUpPackage(Buffer));
  271. };
  272. bool protocolPTZ_PELCO::goHomePosition( void ){
  273. U8 Buffer[8];
  274. if (m_bStatus == 0) return false;
  275. memset(Buffer, 0, 8);
  276. Buffer[DCMD2_IDX] = 0x07;
  277. Buffer[DATA2_IDX] = 0x22;
  278. LOG("Go Home");
  279. return m_pDataTransport->sendData(Buffer, finishUpPackage(Buffer));
  280. };
  281. bool protocolPTZ_PELCO::setPanPos( double dPan ){
  282. U8 Buffer[16];
  283. U16 SPan;
  284. SPan = ((U16)( 36000.0 + 18000.0 * dPan )) % 36000;
  285. Buffer[DCMD2_IDX] = 0x4B;
  286. Buffer[DATA1_IDX] = ( SPan >> 8 ) & 0xFF;
  287. Buffer[DATA2_IDX] = SPan & 0xFF;
  288. #ifdef DEBUG
  289. char tBuffer[64];
  290. sprintf(tBuffer, "setPanPos %.3f", dPan );
  291. LOG(tBuffer);
  292. #endif
  293. return m_pDataTransport->sendData(Buffer, finishUpPackage(Buffer));
  294. };
  295. bool protocolPTZ_PELCO::setTiltPos( double dTilt ){
  296. U8 Buffer[16];
  297. U16 STlt;
  298. STlt = ((U16)(18000.0 + 18000.0 * ((dTilt + 1.f) / 2.f))) % 18000;
  299. Buffer[DCMD2_IDX] = 0x4D;
  300. Buffer[DATA1_IDX] = ( STlt >> 8 ) & 0xFF;
  301. Buffer[DATA2_IDX] = STlt & 0xFF;
  302. #ifdef DEBUG
  303. char tBuffer[64];
  304. sprintf(tBuffer, "setTiltPos %.3f -> %d", dTilt, STlt);
  305. LOG(tBuffer);
  306. #endif
  307. return m_pDataTransport->sendData(Buffer, finishUpPackage(Buffer));
  308. };
  309. bool protocolPTZ_PELCO::setZoom( double dZoom ){
  310. U8 Buffer[16];
  311. U16 SZum;
  312. SZum = (U16)(65535 * dZoom );
  313. Buffer[DCMD2_IDX] = 0x4F;
  314. Buffer[DATA1_IDX] = ( SZum >> 8 ) & 0xFF;
  315. Buffer[DATA2_IDX] = SZum & 0xFF;
  316. #ifdef DEBUG
  317. char tBuffer[64];
  318. sprintf(tBuffer, "setZoomPos %.3f", dZoom);
  319. LOG(tBuffer);
  320. #endif
  321. return m_pDataTransport->sendData(Buffer, finishUpPackage(Buffer));
  322. };
  323. bool protocolPTZ_PELCO::move(uint32_t MoveMatrix){
  324. U8 Buffer[16];
  325. U8 Param1, Param2;
  326. if (m_bStatus == 0) return false;
  327. // if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  328. Param1 = (U8)(m_dPanSpeed * 64.0) & 0xFF;
  329. Param2 = (U8)(m_dTiltSpeed * 64.0) & 0xFF;
  330. memset(Buffer, 0, 16);
  331. if ((MoveMatrix & PTZ_DRIVE_PAN_MASK) != 0){
  332. if ((MoveMatrix & PTZ_DRIVE_PAN_LEFT) != 0){
  333. Buffer[DCMD2_IDX] |= 0x04;
  334. } else {
  335. Buffer[DCMD2_IDX] |= 0x02;
  336. };
  337. };
  338. if ((MoveMatrix & PTZ_DRIVE_TILT_MASK) != 0){
  339. if ((MoveMatrix & PTZ_DRIVE_TILT_UP) != 0){
  340. Buffer[DCMD2_IDX] |= 0x08;
  341. } else {
  342. Buffer[DCMD2_IDX] |= 0x10;
  343. };
  344. };
  345. if ((MoveMatrix & PTZ_DRIVE_ZOOM_MASK) != 0){
  346. if ((MoveMatrix & PTZ_DRIVE_ZOOM_WIDE) != 0){
  347. Buffer[DCMD2_IDX] |= 0x40;
  348. } else {
  349. Buffer[DCMD2_IDX] |= 0x20;
  350. };
  351. };
  352. Buffer[DATA1_IDX] = Param1; // Max = 3f Turbo Pan = FF
  353. Buffer[DATA2_IDX] = Param2;
  354. LOG("Make move");
  355. return m_pDataTransport->sendData(Buffer, finishUpPackage(Buffer));
  356. };
  357. bool protocolPTZ_PELCO::goAbsolute(double dPan, double dTilt, double dZoom) {
  358. U8 Buffer[16];
  359. U8 Param1, Param2;
  360. if (m_bStatus == 0) return false;
  361. // if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  362. if (m_bDPlusEna) {
  363. Buffer[0] = 0x80 + m_bCAM_ID;
  364. Buffer[1] = 0x01;
  365. Buffer[2] = 0x06;
  366. Buffer[3] = 0x02;
  367. Buffer[4] = 0x18;//Max Pan Speed
  368. Buffer[5] = 0x14;//Max Tilt Speed
  369. uint16_t pPos, tPos;
  370. //-880 .. 880
  371. pPos = (uint16_t)(880.0 * dPan);
  372. Buffer[6] = 0x0F & (pPos >> 12);
  373. Buffer[7] = 0x0F & (pPos >> 8);
  374. Buffer[8] = 0x0F & (pPos >> 4);
  375. Buffer[9] = 0x0F & pPos;
  376. //-300 .. 300
  377. tPos = (uint16_t)(300.0 * dTilt);
  378. Buffer[10] = 0x0F & (tPos >> 12);
  379. Buffer[11] = 0x0F & (tPos >> 8);
  380. Buffer[12] = 0x0F & (tPos >> 4);
  381. Buffer[13] = 0x0F & tPos;
  382. Buffer[14] = 0xFF;
  383. LOG("ABS move");
  384. return m_pDataTransport->sendData(Buffer, 15);
  385. } else {
  386. LOG("ABS move");
  387. return true;
  388. };
  389. };
  390. bool protocolPTZ_PELCO::setAutoFocus(bool nMode){
  391. m_bAutoFocus_Mode = nMode;
  392. U8 Buffer[8];
  393. if (m_bStatus == 0) return false;
  394. memset(Buffer, 0, 8);
  395. Buffer[DCMD2_IDX] = 0x2B;
  396. Buffer[DATA2_IDX] = (m_bAutoFocus_Mode) ? 0x01 : 0x02;
  397. LOG("setAutoFocus");
  398. return m_pDataTransport->sendData(Buffer, finishUpPackage(Buffer));
  399. };
  400. bool protocolPTZ_PELCO::setOSD( bool nMode ){
  401. U8 Buffer[16];
  402. if (m_bStatus == 0) return false;
  403. //if (m_bReplyRequired) if (m_bLastCommandIssued != CMD_PTZ_NOOP) return false;
  404. Buffer[0] = 0x80 + m_bCAM_ID;
  405. Buffer[1]=0x01;
  406. Buffer[2]=0x06;
  407. Buffer[3]=0x06;
  408. Buffer[4]=(nMode)?0x02:0x03;
  409. Buffer[5]=0xFF;
  410. LOG("Set On Screen Display mode");
  411. m_pDataTransport->sendData( Buffer, 6 );
  412. return true;
  413. };
  414. /*
  415. bool protocolPTZ_PELCO::setPSpeed(double Speed) {
  416. m_dPanSpeed = Speed;
  417. LOG("setPanSpeed");
  418. return move(0);
  419. };
  420. bool protocolPTZ_PELCO::setTSpeed(double Speed) {
  421. m_dTiltSpeed = Speed;
  422. LOG("setTiltSpeed");
  423. return move(0);
  424. };
  425. bool protocolPTZ_PELCO::setPTZSpeed(double pSpeed, double tSpeed, double zSpeed) {
  426. m_dPanSpeed = pSpeed;
  427. m_dTiltSpeed = tSpeed;
  428. m_dZoomSpeed = zSpeed;
  429. LOG("setPTZSpeed");
  430. return move(0);
  431. };
  432. bool protocolPTZ_PELCO::setZSpeed(double Speed) {
  433. m_dZoomSpeed = Speed;
  434. U8 Buffer[8];
  435. if (m_bStatus == 0) return false;
  436. memset(Buffer, 0, 8);
  437. Buffer[DCMD2_IDX] = 0x25;
  438. U8 sValue = (U8)floor(m_dZoomSpeed * 3.f);
  439. Buffer[DATA2_IDX] = sValue;
  440. LOG("setZoomSpeed");
  441. return m_pDataTransport->sendData(Buffer, finishUpPackage(Buffer));
  442. };
  443. bool protocolPTZ_PELCO::setFSpeed(double Speed) {
  444. m_dZoomSpeed = Speed;
  445. U8 Buffer[8];
  446. if (m_bStatus == 0) return false;
  447. memset(Buffer, 0, 8);
  448. Buffer[DCMD2_IDX] = 0x27;
  449. U8 sValue = (U8)floor( m_dZoomSpeed * 3.f );
  450. Buffer[DATA2_IDX] = sValue;
  451. LOG("setFocusSpeed");
  452. return m_pDataTransport->sendData(Buffer, finishUpPackage(Buffer));
  453. };
  454. */
  455. #undef LOG
  456. #undef LOG_ERROR