50 #define DBG(x) STB_SPDebugWrite x 55 #define SAT_DEL_SYS_DTAG 0x43 56 #define CABLE_DEL_SYS_DTAG 0x44 57 #define TERR_DEL_SYS_DTAG 0x5a 59 #define T2_DELIVERY_SYS_DTAG 0x04 61 #define DELIVERY_TYPE_DVBT 0x01 62 #define DELIVERY_TYPE_DVBS 0x02 63 #define DELIVERY_TYPE_DVBC 0x04 64 #define DELIVERY_TYPE_DVBT2 0x10 90 void STB_CINotifyAppInfo(U32BIT module, U8BIT app_type, U16BIT app_manf, U16BIT manf_code, U8BIT *menu_string)
95 DBG((
"Application information: module=%x",module));
96 DBG((
"application_type = 0x%02x", app_type));
97 DBG((
"application_manufacturer = 0x%04x", app_manf));
98 DBG((
"manufacturer_code = 0x%04x", manf_code));
99 DBG((
"menu_string = \"%s\"", (
char *)menu_string));
101 USE_UNWANTED_PARAM(module);
102 USE_UNWANTED_PARAM(app_type);
103 USE_UNWANTED_PARAM(app_manf);
104 USE_UNWANTED_PARAM(manf_code);
105 USE_UNWANTED_PARAM(menu_string);
108 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_CI, EV_TYPE_CI_APP_INFO, &module,
sizeof(U32BIT));
136 DBG((
"slot_id=%d", slot_id));
156 case STB_CI_SCREEN_EVENT_REQUEST:
157 DBG((
"CI_SCREEN_EVENT_REQUEST %x", module));
158 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_CI, EV_TYPE_CI_OPEN, &module,
sizeof(U32BIT));
160 case STB_CI_SCREEN_EVENT_CLOSE:
161 DBG((
"CI_SCREEN_EVENT_CLOSE %x", module));
162 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_CI, EV_TYPE_CI_CLOSE, &module,
sizeof(U32BIT));
183 void STB_CITune(U32BIT module, U16BIT nid, U16BIT onid, U16BIT tsid, U16BIT sid)
197 void STB_CIReplace(U32BIT module, U8BIT ref, U16BIT replaced_pid, U16BIT replacement_pid)
200 USE_UNWANTED_PARAM(module);
201 USE_UNWANTED_PARAM(ref);
202 USE_UNWANTED_PARAM(replaced_pid);
203 USE_UNWANTED_PARAM(replacement_pid);
215 USE_UNWANTED_PARAM(module);
216 USE_UNWANTED_PARAM(ref);
242 void STB_CINotifyHostControlSession(U32BIT module)
244 FUNCTION_START(STB_CINotifyHostControlSession);
246 FUNCTION_FINISH(STB_CINotifyHostControlSession);
269 void STB_CINotifyHostControlSessionClosed(U32BIT module)
271 FUNCTION_START(STB_CINotifyHostControlSessionClosed);
273 FUNCTION_FINISH(STB_CINotifyHostControlSessionClosed);
292 void STB_CIAskReleaseReply(U32BIT module, U8BIT release_reply)
294 FUNCTION_START(STB_CIAskReleaseReply);
296 FUNCTION_FINISH(STB_CIAskReleaseReply);
309 S_STB_CI_TUNER_STATUS tuner_status;
310 S_STB_CI_TUNER_STATUS_DSD dsds[4];
311 U8BIT tuners, i, cnt, done;
315 tuner_status.IP_tune_capable_flag = FALSE;
319 for (i = 0, cnt = 0, done = 0; i != tuners; i++)
323 case TUNE_SYSTEM_TYPE_DVBT2:
324 if ((done & DELIVERY_TYPE_DVBT2) == 0)
326 done |= DELIVERY_TYPE_DVBT2;
327 dsds[cnt].connected_flag = FALSE;
328 dsds[cnt].delivery_system_descriptor_tag = EXT_DTAG;
329 dsds[cnt].descriptor_tag_extension = T2_DELIVERY_SYS_DTAG;
333 case TUNE_SYSTEM_TYPE_DVBT:
334 if ((done & DELIVERY_TYPE_DVBT) == 0)
336 done |= DELIVERY_TYPE_DVBT;
337 dsds[cnt].connected_flag = FALSE;
338 dsds[cnt].delivery_system_descriptor_tag = TERR_DEL_SYS_DTAG;
339 dsds[cnt].descriptor_tag_extension = 0;
343 case TUNE_SYSTEM_TYPE_DVBS:
344 case TUNE_SYSTEM_TYPE_DVBS2:
345 if ((done & DELIVERY_TYPE_DVBS) == 0)
347 done |= DELIVERY_TYPE_DVBS;
348 dsds[cnt].connected_flag = FALSE;
349 dsds[cnt].delivery_system_descriptor_tag = SAT_DEL_SYS_DTAG;
350 dsds[cnt].descriptor_tag_extension = 0;
354 case TUNE_SYSTEM_TYPE_DVBC:
355 if ((done & DELIVERY_TYPE_DVBC) == 0)
357 done |= DELIVERY_TYPE_DVBC;
358 dsds[cnt].connected_flag = FALSE;
359 dsds[cnt].delivery_system_descriptor_tag = CABLE_DEL_SYS_DTAG;
360 dsds[cnt].descriptor_tag_extension = 0;
367 tuner_status.num_dsd = cnt;
368 tuner_status.dsds = dsds;
370 STB_CITunerStatusReply(module, &tuner_status);
399 U16BIT desc_loop_len,
402 E_STB_CI_TUNE_QUIETLY_FLAG tune_quietly,
403 E_STB_CI_KEEP_APP_RUNNING_FLAG keep_app_running)
405 E_CIP_TUNE_FLAGS flags;
409 flags = (tune_quietly == STB_CI_TUNE_QUIETLY_SET)? CIP_QUIET_TUNE : CIP_NORMAL_TUNE;
410 if (keep_app_running == STB_CI_KEEP_APP_RUNNING_SET)
412 flags &= CIP_KEEP_APP_RUNING;
436 E_STB_CI_TUNE_QUIETLY_FLAG tune_quietly,
437 E_STB_CI_KEEP_APP_RUNNING_FLAG keep_app_running)
439 E_CIP_TUNE_FLAGS flags;
447 flags = (tune_quietly == STB_CI_TUNE_QUIETLY_SET)? CIP_QUIET_TUNE : CIP_NORMAL_TUNE;
448 if (keep_app_running == STB_CI_KEEP_APP_RUNNING_SET)
450 flags &= CIP_KEEP_APP_RUNING;
456 STB_CITuneReply(module, STB_CI_TUNE_SERVICE_NOT_FOUND);
483 U16BIT original_network_id,
484 U16BIT transport_stream_id,
486 U8BIT delivery_system_descriptor_tag,
487 U8BIT descriptor_tag_extension,
488 E_STB_CI_TUNE_QUIETLY_FLAG tune_quietly,
489 E_STB_CI_KEEP_APP_RUNNING_FLAG keep_app_running)
491 E_CIP_TUNE_FLAGS flags;
497 USE_UNWANTED_PARAM(delivery_system_descriptor_tag);
498 USE_UNWANTED_PARAM(descriptor_tag_extension);
503 flags = (tune_quietly == STB_CI_TUNE_QUIETLY_SET)? CIP_QUIET_TUNE : CIP_NORMAL_TUNE;
504 if (keep_app_running == STB_CI_KEEP_APP_RUNNING_SET)
506 flags &= CIP_KEEP_APP_RUNING;
512 STB_CITuneReply(module, STB_CI_TUNE_SERVICE_NOT_FOUND);
539 E_STB_CI_TUNE_QUIETLY_FLAG tune_quietly,
540 E_STB_CI_KEEP_APP_RUNNING_FLAG keep_app_running,
541 U16BIT service_location_length,
542 U8BIT *service_location_data)
545 USE_UNWANTED_PARAM(tune_quietly);
546 USE_UNWANTED_PARAM(keep_app_running);
547 USE_UNWANTED_PARAM(service_location_length);
548 USE_UNWANTED_PARAM(service_location_data);
550 STB_CITuneReply(module, STB_CI_TUNE_UNSUPPORTED_SYSTEM);
580 *offset = 60 * offset_hr + offset_min;
583 *offset = -(*offset);
613 retval &= ~0x00202020;
615 code[0] = (U8BIT)(retval >> 16);
616 code[1] = (U8BIT)(retval >> 8);
617 code[2] = (U8BIT)retval;
639 code[0] = (U8BIT)(retval >> 16);
640 code[1] = (U8BIT)(retval >> 8);
641 code[2] = (U8BIT)retval;
665 USE_UNWANTED_PARAM(slot_id);
666 USE_UNWANTED_PARAM(type);
667 USE_UNWANTED_PARAM(download_time);
669 DBG((
"STB_CINotifyFirmwareUpgrade"));
671 DBG((
"reply = 0x%02x", reply));
686 USE_UNWANTED_PARAM(slot_id);
687 USE_UNWANTED_PARAM(status);
689 DBG((
"STB_CINotifyFirmwareUpgradeProgress"));
690 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_CI, EV_TYPE_CI_CAM_UPGRADE_PROGRESS, NULL, 0);
702 USE_UNWANTED_PARAM(slot_id);
704 DBG((
"STB_CINotifyFirmwareUpgradeComplete"));
705 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_CI, EV_TYPE_CI_CAM_UPGRADE_COMPLETE, NULL, 0);
717 USE_UNWANTED_PARAM(slot_id);
719 DBG((
"STB_CINotifyFirmwareUpgradeFailure"));
720 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_CI, EV_TYPE_CI_CAM_UPGRADE_FAILED, NULL, 0);
748 void STB_CINotifyOperatorStatus(U32BIT module, S_STB_CI_OPERATOR_STATUS *status)
750 FUNCTION_START(STB_CINotifyOperatorStatus);
752 FUNCTION_FINISH(STB_CINotifyOperatorStatus);
769 void STB_CINotifyOperatorInfo(U32BIT module, U8BIT info_version,
770 S_STB_CI_OPERATOR_INFO *info)
772 FUNCTION_START(STB_CINotifyOperatorInfo);
774 FUNCTION_FINISH(STB_CINotifyOperatorInfo);
804 void STB_CINotifyOperatorTune(U32BIT module, U16BIT desc_loop_len, U8BIT *desc_loop)
807 FUNCTION_START(STB_CINotifyOperatorTune);
809 FUNCTION_FINISH(STB_CINotifyOperatorTune);
828 void STB_CINotifyOperatorSearchStatus(U32BIT module, S_STB_CI_OPERATOR_STATUS *status)
830 FUNCTION_START(STB_CINotifyOperatorSearchStatus);
832 FUNCTION_FINISH(STB_CINotifyOperatorSearchStatus);
857 void STB_CINotifyOperatorNit(U32BIT module, U16BIT nit_loop_length,
860 FUNCTION_START(STB_CINotifyOperatorNit);
862 FUNCTION_FINISH(STB_CINotifyOperatorNit);
881 USE_UNWANTED_PARAM(module);
882 USE_UNWANTED_PARAM(osdt_length);
883 USE_UNWANTED_PARAM(osdt);
903 void STB_CINotifyAuthRequest(U32BIT module, U16BIT auth_protocol_id,
904 U8BIT *auth_req, U32BIT auth_req_len)
906 FUNCTION_START(STB_CINotifyAuthRequest);
907 USE_UNWANTED_PARAM(module);
908 USE_UNWANTED_PARAM(auth_protocol_id);
909 USE_UNWANTED_PARAM(auth_req);
910 USE_UNWANTED_PARAM(auth_req_len);
911 FUNCTION_FINISH(STB_CINotifyAuthRequest);
929 void STB_CINotifySasSession(U32BIT module)
931 FUNCTION_START(STB_CINotifySasSession);
932 USE_UNWANTED_PARAM(module);
933 FUNCTION_FINISH(STB_CINotifySasSession);
946 void STB_CINotifySasSessionClosed(U32BIT module)
948 FUNCTION_START(STB_CINotifySasSessionClosed);
949 USE_UNWANTED_PARAM(module);
950 FUNCTION_FINISH(STB_CINotifySasSessionClosed);
967 void STB_CIConfirmSasConnection(U32BIT module, U8BIT *app_id, U8BIT status)
969 FUNCTION_START(STB_CIConfirmSasConnection);
970 USE_UNWANTED_PARAM(module);
971 USE_UNWANTED_PARAM(app_id);
972 USE_UNWANTED_PARAM(status);
973 FUNCTION_FINISH(STB_CIConfirmSasConnection);
998 void STB_CINotifyOipfReplyMsg(U32BIT module, U16BIT ca_system_id,
999 U32BIT transaction_id, U8BIT status,
1000 U8BIT *ca_info, U16BIT ca_info_len)
1002 FUNCTION_START(STB_CINotifyOipfReplyMsg);
1003 USE_UNWANTED_PARAM(module);
1004 USE_UNWANTED_PARAM(ca_system_id);
1005 USE_UNWANTED_PARAM(transaction_id);
1006 USE_UNWANTED_PARAM(status);
1007 USE_UNWANTED_PARAM(ca_info);
1008 USE_UNWANTED_PARAM(ca_info_len);
1009 FUNCTION_FINISH(STB_CINotifyOipfReplyMsg);
1028 void STB_CINotifyOipfParentalControlInfo(U32BIT module, U16BIT ca_system_id,
1029 S_STB_CI_OIPF_PARENTAL_CONTROL_INFO *info)
1031 FUNCTION_START(STB_CINotifyOipfParentalControlInfo);
1032 USE_UNWANTED_PARAM(module);
1033 USE_UNWANTED_PARAM(ca_system_id);
1034 USE_UNWANTED_PARAM(info);
1035 FUNCTION_FINISH(STB_CINotifyOipfParentalControlInfo);
1052 void STB_CINotifyOipfRightsInfo(U32BIT module, U16BIT ca_system_id,
1053 U8BIT access_status, U8BIT *rights_issuer_url,
1056 FUNCTION_START(STB_CINotifyOipfRightsInfo);
1057 USE_UNWANTED_PARAM(module);
1058 USE_UNWANTED_PARAM(ca_system_id);
1059 USE_UNWANTED_PARAM(access_status);
1060 USE_UNWANTED_PARAM(rights_issuer_url);
1061 USE_UNWANTED_PARAM(url_len);
1062 FUNCTION_FINISH(STB_CINotifyOipfRightsInfo);
1077 void STB_CINotifyOipfSystemInfo(U32BIT module, U16BIT ca_system_id,
1078 U8BIT *ca_info, U16BIT ca_info_len)
1080 FUNCTION_START(STB_CINotifyOipfSystemInfo);
1081 USE_UNWANTED_PARAM(module);
1082 USE_UNWANTED_PARAM(ca_system_id);
1083 USE_UNWANTED_PARAM(ca_info);
1084 USE_UNWANTED_PARAM(ca_info_len);
1085 FUNCTION_FINISH(STB_CINotifyOipfSystemInfo);
1098 void STB_CINotifyOipfCanPlayStatus(U32BIT module, U16BIT ca_system_id,
1099 BOOLEAN can_play_status)
1101 FUNCTION_START(STB_CINotifyOipfCanPlayStatus);
1102 USE_UNWANTED_PARAM(module);
1103 USE_UNWANTED_PARAM(ca_system_id);
1104 USE_UNWANTED_PARAM(can_play_status);
1105 FUNCTION_FINISH(STB_CINotifyOipfCanPlayStatus);
1118 void STB_CINotifyOipfCanRecordStatus(U32BIT module, U16BIT ca_system_id,
1119 BOOLEAN can_record_status)
1121 FUNCTION_START(STB_CINotifyOipfCanRecordStatus);
1122 USE_UNWANTED_PARAM(module);
1123 USE_UNWANTED_PARAM(ca_system_id);
1124 USE_UNWANTED_PARAM(can_record_status);
1125 FUNCTION_FINISH(STB_CINotifyOipfCanRecordStatus);
1156 if (display_diagnostic_screen)
1158 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_CI, EV_TYPE_CI_DIAGNOSTIC_SCREEN_SHOW, &module,
sizeof(U32BIT));
1162 STB_ERSendEvent(FALSE, FALSE, EV_CLASS_CI, EV_TYPE_CI_DIAGNOSTIC_SCREEN_HIDE, &module,
sizeof(U32BIT));
void ACI_HcTuneService(U32BIT module, void *s_ptr, E_CIP_TUNE_FLAGS flags)
Handle tune to service request from the CAM.
Application level CI control functions.
CI plus support functions.
void STB_CINotifyFirmwareUpgradeProgress(U8BIT slot_id, U8BIT status)
Handle firmware upgrade progress notification.
U8BIT ACFG_GetPrimaryAudioLangId(void)
Returns the primary audio language ID.
U8BIT STB_HWGetTunerPaths(void)
Returns the number of front end (Tuner) paths on the platform.
Application configuration.
U8BIT STB_CIGetCSUV(void)
This function is called by the CI+ stack to find out the CSUV value when requested by the CAM...
void * ADB_FindServiceByLcn(U32BIT list_type, U16BIT lcn, BOOLEAN show_unselectable)
Returns the service matching the given LCN and list type.
void STB_CINotifyHDSRequest(U32BIT module, BOOLEAN display_diagnostic_screen)
This function is called by the CI stack when the CAM has requested host diagnostic screen to be displ...
void ACI_OpNotifyOperatorStatus(U32BIT module, S_STB_CI_OPERATOR_STATUS *status)
This function is called by the CI+ stack to deliver the operator status to the host. This should be called if the CICAM supports the Operator Profile. This provides the module to be used for other Operator Profile related calls.
void STB_CITune(U32BIT module, U16BIT nid, U16BIT onid, U16BIT tsid, U16BIT sid)
Handle Tune request from the CAM.
void ACI_OpNotifyOperatorNit(U32BIT module, U16BIT nit_loop_length, U8BIT *nit_sections)
This function is called by the CI+ stack to deliver the operator NIT to the host. The CICAM delivers ...
void STB_CINotifyModuleRemove(U8BIT slot_id)
Notify module removal.
void * ADB_FindServiceByIds(U16BIT onet_id, U16BIT tid, U16BIT sid)
Returns a pointer to the service matching the given IDs.
void STB_CIGetHostCountryCode(U32BIT module, U8BIT *code)
Return country code.
U32BIT ACFG_ConvertLangIdToCode(U8BIT lang_id)
Returns the language code for the given language id.
void STB_ERSendEvent(BOOLEAN latched, BOOLEAN repeat, U16BIT path_class, U16BIT type, void *data, U32BIT data_size)
Sends an event to event reporting control module.
void ACI_OpNotifyOperatorInfo(U32BIT module, U8BIT info_version, S_STB_CI_OPERATOR_INFO *info)
This function is called by the CI+ stack to deliver the operator information to the host...
void STB_CITuneLCNRequest(U32BIT module, U16BIT lcn, E_STB_CI_TUNE_QUIETLY_FLAG tune_quietly, E_STB_CI_KEEP_APP_RUNNING_FLAG keep_app_running)
This function is used by the CI+ stack to request that the host tunes to a LCN using the given parame...
U8BIT ACI_GetCamUpgradeMode(void)
Return CAM upgrade option (Yes/No/Ask)
void STB_CIClearReplace(U32BIT module, U8BIT ref)
Clear PID replacement.
void STB_CITuneTripletRequest(U32BIT module, U16BIT original_network_id, U16BIT transport_stream_id, U16BIT service_id, U8BIT delivery_system_descriptor_tag, U8BIT descriptor_tag_extension, E_STB_CI_TUNE_QUIETLY_FLAG tune_quietly, E_STB_CI_KEEP_APP_RUNNING_FLAG keep_app_running)
This function is used by the CI+ stack to request that the host tunes using the given DVB triplet par...
Debug functions header file.
Header file - macros and function prototypes for public use.
void STB_CIGetHostLanguageCode(U32BIT module, U8BIT *code)
Return language code.
void STB_GCGetGMTDateTime(U16BIT *code, U8BIT *hour, U8BIT *min, U8BIT *secs)
Reads the current GMT date code and time.
Header file - Function prototypes for Event Reporting.
void ACI_OpNotifyOperatorSearchStatus(U32BIT module, S_STB_CI_OPERATOR_STATUS *status)
This function is called by the CI+ stack to deliver the operator search status to the host...
void STB_CINotifyAppInfo(U32BIT module, U8BIT app_type, U16BIT app_manf, U16BIT manf_code, U8BIT *menu_string)
Notify application information.
void ACI_HcTune(U32BIT module, U16BIT nid, U16BIT onid, U16BIT tsid, U16BIT sid)
Handle Tune request from the CAM.
U32BIT ACFG_GetCountry(void)
Returns the country code the DVB is configured for.
void STB_CITunerStatusRequest(U32BIT module)
This function is used by the CI+ stack to ask the host what broadcast delivery systems are supported...
Header file - Function prototypes for operating system.
System Wide Global Technical Data Type Definitions.
void ACI_HcTuneBroadcastRequest(U32BIT module, U16BIT service_id, U16BIT desc_loop_len, U8BIT *desc_loop, U8BIT *pmt, E_CIP_TUNE_FLAGS flags)
This function is used by the CI+ stack to request that the host tunes to a transport stream using the...
void ACI_HcNotifyHostControlSessionClosed(U32BIT module)
This function is used by the CI stack to notify the host that a session with the host control resourc...
void ACI_OpNotifyOperatorTune(U32BIT module, U16BIT desc_loop_len, U8BIT *desc_loop)
This function is called by the CI+ stack to request that the host performs the tune request as descri...
void ACI_HcAskReleaseReply(U32BIT module, U8BIT release_reply)
This function is called by the CI+ stack to send the reply of a release request to the host...
void STB_CINotifyScreenEvent(U32BIT module, U8BIT event)
Notify UI screen event.
void STB_CINotifyFirmwareUpgradeFailure(U8BIT slot_id)
Handle firmware upgrade failure notification.
void ACI_HcNotifyHostControlSession(U32BIT module)
This function is used by the CI stack to notify the host that a session with the host countrol resour...
U8BIT STB_CINotifyFirmwareUpgrade(U8BIT slot_id, U8BIT type, U16BIT download_time)
Handle firmware upgrade notification.
void STB_CITuneBroadcastRequest(U32BIT module, U16BIT service_id, U16BIT desc_loop_len, U8BIT *desc_loop, U8BIT *pmt, E_STB_CI_TUNE_QUIETLY_FLAG tune_quietly, E_STB_CI_KEEP_APP_RUNNING_FLAG keep_app_running)
This function is used by the CI+ stack to request that the host tunes to a transport stream using the...
E_STB_TUNE_SYSTEM_TYPE STB_TuneGetSupportedSystemType(U8BIT path)
Returns the system type supported by the path. This function differs from STB_TuneGetSystemType which...
void STB_CiCcNotifyModuleRemove(U8BIT slot_id)
Notify module removal.
void STB_GCGetLocalTimeOffset(U8BIT *ohour, U8BIT *omin, BOOLEAN *neg)
Reads local time offset from GMT.
void ACFG_SetHostCountryLanguageModuleId(U32BIT module)
Sets the host and country module for CI stack. Value zero for disable.
void STB_CIGetDateTime(U16BIT *mjd, U8BIT *hour, U8BIT *minute, U8BIT *second, S16BIT *offset)
Return current date and time.
void STB_CIReplace(U32BIT module, U8BIT ref, U16BIT replaced_pid, U16BIT replacement_pid)
Handle Replace message from the CAM.
void STB_CINotifyOperatorOSDTReply(U32BIT module, U32BIT osdt_length, U8BIT *osdt)
This function is called by the CI+ stack to deliver the OSDT to the host. This notification should on...
Application database access functions.
void STB_CITuneIPRequest(U32BIT module, E_STB_CI_TUNE_QUIETLY_FLAG tune_quietly, E_STB_CI_KEEP_APP_RUNNING_FLAG keep_app_running, U16BIT service_location_length, U8BIT *service_location_data)
This function is used by the CI+ stack to request that the host tunes to a single IP-delivered servic...
void STB_CiCcNotifyModuleInsert(U8BIT slot_id)
Notify module insertion.
void STB_CINotifyFirmwareUpgradeComplete(U8BIT slot_id)
Handle firmware upgrade complete notification.
void STB_CINotifyModuleInsert(U8BIT slot_id)
Notify module insertion.