mid_dtvci.h 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244
  1. #ifndef __MID_DTVCI_H__
  2. #define __MID_DTVCI_H__
  3. #include <sys/time.h>
  4. #include "mid_dtvci_types.h"
  5. /* ID_CAM_STATUS */
  6. typedef enum __E_CAM_STATUS
  7. {
  8. CAM_REMOVE = 0,
  9. CAM_INSERT,
  10. CAM_INSERT_ERROR,
  11. CAM_READY,
  12. CAM_AUTH_START,
  13. CAM_AUTH_VERIFIED,
  14. CAM_AUTH_ERROR,
  15. } E_CAM_STATUS;
  16. /* ID_CA_SYSTEM */
  17. typedef struct __S_CA_SYSTEM
  18. {
  19. U16BIT *ca_ids;
  20. U8BIT num_ca_ids;
  21. } S_CA_SYSTEM;
  22. /* ID_APP_INFO */
  23. typedef struct __S_APP_INFO
  24. {
  25. U8BIT *module_name;
  26. U8BIT app_type;
  27. U16BIT app_manf;
  28. U16BIT manf_code;
  29. U8BIT* menu_string;
  30. } S_APP_INFO;
  31. /* ID_MMI_SCREEN */
  32. typedef struct __S_MMI_SCREEN
  33. {
  34. U8BIT event;
  35. U8BIT screen_type;
  36. /* Alowed screen types:
  37. STB_NO_CI_SCREEN 0
  38. STB_CI_MENU_LIST_SCREEN 1
  39. STB_CI_ENQUIRY_SCREEN 2
  40. */
  41. /* For Menu/List screen */
  42. BOOLEAN bMenuList; // TRUE: menu, FALSE: list
  43. U8BIT *title;
  44. U8BIT *subtitle;
  45. U8BIT item_num;
  46. U8BIT **item_text;
  47. U8BIT *bottom_text;
  48. /* For Enquiry screen */
  49. BOOLEAN bBlind;
  50. U8BIT *enq_text;
  51. U8BIT enq_len;
  52. /* For Close screen*/
  53. U8BIT close_delay;
  54. } S_MMI_SCREEN;
  55. /* ID_HC_TUNE */
  56. typedef struct __S_HC_TUNE
  57. {
  58. U16BIT nid;
  59. U16BIT onid;
  60. U16BIT tsid;
  61. U16BIT sid;
  62. } S_HC_TUNE;
  63. #if 1//ci+_14
  64. /* ID_HC_TUNE_LCN */
  65. typedef struct __S_HC_TUNE_LCN
  66. {
  67. U8BIT quietly_flag;
  68. U8BIT app_running_flag;
  69. U16BIT Lcn;
  70. } S_HC_TUNE_LCN;
  71. /* ID_HC_TUNE_TRIPLET */
  72. typedef struct __S_HC_TUNE_TRIPLET
  73. {
  74. U8BIT quietly_flag;
  75. U8BIT app_running_flag;
  76. U16BIT onid;
  77. U16BIT tsid;
  78. U16BIT sid;
  79. U8BIT desc_tag;
  80. U8BIT desc_tag_extension;
  81. } S_HC_TUNE_TRIPLET;
  82. /* ID_HC_TUNE_BROADCAST */
  83. typedef struct __S_HC_TUNE_BROADCAST
  84. {
  85. U8BIT tune_quietly_flag;
  86. U8BIT keep_app_running_flag;
  87. U16BIT service_id;
  88. U16BIT desc_loop_len;
  89. U8BIT *desc_loop;
  90. U8BIT *pmt;
  91. } S_HC_TUNE_BROADCAST;
  92. #else
  93. /* ID_HC_TUNE_BROADCAST */
  94. typedef struct __S_HC_TUNE_BROADCAST
  95. {
  96. U16BIT service_id;
  97. U16BIT desc_loop_len;
  98. U8BIT *desc_loop;
  99. U8BIT *pmt;
  100. } S_HC_TUNE_BROADCAST;
  101. #endif
  102. typedef struct __S_HC_TUNE_STATUS_DSD
  103. {
  104. U8BIT connected_flag;
  105. U8BIT delivery_system_descriptor_tag;
  106. U8BIT descriptor_tag_extension;
  107. } S_HC_TUNER_STATUS_DSD;
  108. typedef struct __S_HC_TUNER_STATUS
  109. {
  110. U8BIT IP_tune_capable_flag;
  111. U8BIT num_dsd;
  112. S_HC_TUNER_STATUS_DSD dsd[6];
  113. } S_HC_TUNER_STATUS;
  114. /* ID_HC_REPLACE */
  115. typedef struct __S_HC_REPLACE
  116. {
  117. BOOLEAN bReplaceClear; // TRUE: replace, FALSE: clear
  118. U8BIT ref; // for replace and clear
  119. U16BIT replaced_pid; // for replace only
  120. U16BIT replacement_pid;// for replace only
  121. } S_HC_REPLACE;
  122. /* ID_HOST_COUNTRY */
  123. typedef struct __S_COUNTRY
  124. {
  125. U8BIT *country;
  126. } S_COUNTRY;
  127. /* ID_HOST_LANGUAGE */
  128. typedef struct __S_LANGUAGE
  129. {
  130. U8BIT *language;
  131. } S_LANGUAGE;
  132. /* ID_OP_STATUS */
  133. /* Check S_STB_CI_OPERATOR_STATUS */
  134. /* ID_OP_INFO */
  135. typedef struct __S_OP_INFO
  136. {
  137. U8BIT info_version;
  138. S_STB_CI_OPERATOR_INFO *info;
  139. } S_OP_INFO;
  140. /* ID_OP_TUNE */
  141. typedef struct __S_OP_TUNE
  142. {
  143. U16BIT desc_loop_len;
  144. U8BIT *desc_loop;
  145. } S_OP_TUNE;
  146. /* ID_OP_SEARCH_STATUS */
  147. /* check S_STB_CI_OPERATOR_STATUS */
  148. /* ID_OP_NIT */
  149. typedef struct __S_OP_NIT
  150. {
  151. U16BIT nit_loop_length;
  152. U8BIT *nit_sections;
  153. } S_OP_NIT;
  154. /* ID_AUTH_DATA_READ and ID_AUTH_DATA_WRITE */
  155. typedef struct __S_AUTH_DATA
  156. {
  157. U8BIT *buf;
  158. U32BIT bufsz;
  159. } S_AUTH_DATA;
  160. /* CI -> APP Callback Id */
  161. typedef enum __E_CI_CALLBACK
  162. {
  163. ID_CAM_STATUS = 0,
  164. ID_CA_SYSTEM,
  165. ID_APP_INFO,
  166. ID_MMI_SCREEN,
  167. ID_HC_TUNE,
  168. ID_HC_TUNE_BROADCAST,
  169. ID_HC_REPLACE,
  170. ID_HOST_COUNTRY,
  171. ID_HOST_LANGUAGE,
  172. ID_OP_STATUS,
  173. ID_OP_INFO,
  174. ID_OP_TUNE,
  175. ID_OP_SEARCH_STATUS,
  176. ID_OP_NIT,
  177. ID_AUTH_DATA_READ,
  178. ID_AUTH_DATA_WRITE,
  179. ID_APP_MMI_START,
  180. ID_APP_MMI_STOP,
  181. ID_GET_STACK_PATCH,
  182. ID_HC_TUNE_LCN,
  183. ID_HC_TUNE_TRIPLET,
  184. ID_HC_TUNE_STATUS,
  185. ID_APP_INFO_HDS,
  186. ID_APP_INFO_COPYPROTECT,
  187. } E_CI_CALLBACK;
  188. /* ID_APPMMI_REQUEST_START */
  189. typedef struct __S_APPMMI_REQ_START
  190. {
  191. U8BIT *app_domain;
  192. U8BIT domain_length;
  193. U8BIT *initial_object;
  194. U8BIT object_length;
  195. } S_APPMMI_REQ_START;
  196. /* ID_APPMMI_FILE_ACK */
  197. typedef struct __S_APPMMI_FILE_ACK
  198. {
  199. BOOLEAN file_ok;
  200. U8BIT *data;
  201. U32BIT len;
  202. } S_APPMMI_FILE_ACK;
  203. /* ID_APPMMI_NOTIFY_ABORT */
  204. typedef struct __S_APPMMI_NOTIFY_ABORT
  205. {
  206. U8BIT *code;
  207. U32BIT length;
  208. } S_APPMMI_NOTIFY_ABORT;
  209. typedef enum __E_CI_APMMI_CALLBACK
  210. {
  211. ID_APPMMI_REQUEST_START,
  212. ID_APPMMI_FILE_ACK,
  213. ID_APPMMI_NOTIFY_ABORT,
  214. } E_CI_APMMI_CALLBACK;
  215. typedef enum __E_APP_STATE
  216. {
  217. ENTER_DTV_SRC,
  218. LEAVE_DTV_SRC,
  219. ENTER_CHANNEL,
  220. QUICK_ENTER_CHANNEL,
  221. LEAVE_CHANNEL,
  222. DTV_SCAN_CHANNEL,
  223. ENTER_BISS_CHANNEL,
  224. DTV_LEAVE_SCAN_CHANNEL,
  225. } E_APP_STATE;
  226. typedef enum __E_APPMMI_SSM
  227. {
  228. APPMMI_SSM_0 = 0,
  229. APPMMI_SSM_1,
  230. APPMMI_SSM_2,
  231. APPMMI_SSM_NONE = 2,
  232. } E_APPMMI_SSM;
  233. typedef enum __E_APPMMI_STATE
  234. {
  235. ST_APPMMI_STOPPED,
  236. ST_APPMMI_STARTED
  237. } E_APPMMI_STATE;
  238. /* ID_PVRTS_APPLY_URI */
  239. typedef struct __S_PVRTS_APPLY_URI
  240. {
  241. U16BIT sid;
  242. S_STB_CI_URI uri;
  243. } S_PVRTS_APPLY_URI;
  244. /* ID_PVRTS_NOTICE_RECORD_LICENSE */
  245. typedef struct __S_PVRTS_RECORD_LICENSE
  246. {
  247. U16BIT program_number;
  248. S_STB_CI_URI *uri;
  249. U8BIT *license;
  250. U16BIT license_len;
  251. } S_PVRTS_RECORD_LICENSE;
  252. /* ID_PVRTS_NOTICE_PIN_EVENT */
  253. typedef struct __S_PVRTS_PIN_EVENT
  254. {
  255. U16BIT program_number;
  256. U8BIT rating;
  257. time_t datetime;
  258. U8BIT private_data[15];
  259. E_STB_CI_PIN_STATUS status;
  260. } S_PVRTS_PIN_EVENT;
  261. typedef enum
  262. {
  263. ID_PVRTS_APPLY_URI,
  264. ID_PVRTS_NOTICE_RECORD_LICENSE,
  265. ID_PVRTS_NOTICE_PIN_EVENT,
  266. } E_PVRTS_CALLBACK;
  267. /* ID_SAS_CNF_CONN */
  268. typedef struct __S_SAS_CNF_CONN
  269. {
  270. U8BIT *app_id;
  271. U8BIT status;
  272. } S_SAS_CNF_CONN;
  273. /* ID_SAS_OIPF_REPLY_MSG */
  274. typedef struct __S_SAS_OIPF_REPLY_MSG
  275. {
  276. U16BIT ca_system_id;
  277. U32BIT transaction_id;
  278. U8BIT status;
  279. U8BIT *ca_info;
  280. U16BIT ca_info_len;
  281. } S_SAS_OIPF_REPLY_MSG;
  282. /* ID_SAS_OIPF_PARENTAL_CONTROL_INFO */
  283. typedef struct __S_SAS_OIPF_PARENTAL_CONTROL_INFO
  284. {
  285. U16BIT ca_system_id;
  286. S_STB_CI_OIPF_PARENTAL_CONTROL_INFO *info;
  287. } S_SAS_OIPF_PARENTAL_CONTROL_INFO;
  288. /* ID_SAS_OIPF_RIGHTS_INFO */
  289. typedef struct __S_SAS_OIPF_RIGHTS_INFO
  290. {
  291. U16BIT ca_system_id;
  292. U8BIT access_status;
  293. U8BIT *rights_issuer_url;
  294. U16BIT url_len;
  295. } S_SAS_OIPF_RIGHTS_INFO;
  296. /* ID_SAS_OIPF_SYSTEM_INFO */
  297. typedef struct __S_SAS_OIPF_SYSTEM_INFO
  298. {
  299. U16BIT ca_system_id;
  300. U8BIT *ca_info;
  301. U16BIT ca_info_len;
  302. } S_SAS_OIPF_SYSTEM_INFO;
  303. typedef enum
  304. {
  305. ID_SAS_NOTIFY_CAM_STATUS,
  306. ID_SAS_CNF_CONN,
  307. ID_SAS_OIPF_REPLY_MSG,
  308. ID_SAS_OIPF_PARENTAL_CONTROL_INFO,
  309. ID_SAS_OIPF_RIGHTS_INFO,
  310. ID_SAS_OIPF_SYSTEM_INFO,
  311. } E_SAS_CALLBACK;
  312. /** ci protection data struct */
  313. typedef struct
  314. {
  315. U8BIT u8hasShunningData;
  316. U8BIT u8freeCiModeFlag;
  317. U8BIT u8matchBrandFlag;
  318. U8BIT u8numberOfEntries;
  319. U16BIT u16entries[2];//DB_DVB_MAX_SRV_MAX_CICAM_BRANDS
  320. } S_CI_Protection_t;
  321. #define MAX_CICAM_BRANDS 126
  322. typedef struct ci_protection
  323. {
  324. BOOLEAN free_ci_mode_flag;
  325. BOOLEAN match_brand_flag;
  326. U8BIT number_of_entries;
  327. U16BIT entries[MAX_CICAM_BRANDS];
  328. } S_CI_PROTECTION;
  329. /* ci shunning data define */
  330. #define CA_SHUNNING_INVALID 0x0
  331. #define CA_SHUNNING_PRESENT 0x1
  332. #define CA_SHUNNING_ABSENT 0x2
  333. /*****************************************************************************
  334. * FUNDAMENTAL FUNCTIONS
  335. ****************************************************************************/
  336. /*****************************************************************************
  337. * Function Name: MID_DTVCI_RegistAppCallback
  338. * Description: Application regists callback function for CI+ Stack
  339. * Parameters: pfCallBack - pointer of callback function
  340. * Returns: Nothing
  341. *****************************************************************************/
  342. typedef void* (*CIAPP_CallBack)(E_CI_CALLBACK id, void * param);
  343. void MID_DTVCI_RegistAppCallback(CIAPP_CallBack pfCallBack);
  344. /*****************************************************************************
  345. * Function Name: MID_DTVCI_RegistAPMMICallback
  346. * Description: Mheg engine regists callback function for CI+ Stack
  347. * Parameters: pfCallBack - pointer of callback function
  348. * Returns: Nothing
  349. *****************************************************************************/
  350. typedef void* (*CIMHEG_CallBack)(E_CI_APMMI_CALLBACK id, void * param);
  351. void MID_DTVCI_RegistAPMMICallback(CIMHEG_CallBack pfCallBack);
  352. /*****************************************************************************
  353. * Function Name: MID_DTVCI_RegistPVRTSCallback
  354. * Description: PVR regists callback function for CI+ Stack
  355. * Parameters: pfCallBack - pointer of callback function
  356. * Returns: Nothing
  357. *****************************************************************************/
  358. typedef void* (*CIPVRTS_CallBack)(E_PVRTS_CALLBACK id, void * param);
  359. void MID_DTVCI_RegistPVRTSCallback(CIPVRTS_CallBack pfCallBack);
  360. /*****************************************************************************
  361. * Function Name: MID_DTVCI_RegistPVRPlaybackCallback
  362. * Description: PVR regists playback callback function for CI+ Stack
  363. * Parameters: pfCallBack - pointer of callback function
  364. * Returns: Nothing
  365. *****************************************************************************/
  366. typedef void* (*CIPVR_Playback_CallBack)(E_STB_CI_PIN_STATUS id);
  367. void MID_DTVCI_RegistPVRPlaybackCallback(CIPVR_Playback_CallBack pfCallBack);
  368. /*****************************************************************************
  369. * Function Name: MID_DTVCI_RegistPVRLiveCallback
  370. * Description: PVR regists live callback function for CI+ Stack
  371. * Parameters: pfCallBack - pointer of callback function
  372. * Returns: Nothing
  373. *****************************************************************************/
  374. typedef void* (*CIPVR_Live_CallBack)(E_STB_CI_PIN_STATUS id);
  375. void MID_DTVCI_RegistPVRLiveCallback(CIPVR_Playback_CallBack pfCallBack);
  376. /*****************************************************************************
  377. * Function Name: MID_DTVCI_RegistPVRLicenseCallback
  378. * Description: PVR register license callback function for CI+ Stack
  379. * Parameters: pfCallBack - pointer of callback function
  380. * Returns: Nothing
  381. *****************************************************************************/
  382. typedef void *(*CIPVR_License_CallBack) (U8BIT status);
  383. void MID_DTVCI_RegistPVRLicenseCallback(CIPVR_License_CallBack pfCallBack);
  384. /*****************************************************************************
  385. * Function Name: MID_DTVCI_RegistSasCallback
  386. * Description: MHP regists callback function for CI+ Stack
  387. * Parameters: pfCallBack - pointer of callback function
  388. * Returns: Nothing
  389. *****************************************************************************/
  390. typedef void* (*CISAS_CallBack)(E_SAS_CALLBACK id, void * param);
  391. void MID_DTVCI_RegistCISASCallback(CISAS_CallBack pfCallBack);
  392. /*****************************************************************************
  393. * Function Name: MID_DTVCI_Initialise
  394. * Description: Initialises system control task
  395. * Parameters:
  396. * Returns: Nothing
  397. *****************************************************************************/
  398. void MID_DTVCI_Initialize(void);
  399. /*****************************************************************************
  400. * Function Name: MID_DTVCI_IsStackInit
  401. * Description: Check if initialises system control task
  402. * Parameters:
  403. * Returns: TRUE when system initial
  404. *****************************************************************************/
  405. BOOLEAN MID_DTVCI_IsStackInit(void);
  406. /*****************************************************************************
  407. * Function Name: MID_DTVCI_NotifyInfo
  408. * Description: Notify CI+ stack the current application status
  409. * Parameters: E_APP_STATE
  410. * Returns: Nothing
  411. *****************************************************************************/
  412. void MID_DTVCI_NotifyInfo(E_APP_STATE state);
  413. /*****************************************************************************
  414. * Function Name: MID_DTVCI_PassCIProtectionDesc
  415. * Description: Bypass ci protection descriptor to CI+ Stack after service
  416. * changed
  417. * Parameters: ci_protection_desc - ci protection descriptor
  418. * Returns: Nothing
  419. *****************************************************************************/
  420. void MID_DTVCI_PassCIProtectionDesc(U8BIT *ci_protection_descriptor,S_CI_PROTECTION *reCiProtectDesc);
  421. void MID_DTVCI_SetPSIUpdateFlag(BOOLEAN bupdateflag,BOOLEAN resetflag);
  422. /*****************************************************************************
  423. * Function Name: MID_DTVCI_IsCAMInserted
  424. * Description: Check if CAM is inserted and ready
  425. * Parameters:
  426. * Returns: TRUE when cam is inserted and ready
  427. *****************************************************************************/
  428. BOOLEAN MID_DTVCI_IsCAMInserted(void);
  429. /*****************************************************************************
  430. * Function Name: MID_DTVCI_IsCIPlusCAM
  431. * Description: Check if the current inserted CAM is a CI Plus CAM
  432. * Parameters:
  433. * Returns: TRUE for CI+ CAM, otherwise CI only CAM.
  434. *****************************************************************************/
  435. BOOLEAN MID_DTVCI_IsCIPlusCAM(void);
  436. /*****************************************************************************
  437. * Function Name: MID_DTVCI_IsCurServiceScrambled
  438. * Description: Check if the current service is scrambled or not
  439. * Parameters:
  440. * Returns: TRUE for scramble, otherwise FALSE
  441. *****************************************************************************/
  442. BOOLEAN MID_DTVCI_IsCurServiceScrambled(void);
  443. /*****************************************************************************
  444. * CI+ KEY RELATIVE FUNCTIONS
  445. ****************************************************************************/
  446. /*****************************************************************************
  447. * Function Name: MID_DTVCI_UpdateCIPlusKey
  448. * Description: Update CI+ host key from nvm again.
  449. * Parameters:
  450. * Returns: Nothing
  451. *****************************************************************************/
  452. void MID_DTVCI_UpdateCIPlusKey(void);
  453. /*****************************************************************************
  454. * Function Name: MID_DTVCI_IsValidKey
  455. * Description: Check if current CI+ host key is valid or not.
  456. * Parameters:
  457. * Returns: TRUE if it's valid, otherwise FALSE.
  458. *****************************************************************************/
  459. BOOLEAN MID_DTVCI_IsValidKey(void);
  460. /*****************************************************************************
  461. * Function Name: MID_DTVCI_IsProductKey
  462. * Description: Check if current CI+ host key is a product key or not.
  463. * Parameters:
  464. * Returns: TRUE if it's valid, otherwise FALSE.
  465. *****************************************************************************/
  466. BOOLEAN MID_DTVCI_IsProductKey(void);
  467. /*****************************************************************************
  468. * Function Name: MID_DTVCI_GetKeyID
  469. * Description: Return CI+ key device id
  470. * Parameters: serial_no - 8 bytes data will be filled if succeeded.
  471. * Returns: TRUE if operation succeeded, FALSE otherwise
  472. *****************************************************************************/
  473. BOOLEAN MID_DTVCI_GetKeyID(U8BIT *id);
  474. /*****************************************************************************
  475. * Function Name: MID_DTVCI_GetKeySerialNo
  476. * Description: Return CI+ key serial no.
  477. * Parameters: serial_no
  478. * Returns: TRUE if operation succeeded, FALSE otherwise
  479. *****************************************************************************/
  480. BOOLEAN MID_DTVCI_GetKeySerialNo(U32BIT *serial_no);
  481. /*****************************************************************************
  482. * Function Name: MID_DTVCI_GetHostKeyValidDate
  483. * Description: Return CI+ key valid date
  484. * Parameters: Valid from 'year_from-mon_from-day_from' to
  485. * 'year_to-mon_to-day_to'
  486. * Returns: TRUE if operation succeeded, FALSE otherwise
  487. *****************************************************************************/
  488. BOOLEAN MID_DTVCI_GetHostKeyValidDate(
  489. U16BIT *year_from, U8BIT *mon_from, U8BIT *day_from,
  490. U16BIT *year_to, U8BIT *mon_to, U8BIT *day_to);
  491. /*****************************************************************************
  492. * Function Name: MID_DTVCI_GetBrandOrgName
  493. * Description: Return Brand Ceritficate Organization Name.
  494. * Parameters: String
  495. * Returns: TRUE if operation succeeded, FALSE otherwise
  496. *****************************************************************************/
  497. BOOLEAN MID_DTVCI_GetBrandOrgName(U8BIT org_name[65]);
  498. /*****************************************************************************
  499. * Function Name: MID_DTVCI_GetDevOrgName
  500. * Description: Return Device Ceritficate Organization Name.
  501. * Parameters: String
  502. * Returns: TRUE if operation succeeded, FALSE otherwise
  503. *****************************************************************************/
  504. BOOLEAN MID_DTVCI_GetDevOrgName(U8BIT org_name[65]);
  505. /*****************************************************************************
  506. * CONDITIONAL ACCESS SUPPORT FUNCTIONS
  507. ****************************************************************************/
  508. /*****************************************************************************
  509. * Function Name: MID_DTVCI_GetCINumCaSystems
  510. * Description: Returns the number of CA systems
  511. * Parameters:
  512. * Returns: Number of CA systems the module supports
  513. ****************************************************************************/
  514. U8BIT MID_DTVCI_GetCINumCaSystems(void);
  515. /*****************************************************************************
  516. * Function Name: MID_DTVCI_GetCICaSystem
  517. * Description: Returns the CA system ID for index
  518. * Parameters: index - specific one CA system ID
  519. * Returns: CA system ID
  520. ****************************************************************************/
  521. U16BIT MID_DTVCI_GetCICaSystem(U8BIT index);
  522. /*****************************************************************************
  523. * Function Name: MID_DTVCI_PassPMT
  524. * Description: Pass current service's PMT to module
  525. * Parameters: pmt pointer
  526. * Returns: Nothing
  527. ****************************************************************************/
  528. void MID_DTVCI_PassPMT(U8BIT *pmt);
  529. /*****************************************************************************
  530. * Function Name: MID_DTVCI_CheckCAService
  531. * Description: Check if the current service is a CA service or not.
  532. * Parameters: pmt pointer
  533. * Returns: TRUE for CA Service, FALSE for FTA service.
  534. ****************************************************************************/
  535. BOOLEAN MID_DTVCI_CheckCAService(U8BIT *pmt);
  536. /*****************************************************************************
  537. * APPLICATION INFORAMTION FUNCTIONS
  538. ****************************************************************************/
  539. /*****************************************************************************
  540. * Function Name: MID_DTVCI_GetCIModuleName
  541. * Description: Returns a pointer to the string containing the name of the
  542. * module
  543. * Parameters:
  544. * Returns: Pointer to the string
  545. ****************************************************************************/
  546. U8BIT * MID_DTVCI_GetCIModuleName(void);
  547. /*****************************************************************************
  548. * Function Name: MID_DTVCI_EnterCIMenu
  549. * Description: Sends enter menu message to the rlayer task
  550. * Parameters:
  551. * Returns: Nothing
  552. ****************************************************************************/
  553. void MID_DTVCI_EnterCIMenu(void);
  554. /*****************************************************************************
  555. * Function Name: MID_DTVCI_EnterCAMChannel
  556. * Description: Sends enter CAM virtual channel to the rlayer task
  557. * Parameters:
  558. * Returns: Nothing
  559. ****************************************************************************/
  560. void MID_DTVCI_EnterCAMChannel(void);
  561. /*****************************************************************************
  562. * Function Name: MID_DTVCI_Hds_Confirm
  563. * Description: Sends Hds confirm to the rlayer task
  564. * Parameters:
  565. * Returns: Nothing
  566. ****************************************************************************/
  567. void MID_DTVCI_Hds_Confirm(void);
  568. /*****************************************************************************
  569. * Function Name: MID_DTVCI_CAMPowerDownNotice
  570. * Description: Sends enter CAM power down notice to the rlayer task
  571. * Parameters:
  572. * Returns: Nothing
  573. ****************************************************************************/
  574. void MID_DTVCI_CAMPowerDownNotice(void);
  575. /*****************************************************************************
  576. * HIGH LEVEL MMI FUNCTIONS
  577. ****************************************************************************/
  578. /*****************************************************************************
  579. * Function Name: MID_DTVCI_SetCIMenuScreenResponse
  580. * Description: Called by the application to send the response to the menu
  581. * screen to the module
  582. * NB - This function will be called from the UI thread, and
  583. * not the CI thread. These threads may be executed on
  584. * different priorities, and hence some functionality in this
  585. * module may interrupt / be interrupted by other actions!
  586. * Parameters: response - entry number on list/menu or 0 for cancel
  587. * Returns: Nothing
  588. ****************************************************************************/
  589. void MID_DTVCI_SetCIMenuScreenResponse(U8BIT response);
  590. /*****************************************************************************
  591. * Function Name: MID_DTVCI_SetCIEnquiryScreenResponse
  592. * Description: Called by the application this function sends a message to
  593. * the rlayer to indicate the response to the enquiry screen
  594. * NB - This function will be called from the UI thread, and
  595. * not the CI thread. These threads may be executed on
  596. * different priorities, and hence some functionality in this
  597. * module may interrupt / be interrupted by other actions!
  598. * Parameters: ok_cancel - TRUE for OK, FALSE for cancel
  599. * response_str_ptr - pointer to the response string
  600. * Returns: Nothing
  601. ****************************************************************************/
  602. void MID_DTVCI_SetCIEnquiryScreenResponse(
  603. BOOLEAN ok_cancel, U8BIT * response_str_ptr);
  604. /*****************************************************************************
  605. * Function Name: MID_DTVCI_CloseCIScreen
  606. * Description: Called by the application to close the MMI session
  607. * NB - This function will be called from the UI thread, and
  608. * not the CI thread. These threads may be executed on
  609. * different priorities, and hence some functionality in this
  610. * module may interrupt / be interrupted by other actions!
  611. * Parameters:
  612. * Returns: Nothing
  613. ****************************************************************************/
  614. void MID_DTVCI_CloseCIScreen(void);
  615. /*****************************************************************************
  616. *
  617. * Function Name: MID_DTVCI_CISetDisplayCharacterTables
  618. *
  619. * Description: Called by the application, this function sets the display
  620. * character tables supported by the receiver.
  621. *
  622. * The tables are provided as a single string containing the
  623. * prefix byte(s) of encoded text strings as defined in
  624. * annex A.2 of ETSI EN 300 468.
  625. *
  626. * For example, if ISO/IEC 8859-7 is supported by the receiver,
  627. * then text strings starting with 0x03 and with 0x10 0x00 0x07
  628. * are supported. In this case the string would be
  629. * "\x03\x10\x00\x07".
  630. *
  631. * NB - This function will be called from the UI
  632. * thread, and not the CI thread. These threads
  633. * may be executed on different priorities, and
  634. * hence some functionality in this module may
  635. * interrupt / be interrupted by other actions!
  636. *
  637. * Parameters: tables - display character tables
  638. * len - number of bytes in the tables string
  639. *
  640. * Returns: Nothing
  641. *
  642. ****************************************************************************/
  643. void MID_DTVCI_CISetDisplayCharacterTables(U8BIT *tables, U16BIT len);
  644. /*****************************************************************************
  645. *
  646. * Function Name: MID_DTVCI_CISetInputCharacterTables
  647. *
  648. * Description: Called by the application, this function sets the input
  649. * character tables supported by the receiver.
  650. *
  651. * The tables are provided as a single string containing the
  652. * prefix byte(s) of encoded text strings as defined in
  653. * annex A.2 of ETSI EN 300 468.
  654. *
  655. * For example, if ISO/IEC 8859-7 is supported by the receiver,
  656. * then text strings starting with 0x03 and with 0x10 0x00 0x07
  657. * are supported. In this case the string would be
  658. * "\x03\x10\x00\x07".
  659. *
  660. * NB - This function will be called from the UI
  661. * thread, and not the CI thread. These threads
  662. * may be executed on different priorities, and
  663. * hence some functionality in this module may
  664. * interrupt / be interrupted by other actions!
  665. *
  666. * Parameters: tables - input character tables
  667. * len - number of bytes in the tables string
  668. *
  669. * Returns: Nothing
  670. *
  671. ****************************************************************************/
  672. void MID_DTVCI_CISetInputCharacterTables(U8BIT *tables, U16BIT len);
  673. /*****************************************************************************
  674. * HOST CONTROL FUNCTIONS
  675. ****************************************************************************/
  676. /*****************************************************************************
  677. * Function Name: MID_DTVCI_CITuneReply
  678. * Description: This function is called by the host to send the status
  679. * of the tune operation to the module.
  680. * Parameters: status - tune operation status
  681. * Returns: TRUE if operation succeeded, FALSE otherwise
  682. ****************************************************************************/
  683. BOOLEAN MID_DTVCI_CITuneReply(E_STB_CI_TUNE_STATUS status);
  684. /*****************************************************************************
  685. * Function Name: MID_DTVCI_CITuneStatusReply
  686. * Description: This function is called by the host to send the status
  687. * of the tune operation to the module.
  688. * Parameters: status - tune operation status
  689. * Returns: TRUE if operation succeeded, FALSE otherwise
  690. ****************************************************************************/
  691. BOOLEAN MID_DTVCI_CITuneStatusReply(S_HC_TUNER_STATUS *status);
  692. /*****************************************************************************
  693. * APPLICATION MMI FUNCTIONS
  694. ****************************************************************************/
  695. /*****************************************************************************
  696. * Function Name: MID_DTVCI_GetAppMMIStatus
  697. * Description: Get current App MMI status
  698. * Parameters:
  699. * Returns: TRUE if App MMI is activated, FALSE otherwise
  700. ****************************************************************************/
  701. BOOLEAN MID_DTVCI_GetAppMMIStatus(void);
  702. /*****************************************************************************
  703. * Function Name: MID_DTVCI_GetAppMMISSM
  704. * Description: Get current SSM value
  705. * Parameters:
  706. * Returns: 'Set Subtitle Mode' from Application MMI
  707. ****************************************************************************/
  708. E_APPMMI_SSM MID_DTVCI_GetAppMMISSM(void);
  709. /*****************************************************************************
  710. * Function Name: MID_DTVCI_CIFileRequest
  711. * Description: Send a FileRequest message to the CI module.
  712. * Parameters: data - the file request message
  713. * length - length of file name
  714. * Returns: TRUE if operation succeeded, FALSE otherwise
  715. ****************************************************************************/
  716. BOOLEAN MID_DTVCI_CIFileRequest(U8BIT * data, U32BIT length);
  717. /*****************************************************************************
  718. * Function Name: MID_DTVCI_CISendAppAbortRequest
  719. * Description: Send an AppAbortRequest message to the CI module.
  720. * Parameters: code - abort code for request
  721. * length - length of abort code
  722. * Returns: TRUE if operation succeeded, FALSE otherwise
  723. ****************************************************************************/
  724. BOOLEAN MID_DTVCI_CISendAppAbortRequest(U8BIT * code, U32BIT length);
  725. /*****************************************************************************
  726. * Function Name: MID_DTVCI_NotifyAppMMIStatus
  727. * Description: This function is called by MHEG middleware to indicate the
  728. * current Application MMI status
  729. * Parameters: AppMMI status
  730. * Returns: Nothing
  731. ****************************************************************************/
  732. void MID_DTVCI_NotifyAppMMIStatus(E_APPMMI_STATE state);
  733. /*****************************************************************************
  734. * HOST COUNTRY AND LANGUAGE FUNCTIONS
  735. ****************************************************************************/
  736. /*****************************************************************************
  737. * Function Name: MID_DTVCI_CISetHostCountryCode
  738. * Description: This function is called by the host to notify the module
  739. * about new or updated country settings.
  740. * Parameters: code - country code as specified by ISO 3166 alpha-3
  741. * Returns: Nothing
  742. ****************************************************************************/
  743. BOOLEAN MID_DTVCI_CISetHostCountryCode(U8BIT * code);
  744. /*****************************************************************************
  745. * Function Name: MID_DTVCI_CISetHostLanguageCode
  746. * Description: This function is called by the host to notify the module
  747. * about new or updated language settings.
  748. * Parameters: code - language code as specified by ISO 639 Part 2
  749. * Returns: Nothing
  750. ****************************************************************************/
  751. BOOLEAN MID_DTVCI_CISetHostLanguageCode(U8BIT * code);
  752. /*****************************************************************************
  753. * CONTENT CONTROL
  754. ****************************************************************************/
  755. /*****************************************************************************
  756. * Function Name: MID_DTVCI_RecordStart
  757. * Description: This function is called by the host to inform the module
  758. * that a CA protected service is being recorded.
  759. * The host may also provide a CICAM PIN to be cached by
  760. * the module. This PIN will only be used for uninterrupted
  761. * recordings when a future Parental Control Event may occur.
  762. * The CICAM PIN is optional, and an empty string should be
  763. * provided if the CICAM PIN is not used.
  764. * Parameters: mode - recording mode
  765. * program_number - program number for recording
  766. * pin_data - ASCII encoding of PIN code (null-terminated)
  767. * status - return status for host. Check defined values
  768. * STB_CI_CC_STATUS_XXX.
  769. * Returns: TRUE if operation succeeded, FALSE otherwise
  770. ****************************************************************************/
  771. BOOLEAN MID_DTVCI_RecordStart(
  772. E_STB_CI_OPERATING_MODE mode,
  773. U16BIT program_number, U8BIT *pin_data,
  774. U8BIT *status);
  775. /*****************************************************************************
  776. * Function Name: MID_DTVCI_ChangeRecordMode
  777. * Description: This function is called by the host to tell the module that
  778. * recording operation mode is changed.
  779. * The module returns a status to the host.
  780. * Parameters: mode - recording mode
  781. * program_number - program number for recording
  782. * status - return status for host. Check defined values
  783. * STB_CI_CC_STATUS_XXX.
  784. * Returns: TRUE if operation succeeded, FALSE otherwise
  785. ****************************************************************************/
  786. BOOLEAN MID_DTVCI_ChangeRecordMode(
  787. E_STB_CI_OPERATING_MODE mode, U16BIT program_number,
  788. U8BIT *status);
  789. /*****************************************************************************
  790. * Function Name: MID_DTVCI_RecordStop
  791. * Description: This function is called by the host to inform the module
  792. * that the recording of a CA protected service has stopped.
  793. * The module returns a status to the host.
  794. * Parameters: program_number - program number for recording
  795. * status - return status for host. Check defined values
  796. * STB_CI_CC_STATUS_XXX.
  797. * Returns: TRUE if operation succeeded, FALSE otherwise
  798. ****************************************************************************/
  799. BOOLEAN MID_DTVCI_RecordStop(
  800. U16BIT program_number, U8BIT *status);
  801. /*****************************************************************************
  802. * Function Name: MID_DTVCI_GetLicensePlayCount
  803. * Description: This function is called by the host to request the module to
  804. * check the current status of the given recording license.
  805. * The function may be called in order to provide viewers
  806. * with information about the availability of a recording.
  807. * Parameters: license - the CICAM license
  808. * license_len - license length in bytes
  809. * play_count - return play count for host
  810. * license_status - return license status for host. Please
  811. * check defined values STB_CI_LICENSE_XXX
  812. * Returns: TRUE if operation succeeded, FALSE otherwise
  813. ****************************************************************************/
  814. BOOLEAN MID_DTVCI_GetLicensePlayCount(
  815. U8BIT *license, U16BIT license_len,
  816. U8BIT *play_count, U8BIT *license_status);
  817. /*****************************************************************************
  818. * Function Name: MID_DTVCI_PlayAndUpdateLicense
  819. * Description: This function is called by the host to send the CICAM
  820. * license to the module.
  821. * The function must be called whenever the host plays back
  822. * content with an associated CICAM license. If the associated
  823. * license changes during playback, the host must call the
  824. * function again to send the correct license for the content.
  825. * If the license was updated, the new license will have the
  826. * same size as the original license.
  827. * Parameters: program_number - program number for recording
  828. * license - the CICAM license
  829. * license_len - license length in bytes
  830. * uri - return uri for host.
  831. * status - return status for host. Please check defined values
  832. * STB_CI_CC_STATUS_XXX.
  833. * Returns: TRUE if operation succeeded, FALSE otherwise
  834. ****************************************************************************/
  835. BOOLEAN MID_DTVCI_PlayAndUpdateLicense(
  836. U16BIT program_number,
  837. U8BIT *license, U16BIT license_len,
  838. S_STB_CI_URI *uri, U8BIT *status);
  839. void MID_DTVCI_UpdateLicense(U16BIT program_number, U8BIT * license, U16BIT license_len, S_STB_CI_URI * uri );
  840. /*****************************************************************************
  841. * Function Name: MID_DTVCI_GetRating
  842. * Description: Get CAM rating.
  843. * Parameters:
  844. * Returns: rating from CAM.
  845. *****************************************************************************/
  846. U8BIT MID_DTVCI_GetRating(void);
  847. /*****************************************************************************
  848. * Function Name: MID_DTVCI_SendPinMmiRequest
  849. * Description: This function is called by the host to send the module a
  850. * request to ask the user for a PIN.
  851. * Parameters: pin_data - ASCII encoding of PIN code (null-terminated)
  852. * status - return status for host. Please check defined values
  853. * STB_CI_CC_STATUS_XXX.
  854. * Returns: TRUE if operation succeeded, FALSE otherwise
  855. ****************************************************************************/
  856. BOOLEAN MID_DTVCI_SendPinMmiRequest(
  857. U8BIT *pin_data, E_STB_CI_PIN_STATUS *status);
  858. /*****************************************************************************
  859. * Function Name: MID_DTVCI_SendPinCmd
  860. * Description: This function is called by the host to send the CICAM PIN
  861. * to the module.
  862. * Parameters: pin_data - ASCII encoding of PIN code (null-terminated)
  863. * status - return status for host.
  864. * Returns: TRUE if operation succeeded, FALSE otherwise
  865. ****************************************************************************/
  866. BOOLEAN MID_DTVCI_SendPinCmd(
  867. U8BIT *pin_data, E_STB_CI_PIN_STATUS *status);
  868. /*****************************************************************************
  869. * Function Name: MID_DTVCI_SendPinPlayback
  870. * Description: This function is called by the host to send the information
  871. * from a PIN event during playback.
  872. * Parameters: rating - rating as recorded by the host
  873. * private_data - event private data (15 bytes)
  874. * status - return status for host.
  875. * Returns: TRUE if operation succeeded, FALSE otherwise
  876. ****************************************************************************/
  877. BOOLEAN MID_DTVCI_SendPinPlayback(
  878. U8BIT rating, U8BIT *private_data, E_STB_CI_PIN_STATUS *status);
  879. /*****************************************************************************
  880. * OPERATOR PROFILE
  881. ****************************************************************************/
  882. /*****************************************************************************
  883. * Function Name: MID_DTVCI_CIRequestOperatorStatus
  884. * Description: This function is called by the host to request an operator
  885. * status.
  886. * This function also signals to the CICAM that the host is
  887. * moving into the operator profile environment.
  888. * When the host exits the operator profile environment, it
  889. * should call STB_CISendOperatorExit.
  890. * Parameters:
  891. * Returns: TRUE if operation succeeded, FALSE otherwise
  892. ****************************************************************************/
  893. BOOLEAN MID_DTVCI_CIRequestOperatorStatus(void);
  894. /*****************************************************************************
  895. * Function Name: MID_DTVCI_CISendOperatorExit
  896. * Description: This function is called by the host to inform the CICAM
  897. * that it has left a profile_type=1 ("private") environment
  898. * and is operating in a different channel list or context.
  899. * Parameters:
  900. * Returns: TRUE if operation succeeded, FALSE otherwise
  901. ****************************************************************************/
  902. BOOLEAN MID_DTVCI_CISendOperatorExit(void);
  903. /*****************************************************************************
  904. * Function Name: MID_DTVCI_CIRequestOperatorInfo
  905. * Description: This function is called by the host to query the operator
  906. * information.
  907. * Parameters:
  908. * Returns: TRUE if operation succeeded, FALSE otherwise
  909. ****************************************************************************/
  910. BOOLEAN MID_DTVCI_CIRequestOperatorInfo(void);
  911. /*****************************************************************************
  912. * Function Name: MID_DTVCI_CIRequestOperatorSearchStart
  913. * Description: This function is called by the host to initiate a profile
  914. * search sequence. Once this function is called, the host
  915. * hands over control over MMI and tuner to the CICAM.
  916. * When the search is complete, the CICAM sends a search status
  917. * through the function MID_DTVCI_CINotifyOperatorSearchStatus.
  918. * Parameters: info - search start parameters
  919. * Returns: TRUE if operation succeeded, FALSE otherwise
  920. ****************************************************************************/
  921. BOOLEAN MID_DTVCI_CIRequestOperatorSearchStart(S_STB_CI_SEARCH_START_INFO *info);
  922. /*****************************************************************************
  923. * Function Name: MID_DTVCI_CIRequestOperatorNitManagement
  924. * Description: This function is called by the host to handle conflict LCN
  925. * Parameters: info - search start parameters
  926. * Returns: TRUE if operation succeeded, FALSE otherwise
  927. ****************************************************************************/
  928. BOOLEAN MID_DTVCI_CIRequestOperatorNitManagement(S_STB_CI_OPERATOR_NIT_MANAGEMENT *info);
  929. /*****************************************************************************
  930. * Function Name: MID_DTVCI_CIRequestOperatorSearchCancel
  931. * Description: This function is called by the host to request that the
  932. * CICAM cancels the profile search sequence.
  933. * The CICAM should attempt to stop the current profile
  934. * search as quickly as possible.
  935. * Following the termination of the profile search, the function
  936. * STB_CINotifyOperatorSearchStatus should be called with
  937. * the error_flag set to STB_CI_OPERATOR_CANCELLED.
  938. * Parameters:
  939. * Returns: TRUE if operation succeeded, FALSE otherwise
  940. ****************************************************************************/
  941. BOOLEAN MID_DTVCI_CIRequestOperatorSearchCancel(void);
  942. /*****************************************************************************
  943. * Function Name: MID_DTVCI_CISendOperatorTuneStatus
  944. * Description: This function is called by the host to inform the CICAM
  945. * that a tune request (as part of a profile search) has
  946. * finished.
  947. * Parameters: status - operator tune status
  948. * Returns: TRUE if operation succeeded, FALSE otherwise
  949. ****************************************************************************/
  950. BOOLEAN MID_DTVCI_CISendOperatorTuneStatus(S_STB_CI_OPERATOR_TUNE_STATUS *status);
  951. /*****************************************************************************
  952. * Function Name: MID_DTVCI_CISendEntitlementAck
  953. * Description: This function is called by the host to inform the CICAM
  954. * that any change in the entitlement has been processed by
  955. * the host.
  956. * The CICAM will send an operator status message (through
  957. * the function MID_DTVCI_CINotifyOperatorStatus) with the
  958. * 'entitlement_change_flag' field cleared.
  959. * Parameters:
  960. * Returns: TRUE if operation succeeded, FALSE otherwise
  961. ****************************************************************************/
  962. BOOLEAN MID_DTVCI_CISendEntitlementAck(void);
  963. /*****************************************************************************
  964. * Function Name: MID_DTVCI_CIRequestOperatorNit
  965. * Description: This function is called by the host to query the current
  966. * NIT (Network Information Table). It should be called after
  967. * the CICAM indicates that it is initialised, using the
  968. * operator status notification or using an operator search
  969. * status notification.
  970. * Parameters:
  971. * Returns: TRUE if operation succeeded, FALSE otherwise
  972. ****************************************************************************/
  973. BOOLEAN MID_DTVCI_CIRequestOperatorNit(void);
  974. /*****************************************************************************
  975. * Function Name: MID_DTVCI_ProfileScheduleUpdate
  976. * Description: This function is called by the host to query the current
  977. * Parameters: seconds - Ask profile to resend operator info in order to
  978. execute scheduled update
  979. * Returns: Nothing
  980. ****************************************************************************/
  981. void MID_DTVCI_ProfileScheduleUpdate(U32BIT seconds);
  982. /*****************************************************************************
  983. * Function Name: MID_DTVCI_CIIsOpStatusReceived
  984. * Description: This function is for waitting CAM be Authenticated,then can
  985. perform OP,otherwise Authentication will fail
  986. * Parameters:
  987. * Returns:
  988. ****************************************************************************/
  989. BOOLEAN MID_DTVCI_CIIsOpStatus(void);
  990. void *MID_DTVCI_CIIsOpStatusReceived(void);
  991. void MID_DTVCI_CIClearOpStatusReceived(void);
  992. /*****************************************************************************
  993. * SPECIFIC APPLICATION SUPPORT (SAS) FUNCTIONS
  994. ****************************************************************************/
  995. /*****************************************************************************
  996. * Function Name: MID_DTVCI_RequestSasConnection
  997. * Description: This function is used by the host to request a connection
  998. * to the application part on the module.
  999. * When the module responds to this request, the CI+ stack
  1000. * will call STB_CIConfirmSasConnection with the session
  1001. * status.
  1002. * If the connection was been created successfully, the module
  1003. * should also open another session to the SAS resource, in
  1004. * which case the CI+ stack will call STB_CINotifySasSession.
  1005. * Parameters: app_id - the private host application ID (64 bits)
  1006. * Note: The value of OIPF_APPLICATION_ID is 0x0108113101190000
  1007. * Returns: TRUE if operation succeeded, FALSE otherwise
  1008. ****************************************************************************/
  1009. BOOLEAN MID_DTVCI_RequestSasConnection(U8BIT *app_id);
  1010. /*****************************************************************************
  1011. * Function Name: MID_DTVCI_CloseSasConnection
  1012. * Description: This function is used by the host to close an open connection
  1013. * to the application part on the module.
  1014. * Parameters:
  1015. * Returns: TRUE if operation succeeded, FALSE otherwise
  1016. ****************************************************************************/
  1017. BOOLEAN MID_DTVCI_CloseSasConnection(void);
  1018. /*****************************************************************************
  1019. * Function Name: MID_DTVCI_OipfSendMsg
  1020. * Description: This function is used by the host to send a message to
  1021. * the module using the SAS resource.
  1022. * The function sends the "send_msg" message. This message
  1023. * is described in the OIPF CSP specification as part of
  1024. * the HNI-CSP interface. It is mapped to the DAE API
  1025. * sendDRMMessage.
  1026. * The host must generate a transaction ID in order to
  1027. * match the replies from the module with the corresponding
  1028. * request. The value should be incremented modulo 2^32
  1029. * by the host.
  1030. * Parameters: module - SAS module
  1031. * ca_system_id - CA system ID
  1032. * transaction_id - transaction ID
  1033. * ca_info - CA vendor specific information
  1034. * ca_info_len - length of information in bytes (max=65000)
  1035. * Note: This is an OIPF-specific function.
  1036. * Returns: TRUE if operation succeeded, FALSE otherwise
  1037. ****************************************************************************/
  1038. BOOLEAN MID_DTVCI_OipfSendMsg(U16BIT ca_system_id, U32BIT transaction_id,
  1039. U8BIT *ca_info, U16BIT ca_info_len);
  1040. /*****************************************************************************
  1041. * Function Name: MID_DTVCI_get_cam_id
  1042. * Description: This function is used by the host to get cam brand id
  1043. * Parameters: None
  1044. * Note:
  1045. * Returns: cam brand id
  1046. ****************************************************************************/
  1047. U16BIT MID_DTVCI_get_cam_id(void);
  1048. /*****************************************************************************
  1049. * Function Name: MID_DTVCI_PlaybackApplyURI
  1050. * Description: This function is used by the host when playbaking recorded content
  1051. to aplly recorded URI
  1052. * Parameters: sid - program number, currently unused
  1053. * uri - recorded uri to be apply during playback
  1054. * Note:
  1055. * Returns: None
  1056. ****************************************************************************/
  1057. void MID_DTVCI_PlaybackApplyURI(U16BIT sid, S_STB_CI_URI *uri);
  1058. /*****************************************************************************
  1059. * Function Name: MID_DTVCI_PlaybackNotifyEMI
  1060. * Description: This function is used by the host when playbaking recorded content
  1061. to notify recorded URI's EMI
  1062. * Parameters: sid - program number, currently unused
  1063. * uri - recorded uri to be apply during playback
  1064. * Note:
  1065. * Returns: None
  1066. ****************************************************************************/
  1067. void MID_DTVCI_PlaybackNotifyEMI(U16BIT sid, S_STB_CI_URI * uri);
  1068. /*****************************************************************************
  1069. * Function Name: MID_DTVCI_CIGetCurrentURI
  1070. * Description: This function is called by the host when starting record ciplus
  1071. * protected content to get default URI setting
  1072. * Parameters: uri - address of uri structure to be stored
  1073. * Note:
  1074. * Returns: None
  1075. ****************************************************************************/
  1076. void MID_DTVCI_CIGetCurrentURI(S_STB_CI_URI *uri);
  1077. /*****************************************************************************
  1078. * Function Name: MID_DTVCI_GetContentControlVersion
  1079. * Description: Obtain contetn control version
  1080. * Parameters: none
  1081. * Note:
  1082. * Returns: CIPLUS contetn control version
  1083. ****************************************************************************/
  1084. U8BIT MID_DTVCI_GetContentControlVersion(void);
  1085. /*****************************************************************************
  1086. * Function Name: MID_DTVCI_IsCAMFirmwareUpgrading
  1087. * Description: Check if CAM Firmware is upgrading or not.
  1088. * Parameters: none
  1089. * Note:
  1090. * Returns: TRUE or FALSE. Block All IR keys (except Power/Standby) if TRUE.
  1091. ****************************************************************************/
  1092. BOOLEAN MID_DTVCI_IsCAMFirmwareUpgrading(void);
  1093. /*****************************************************************************
  1094. * Function Name: MID_DTVCI_GetPassThroughState
  1095. * Description: get pass through CAM.
  1096. * Parameters: S_CI_Protection_t, bChannelScramble
  1097. * Note:
  1098. * Returns: PassThroughState
  1099. ****************************************************************************/
  1100. U8BIT MID_DTVCI_GetPassThroughState(S_CI_Protection_t *pCIProtection,U8BIT bChannelScramble);// for Cached data present
  1101. void MID_DTVCI_SetServiceIsBISS(U8BIT IsBISSService);
  1102. #endif /* __MID_DTVCI_H__ */