CCarLifeLibWrapper.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  1. /*******************************************************
  2. Author:
  3. Liu Caiquan
  4. Date:
  5. @8th-December-2016@
  6. CarLife Protocol version:
  7. @V1.2.4@
  8. Copyright (C) Under BaiDu, Inc.
  9. *******************************************************/
  10. #ifndef C_CARLIFE_LIB_WRAPPER_H
  11. #define C_CARLIFE_LIB_WRAPPER_H
  12. #include<iostream>
  13. #include<string>
  14. using namespace std;
  15. typedef unsigned char u8;
  16. typedef unsigned int u32;
  17. typedef int i32;
  18. typedef double d64;
  19. typedef unsigned long long u64;
  20. #include "libusb.h"
  21. extern bool g_exitEap;
  22. extern bool g_finished;
  23. namespace CommonUtilH{
  24. /*******************************************************
  25. STRUCT
  26. *******************************************************/
  27. //struct for cmd channel
  28. typedef struct HUProtocolVersion{
  29. u32 majorVersion;
  30. u32 minorVersion;
  31. }S_HU_PROTOCOL_VERSION;
  32. typedef struct ProtocolVersionMatchStatus{
  33. u32 matchStatus;
  34. }S_PROTOCOL_VERSION_MATCH_SATUS;
  35. //0x00018003
  36. typedef struct HUInfo{
  37. string os;//1
  38. string board ;//2
  39. string bootloader ;//3
  40. string brand;//4
  41. string cpu_abi;//5
  42. string cpu_abi2 ;//6
  43. string device ;//7
  44. string display ;//8
  45. string fingerprint ;//9
  46. string hardware ;//10
  47. string host ;//11
  48. string cid ;//12
  49. string manufacturer ;//13
  50. string model ;//14
  51. string product ;//15
  52. string serial;//16
  53. string codename ;//17
  54. string incremental;//18
  55. string release ;//19
  56. string sdk ;//20
  57. u32 sdk_int;//21
  58. string token;//22
  59. string btaddress;//23
  60. }S_HU_INFO;
  61. //0x00010004
  62. typedef struct MDInfo{
  63. string os;//1
  64. string board ;//2
  65. string bootloader ;//3
  66. string brand;//4
  67. string cpu_abi;//5
  68. string cpu_abi2 ;//6
  69. string device ;//7
  70. string display ;//8
  71. string fingerprint ;//9
  72. string hardware ;//10
  73. string host ;//11
  74. string cid ;//12
  75. string manufacturer ;//13
  76. string model ;//14
  77. string product ;//15
  78. string serial;//16
  79. string codename ;//17
  80. string incremental;//18
  81. string release ;//19
  82. string sdk ;//20
  83. u32 sdk_int;//21
  84. string token;//22
  85. string btaddress;//23
  86. }S_MD_INFO;
  87. typedef struct BTPairInfo{
  88. string address ;
  89. string passKey ;
  90. string hash ;
  91. string randomizer;
  92. string uuid;
  93. string name;
  94. u32 status;
  95. u32 ispaired;
  96. }S_BT_PAIR_INFO;
  97. //add 20180226
  98. typedef struct MDBTPairInfo{
  99. string address ;
  100. string passKey ;
  101. string hash ;
  102. string randomizer;
  103. string uuid;
  104. string name;
  105. u32 status;
  106. }S_MD_BT_PAIR_INFO;
  107. typedef struct VideoEncoderInit{
  108. u32 width ;
  109. u32 height ;
  110. u32 frameRate;
  111. }S_VIDEO_ENCODER_INIT;
  112. typedef struct VideoEncoderInitDone{
  113. u32 width ;
  114. u32 height ;
  115. u32 frameRate;
  116. }S_VIDEO_ENCODER_INIT_DONE;
  117. typedef struct VideoEncoderFrameRateChange{
  118. u32 frameRate;
  119. }S_VIDEO_ENCODER_FRAME_RATE_CHANGE;
  120. typedef struct VideoEncoderFrameRateChangeDone{
  121. u32 frameRate;
  122. }S_VIDEO_ENCODER_FRAME_RATE_CHANGE_DONE;
  123. //0x00018010
  124. typedef struct CarVelocity{
  125. u32 speed;
  126. u64 timeStamp;
  127. }S_CAR_VELOCITY;
  128. //0x00018010
  129. typedef struct CarGPS{
  130. u32 antennaState;
  131. u32 signalQuality;
  132. // dBHz
  133. u32 latitude;
  134. // 1/1,000,000 degrees
  135. u32 longitude;
  136. // 1/1,000,000 degrees
  137. u32 height ;
  138. // 0.1 meters
  139. u32 speed ;
  140. // 0.01 km/h units
  141. u32 heading;
  142. // 0.1 degrees
  143. u32 year;
  144. u32 month;
  145. u32 day;
  146. u32 hrs ;
  147. u32 min ;
  148. u32 sec ;
  149. u32 fix;
  150. u32 hdop;
  151. // units 0.1
  152. u32 pdop ;
  153. // units 0.1
  154. u32 vdop ;
  155. // units 0.1
  156. u32 satsUsed ;
  157. u32 satsVisible;
  158. u32 horPosError ;
  159. u32 vertPosError;
  160. u32 northSpeed;
  161. // 0.01m/s
  162. u32 eastSpeed;
  163. // 0.01m/s
  164. u32 vertSpeed;
  165. // 0.01m/s
  166. u64 timeStamp;
  167. }S_CAR_GPS;
  168. //0x00018011
  169. typedef struct CarGyroscope{
  170. i32 gyroType;
  171. d64 gyroX;
  172. d64 gyroY;
  173. d64 gyroZ;
  174. u64 timeStamp;
  175. }S_CAR_GYROSCOPE;
  176. //0x00018012
  177. typedef struct CarAcceleration{
  178. d64 accX ;
  179. d64 accY ;
  180. d64 accZ ;
  181. u64 timeStamp ;
  182. }S_CAR_ACCELERATION;
  183. //0x00018013
  184. typedef struct CarOil{
  185. i32 level;
  186. i32 range;
  187. bool lowFullWarning;
  188. }S_CAR_OIL;
  189. //struct for media && tts channel
  190. typedef struct AudioInitParameter{
  191. u32 sampleRate;
  192. u32 channelConfig;
  193. u32 sampleFormat;
  194. }S_AUDIO_INIT_PARAMETER;
  195. //struct for ctrl channel
  196. typedef struct TouchAction{
  197. u32 action;
  198. u32 x ;
  199. u32 y ;
  200. }S_TOUCH_ACTION;
  201. typedef struct TouchActionDown{
  202. u32 x ;
  203. u32 y ;
  204. }S_TOUCH_ACTION_DOWN;
  205. typedef struct TouchActionUp{
  206. u32 x ;
  207. u32 y ;
  208. }S_TOUCH_ACTION_UP;
  209. typedef struct TouchActionMove{
  210. u32 x ;
  211. u32 y ;
  212. }S_TOUCH_ACTION_MOVE;
  213. typedef struct TouchSingleClick{
  214. u32 x;
  215. u32 y;
  216. }S_TOUCH_SIGNAL_CLICK;
  217. typedef struct TouchDoubleClick{
  218. u32 x;
  219. u32 y;
  220. }S_TOUCH_DOUBLE_CLICK;
  221. typedef struct TouchLongPress{
  222. u32 x;
  223. u32 y;
  224. }S_TOUCH_LONG_PRESS;
  225. typedef struct TouchCarHardkeyCode{
  226. u32 keycode;
  227. }S_TOUCH_CAR_HARD_KEY_CODE;
  228. typedef struct TouchUIActionSound{
  229. //reserved
  230. }S_TOUCH_UI_ACTION_SOUND;
  231. //0x00018025
  232. //0x00010026
  233. typedef struct ModuleStatusMobile{
  234. u32 moduleID;
  235. u32 statusID;
  236. struct ModuleStatusMobile* next;
  237. }S_MODULE_STATUS_MOBILE;
  238. typedef struct ModuleStatusListMobile{
  239. u32 cnt ;
  240. S_MODULE_STATUS_MOBILE* moduleStatus;
  241. }S_MODULE_STATUS_LIST_MOBILE;
  242. //0x00018027
  243. typedef struct StatisticsInfo{
  244. string cuid;
  245. string versionName;
  246. u32 versionCode;
  247. string channel;
  248. u32 connectCount;
  249. u32 connectSuccessCount;
  250. u32 connectTime;
  251. string crashLog;
  252. }S_STATISTICS_INFO;
  253. //0x00018028
  254. typedef struct ModuleStatusControl{
  255. u32 moduleID;
  256. u32 statusID;
  257. }S_MODULE_STATUS_CONTROL;
  258. //0x00018029
  259. typedef struct GearInfo
  260. {
  261. u32 gear;
  262. }S_GEAR_INFO;
  263. //0x00010030
  264. typedef struct NaviNextTurnInfo
  265. {
  266. u32 action ;
  267. u32 nextTurn;
  268. string roadName ;
  269. u32 totalDistance ;
  270. u32 remainDistance ;
  271. u32 time;
  272. }S_NAVI_NEXT_TURN_INFO;
  273. //0x00010031
  274. //0x00010032
  275. //0x00010033
  276. //0x00010034
  277. typedef struct VehicleInfo{
  278. u32 moduleID;
  279. i32 flag;
  280. u32 frequency;
  281. struct VehicleInfo* pNext;
  282. }S_VEHICLE_INFO;
  283. typedef struct VehicleInfoList{
  284. u32 cnt ;
  285. S_VEHICLE_INFO* pVehicleInfo;
  286. }S_VEHICLE_INFO_LIST;
  287. //0x00010035
  288. typedef struct MediaInfo
  289. {
  290. string source ;
  291. string song ;
  292. string artist ;
  293. string album ;
  294. string albumArt ;
  295. u32 duration ;
  296. u32 playlistNum ;
  297. string songId ;
  298. u32 mode ;
  299. }S_MEDIA_INFO;
  300. //0x00010036
  301. typedef struct MediaProgressBar{
  302. u32 progressBar;
  303. }S_MEDIA_PROGRESS_BAR;
  304. //0x00010037
  305. typedef struct ConnectException
  306. {
  307. u32 exceptionType;
  308. }S_CONNECTION_EXCEPTION;
  309. //0x00010038
  310. //0x00010039
  311. //0x00010040
  312. typedef struct BTHfpRequest{
  313. u32 command;
  314. string phoneNum;
  315. u32 dtmfCode;
  316. }S_BT_HFP_REQUEST;
  317. //0x00018041
  318. typedef struct BTHfpIndication{
  319. u32 state;
  320. string phoneNum;
  321. string name;
  322. string address;
  323. }S_BT_HFP_INDICATION;
  324. //0x00018042
  325. typedef struct BTHfpConnection{
  326. u32 state;
  327. string address;
  328. string name;
  329. }S_BT_HFP_CONNECTION;
  330. //0x00018043
  331. //0x00010044
  332. //0x00018045
  333. //0x00018046
  334. typedef struct MobileCarLifeInfo{
  335. u32 moduleID;
  336. bool supportFlag;
  337. u32 frequency;
  338. struct MobileCarLifeInfo *pNext;
  339. }S_MOBILE_CARLIFE_INFO;
  340. typedef struct SubscribeMobileCarLifeInfoList{
  341. u32 cnt;
  342. S_MOBILE_CARLIFE_INFO *pMobileCarLifeInfo;
  343. }S_SUBSCRIBE_MOBILE_CARLIFE_INFO_LIST;
  344. //0x00010047
  345. typedef struct NaviAssitantGuideInfo{
  346. u32 action;
  347. u32 assistantType;
  348. u32 trafficSignType;
  349. u32 totalDistance;
  350. u32 remainDistance;
  351. u32 cameraSpeed;
  352. }S_NAVI_ASSITANT_GUIDE_INFO;
  353. //0x00018048
  354. typedef struct AuthenRequest{
  355. string randomValue;
  356. }S_AUTHEN_REQUEST;
  357. //0x00010049
  358. typedef struct AuthenResponse{
  359. string encryptValue;
  360. }S_AUTHEN_RESPONSE;
  361. //0x0001004A
  362. typedef struct HUAuthenResult{
  363. bool authenResult;
  364. }S_HU_AUTHEN_RESULT;
  365. //0x0001804B
  366. typedef struct MDAuthenResult{
  367. bool authenResult;
  368. }S_MD_AUTHEN_RESULT;
  369. //0x0001004C
  370. //none
  371. //0x0001004D
  372. typedef struct BTStartPairReq{
  373. u32 osType;
  374. string address;
  375. }S_BT_START_PAIR_REQ;
  376. //0x0001804E
  377. typedef struct BTHfpResponse{
  378. u32 status;
  379. u32 cmd;
  380. u32 dtmfCode;
  381. }S_BT_HFP_RESPONSE;
  382. //0x0001004F
  383. typedef struct BTHfpStatusRequest{
  384. u32 type;
  385. }S_BT_HFP_STATUS_REQUEST;
  386. //0x00018050
  387. typedef struct BTHfpStatusResponse{
  388. u32 status;
  389. u32 type;
  390. }S_BT_HFP_STATUS_RESPONSE;
  391. //0x00018051
  392. //none
  393. //0x00018052
  394. typedef struct FeatureConfig{
  395. string key;
  396. u32 value;
  397. struct FeatureConfig *pNext;
  398. }S_FEATURE_CONFIG;
  399. typedef struct FeatureConfigList{
  400. u32 cnt;
  401. S_FEATURE_CONFIG *pFeatureConfig;
  402. }S_FEATURE_CONFIG_LIST;
  403. //0x00018053
  404. typedef struct BTStartIdentifyReq{
  405. string address;
  406. }S_BT_START_IDENTIFY_REQ;
  407. //0x00010054
  408. typedef struct BTIdentifyResultInd{
  409. u32 status;
  410. string address;
  411. }S_BT_INDENTIFY_RESULT_IND;
  412. //0x00018055
  413. typedef struct ErrorCode{
  414. string errorCode;
  415. }S_ERROR_CODE;
  416. //0x00010058
  417. typedef struct BtHfpCallStatusCover{
  418. int callStatus;
  419. string phoneNum;
  420. string name;
  421. }S_CALL_STATUS_COVER;
  422. }
  423. namespace CCarLifeLibH{
  424. using namespace CommonUtilH;
  425. /**********************************************************
  426. CLASS
  427. **********************************************************/
  428. class CCarLifeLib{
  429. public:
  430. ~CCarLifeLib();
  431. /*==============================================
  432. initialization process
  433. ===============================================*/
  434. static CCarLifeLib* getInstance();
  435. int carLifeLibInit();
  436. void carLifeLibDestory();
  437. /*=====================================================
  438. connection/disconnection between head unit and mobile phone
  439. =======================================================*/
  440. int connectionSetup();
  441. int connectionSetup(string mdIP);
  442. int connectionSetup(string mdIP, string interfaceName);
  443. int connectionSetupEap();
  444. int connectionSetupAOA(int idVendor);
  445. bool InitializeAOA();
  446. bool FreeEap();
  447. bool FreeAOA();
  448. bool CloseSocket();
  449. bool EapHeartbeat();
  450. void disconnect();
  451. /*==============================================================
  452. command channel: send method && receive call back register method
  453. ===============================================================*/
  454. int cmdHUProtoclVersion(S_HU_PROTOCOL_VERSION* version);
  455. int cmdHUInfro(S_HU_INFO* huInfo);
  456. int cmdHUBTPairInfro(S_BT_PAIR_INFO* info);
  457. int cmdVideoEncoderInit(S_VIDEO_ENCODER_INIT* initParam);
  458. int cmdVideoEncoderStart();
  459. int cmdVideoEncoderPause();
  460. int cmdVideoEncoderReset();
  461. int cmdVideoEncoderFrameRateChange(S_VIDEO_ENCODER_FRAME_RATE_CHANGE* videoParam);
  462. int cmdPauseMedia();
  463. int cmdCarVelocity(S_CAR_VELOCITY* carVelocity);
  464. int cmdCarGPS(S_CAR_GPS* cps);
  465. int cmdCarGyroscope(S_CAR_GYROSCOPE* cyro);
  466. int cmdCarAcceleration(S_CAR_ACCELERATION* acceleration);
  467. int cmdCarOil(S_CAR_OIL*);
  468. int cmdLaunchModeNormal();
  469. int cmdLaunchModePhone();
  470. int cmdLaunchModeMap();
  471. int cmdLaunchModeMusic();
  472. int cmdReceiveOperation();
  473. void cmdRegisterProtocolVersionMatchStatus(void (*pFunc)(S_PROTOCOL_VERSION_MATCH_SATUS*));
  474. void cmdRegisterMDInfro(void (*pFunc)(S_MD_INFO*));
  475. // void cmdRegisterMDBTPairInfro(void (*pFunc)(S_BT_PAIR_INFO*));
  476. void cmdRegisterMDBTPairInfro(void (*pFunc)(S_MD_BT_PAIR_INFO*));
  477. void cmdRegisterVideoEncoderInitDone(void (*pFunc)(S_VIDEO_ENCODER_INIT_DONE*));
  478. void cmdRegisterVideoEncoderFrameRateChangeDone(void (*pFunc)(S_VIDEO_ENCODER_FRAME_RATE_CHANGE_DONE*));
  479. void cmdRegisterTelStateChangeIncoming(void (*pFunc)(void));
  480. void cmdRegisterTelStateChangeOutGoing(void (*pFunc)(void));
  481. void cmdRegisterTelStateChangeIdle(void (*pFunc)(void));
  482. void cmdRegisterTelStateChangeInCalling(void (*pFunc)(void));
  483. void cmdRegisterScreenOn(void (*pFunc)(void));
  484. void cmdRegisterScreenOff(void (*pFunc)(void));
  485. void cmdRegisterScreenUserPresent(void (*pFunc)(void));
  486. void cmdRegisterForeground(void (*pFunc)(void));
  487. void cmdRegisterBackground(void (*pFunc)(void));
  488. void cmdRegisterGoToDeskTop(void (*pFunc)(void));
  489. void cmdRegisterMicRecordWakeupStart(void (*pFunc)(void));
  490. void cmdRegisterMicRecordEnd(void (*pFunc)(void));
  491. void cmdRegisterMicRecordRecogStart(void (*pFunc)(void));
  492. //added on 9th Semptember 2015
  493. //0x00018025
  494. int cmdGoToForeground();
  495. //0x00010026
  496. void cmdRegisterModuleStatus(void (*pFunc)(S_MODULE_STATUS_LIST_MOBILE*));
  497. //0x00018027
  498. int cmdStatisticInfo(S_STATISTICS_INFO*);
  499. //0x00018028
  500. int cmdModuleControl(S_MODULE_STATUS_CONTROL*);
  501. //0x00018029
  502. int cmdCarDataGear(S_GEAR_INFO*);
  503. //0x00010030
  504. void cmdRegisterNaviNextTurnInfo(void (*pFunc)(S_NAVI_NEXT_TURN_INFO*));
  505. //0x00010031
  506. void cmdRegisterCarDataSubscribe(void (*pFunc)(S_VEHICLE_INFO_LIST*));
  507. //0x00018032
  508. int cmdCarDataSubscribeDone(S_VEHICLE_INFO_LIST*);
  509. //0x00010033
  510. void cmdRegisterCarDataSubscribeStart(void (*pFunc)(S_VEHICLE_INFO_LIST*));
  511. //0x00010034
  512. void cmdRegisterCarDataSubscribeStop(void (*pFunc)(S_VEHICLE_INFO_LIST*));
  513. //0x00010035
  514. void cmdRegisterMediaInfo(void (*pFunc)(S_MEDIA_INFO*));
  515. //0x00010036
  516. void cmdRegisterMediaProgressBar(void (*pFunc)(S_MEDIA_PROGRESS_BAR*));
  517. //0x00010037
  518. void cmdRegisterConnectException(void (*pFunc)(S_CONNECTION_EXCEPTION*));
  519. //0x00010038
  520. void cmdRegisterRequestGoToForeground(void (*pFunc)(void));
  521. //0x00010039
  522. void cmdRegisterUIActionSound(void (*pFunc)(void));
  523. //added on 5th January 2016
  524. //0x00010040
  525. void cmdRegisterBtHfpRequest(void (*pFunc)(S_BT_HFP_REQUEST*));
  526. //0x00018041
  527. int cmdBtHfpIndication(S_BT_HFP_INDICATION*);
  528. //0x00018042
  529. int cmdBtHfpConnection(S_BT_HFP_CONNECTION*);
  530. //0x00018043
  531. int cmdCarLifeDataSubscribe(S_SUBSCRIBE_MOBILE_CARLIFE_INFO_LIST*);
  532. //0x00010044
  533. void cmdRegisterCarLifeDataSubscribeDone(void (*pFunc)(S_SUBSCRIBE_MOBILE_CARLIFE_INFO_LIST*));
  534. //0x00018045
  535. int cmdCarLifeDataSubscribeStart(S_SUBSCRIBE_MOBILE_CARLIFE_INFO_LIST*);
  536. //0x00018046
  537. int cmdCarLifeDataSubscribeStop(S_SUBSCRIBE_MOBILE_CARLIFE_INFO_LIST*);
  538. //0x00010047
  539. void cmdRegisterNaviAssistantGuideInfo(void (*pFunc)(S_NAVI_ASSITANT_GUIDE_INFO*));
  540. //0x00018048
  541. int cmdHuAuthenRequest(S_AUTHEN_REQUEST*);
  542. //0x00010049
  543. void cmdRegisterMdAuthenResponse(void (*pFunc)(S_AUTHEN_RESPONSE*));
  544. //0x0001804A
  545. int cmdHuAuthenResult(S_HU_AUTHEN_RESULT*);
  546. //0x0001804B
  547. void cmdRegisterMdAuthenResult(void (*pFunc)(S_MD_AUTHEN_RESULT*));
  548. //0x0001004C
  549. void cmdRegisterGotoForgroundResponse(void (*pFunc)(void));
  550. //0x0001004D
  551. void cmdRegisterStartBtAutoPairRequest(void (*pFunc)(S_BT_START_PAIR_REQ*));
  552. //0x0001804E
  553. int cmdBTHfpResponse(S_BT_HFP_RESPONSE*);
  554. //0x0001004F
  555. void cmdRegisterBTHfpStatusRequest(void (*pFunc)(S_BT_HFP_STATUS_REQUEST*));
  556. //0x00018050
  557. int cmdBTHfpStatusResponse(S_BT_HFP_STATUS_RESPONSE*);
  558. //added on 3th March 2016
  559. //0x00010051
  560. void cmdRegisterFeatureConfigRequest(void (*pFunc)(void));
  561. //0x00018052
  562. int cmdFeatureConfigResponse(S_FEATURE_CONFIG_LIST*);
  563. //0x00018053
  564. int cmdBTStartIdentifyReq(S_BT_START_IDENTIFY_REQ*);
  565. //0x00010054
  566. void cmdRegisterBTIdentifyResultInd(void (*pFunc)(S_BT_INDENTIFY_RESULT_IND*));
  567. //0x00018055
  568. int cmdErrorCode(S_ERROR_CODE*);
  569. // added on 31th October 2016
  570. //0x00018056
  571. int cmdVideoEncoderJPEG();
  572. //0x00010057
  573. void cmdRegisterVideoEncoderJPEGAck(void (*pFunc)(void));
  574. //0x00010058(Deprecated)
  575. void cmdRegisterBtHfpCallStatusCover(void (*pFunc)(S_CALL_STATUS_COVER*));
  576. //0x00010059
  577. void cmdRegisterMdExit(void (*pFunc)(void));
  578. /*=============================================================
  579. video channel: receive call back register method
  580. ==============================================================*/
  581. int videoReceiveOperation();
  582. void videoRegisterDataReceive(void (*pFunc)(u8 *data, u32 len));
  583. void videoRegisterHeartBeat(void (*pFunc)(void));
  584. static void* ThreadHeartBeat(void *me);
  585. /*=============================================================
  586. media channel: receive call back register method
  587. ==============================================================*/
  588. int mediaReceiveOperation();
  589. void mediaRegisterInit(void (*pFunc)(S_AUDIO_INIT_PARAMETER*));
  590. void mediaRegisterNormalData(void (*pFunc)(u8 *data, u32 len));
  591. void mediaRegisterStop(void (*pFunc)(void));
  592. void mediaRegisterPause(void (*pFunc)(void));
  593. void mediaRegisterResume(void (*pFunc)(void));
  594. void mediaRegisterSeek(void (*pFunc)(void));
  595. /*=============================================================
  596. tts channel: receive call back register method
  597. ==============================================================*/
  598. int ttsReceiveOperation();
  599. void ttsRegisterInit(void (*pFunc)(S_AUDIO_INIT_PARAMETER*));
  600. void ttsRegisterNormalData(void (*pFunc)(u8 *data, u32 len));
  601. void ttsRegisterStop(void (*pFunc)(void));
  602. /*=============================================================
  603. vr channel: send method
  604. ==============================================================*/
  605. int sendVRRecordData(u8* data, u32 size, u32 timeStamp);
  606. int vrReceiveOperation();
  607. void vrRegisterInit(void (*pFunc)(S_AUDIO_INIT_PARAMETER*));
  608. void vrRegisterNormalData(void (*pFunc)(u8 *data, u32 len));
  609. void vrRegisterStop(void (*pFunc)(void));
  610. /*=============================================================
  611. control channel: send method
  612. ==============================================================*/
  613. int ctrlTouchAction(S_TOUCH_ACTION* touchAction);
  614. int ctrlTouchActionDown(S_TOUCH_ACTION_DOWN* touchActionDown);
  615. int ctrlTouchActionUp(S_TOUCH_ACTION_UP* touchActionUp);
  616. int ctrlTouchActionMove(S_TOUCH_ACTION_MOVE* touchActionMove);
  617. int ctrlTouchSigleClick(S_TOUCH_SIGNAL_CLICK* touchSingleClick);
  618. int ctrlTouchDoubleClick(S_TOUCH_DOUBLE_CLICK* touchDoubleClick);
  619. int ctrlTouchLongPress(S_TOUCH_LONG_PRESS* touchLongPress);
  620. int ctrlTouchCarHardKeyCode(S_TOUCH_CAR_HARD_KEY_CODE* touchCarHardKeyCode);
  621. int ctrlReceiveOperation();
  622. void ctrlRegisterUIActionSound(void (*pFunc)(void));
  623. int EapHeadReceiveOperation();
  624. int AoaHeadReceiveOperation();
  625. private:
  626. CCarLifeLib();
  627. static CCarLifeLib* pInstance;
  628. };
  629. }
  630. #endif