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.

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