![]() |
DVBCore
22.3.0
Open Source DVB Engine
|
Application level CI control functions. More...
#include <stdio.h>
#include <string.h>
#include "techtype.h"
#include "dbgfuncs.h"
#include "stbhwci.h"
#include "stbhwos.h"
#include "stbhwtun.h"
#include "stbdpc.h"
#include "stbpvr.h"
#include "stberc.h"
#include "stbheap.h"
#include "stbsiflt.h"
#include "stbsitab.h"
#include "stbgc.h"
#include "ap_tmr.h"
#include "dba.h"
#include "app.h"
#include "ap_cfg.h"
#include "ap_events.h"
#include "ap_dbacc.h"
#include "ap_dbdef.h"
#include "ap_ci.h"
#include "ap_cntrl.h"
#include "ap_state.h"
#include "ap_pvr.h"
#include "app_nvm.h"
#include "stbci.h"
#include "stbcica.h"
#include "stbcicc.h"
#include "stbcikeys.h"
#include "ap_ci_int.h"
#include "ap_cihc.h"
#include "ap_ciop.h"
Classes | |
struct | s_ciplus_tune_transport |
struct | s_ciplus_tune_service |
struct | S_CIPLUS_TUNE_DATA |
Macros | |
#define | AP_CI_PRINT(x) |
#define | MAX_EVENTS 100 |
#define | TASK_STACK_SIZE 4096 |
#define | TASK_PRIORITY 11 |
Enumerations | |
enum | E_CIPLUS_TUNE_TYPE { CIPLUS_TUNE_TYPE_SERVICE, CIPLUS_TUNE_TYPE_TRANSPORT, CIPLUS_TUNE_TYPE_CI_SERVICE } |
Functions | |
void | ACI_Initialise (void) |
Initialise CI Host Control support. | |
U8BIT | ACI_GetCamUpgradeMode (void) |
Return CAM upgrade option (Yes/No/Ask) More... | |
void | ACI_SetCamUpgradeMode (U8BIT upgrade_mode) |
Sets the CAM upgrade option (Yes/No/Ask) More... | |
E_CIP_START_OPERATOR_SEARCH | ACI_GetOperatorSearchMode (void) |
Return the option for starting an operator profile search (yes/no/ask) More... | |
void | ACI_SetOperatorSearchMode (E_CIP_START_OPERATOR_SEARCH search_mode) |
Sets the operator profile search mode (Yes/No/Ask). This should be used by the app to control whether a search can be started, or the user should be asked first, or can't run. More... | |
void | ACI_OperatorSearchRequired (U32BIT module, BOOLEAN required) |
Sets whether an operator profile search needs to be run. More... | |
void | ACI_ScheduleOperatorSearch (U32BIT cicam_id, U16BIT date, U8BIT hour, U8BIT min) |
Sets the date/time that an operator search should be started for the given module. More... | |
BOOLEAN | ACI_IsOperatorSearchRequired (void) |
Returns whether an operator profile search has been requested. More... | |
U32BIT | ACI_GetOperatorSearchModule (void) |
Returns the module performing or requiring and operator search. More... | |
BOOLEAN | ACI_GetFirstOperatorSearchModule (U32BIT *module) |
Checks all the CI+ profiles to see if any have requested an update search. More... | |
BOOLEAN | ACI_GetFirstScheduledOperatorSearch (U32BIT *module, U16BIT *date, U8BIT *hours, U8BIT *mins) |
Checks all the CI+ profiles to find the one with the earliest scheduled search. All returned values are only valid if the function returns TRUE. More... | |
BOOLEAN | ACI_StartOperatorSearchForModule (U32BIT module) |
Called by the app to start an operator profile search for the given module. More... | |
BOOLEAN | ACI_HandlePrivateTimer (U32BIT timer_handle) |
Checks whether the given timer is associated with any of the CI+ profiles and starts the operator search if possible. More... | |
BOOLEAN | ACI_SetSecureRouting (U8BIT path) |
Ensures the TS is routed securely for CI+, either by setting the TS to pass through if a CI slot contains a CI+ CAM or bypass it if it doesn't. | |
BOOLEAN | ACI_AcquireCISlot (U8BIT path, void *s_ptr) |
Acquires a CI slot for the given path on the given service after releasing any slot already being used by the path. More... | |
BOOLEAN | ACI_AcquireCISlotForRecording (U8BIT path, void *s_ptr) |
Acquires a CI slot for the recording path. This function may need to "steal" the CI slot from the live path (if they are not the same path). More... | |
U8BIT | ACI_FindCISlotForService (void *serv_ptr) |
Looks for a CAM that's able to descramble the given service and returns its slot id. More... | |
void | ACI_UsageRulesStatusChanged (U8BIT path) |
Re-evaluate current state follwing a change related to usage rules. More... | |
void | ACI_ProgramMapTableChanged (U8BIT *pmt) |
Handle PMT change. More... | |
BOOLEAN | ACI_IsTrustedPath (U8BIT path) |
The given decode path is only trusted if it doesn't include a CI slot or the CI slot contains a CI+ CAM. More... | |
S32BIT | ACI_ReadPinForSlot (U8BIT slot_id) |
Checks if a pin has been saved for the CAM in the given slot and returns it. More... | |
BOOLEAN | ACI_WritePinForSlot (U8BIT slot_id, S32BIT pin) |
Saves the given pin associated with the CAM in the given slot. If the pin for this CAM has previously been saved then the saved value will be updated. If all entries are used then the oldest will be overwritten. More... | |
void | ACI_TuneToTransport (U32BIT module, void *t_ptr) |
Schedule a tune to a transport. More... | |
void | ACI_TuneToService (U32BIT module, void *s_ptr, E_CIP_TUNE_FLAGS flags) |
Schedule a tune to a service. More... | |
void | ACI_TuneToDelSysDesc (U32BIT module, S_CIP_TUNE_DEL_SYS_DESC *tune, E_CIP_TUNE_FLAGS flags) |
Tune to a service/transport defined by a delivery system descriptor, possibly with PMT data, if it's a service. More... | |
BOOLEAN | ACI_AskRelease (U32BIT module) |
Ask the host control module to restore replaced PIDs and to close the session with the host control resource. More... | |
void | ACI_TuneReply (U8BIT path, U32BIT module, E_CIP_TUNER_STATUS status) |
This function is called by the host to send the status of the tune operation to the module. More... | |
void | ACI_UseCiModuleOnPath (U8BIT path, U32BIT module) |
Use the CI module with the given path. More... | |
BOOLEAN | ACI_SendPinToCam (U8BIT slot_id, U32BIT pin) |
Converts the pin value to ASCII and sends it to the CAM An STB_EVENT_CI_PIN_STATUS event will be sent to notify the validity, or otherwise, of the pin. More... | |
BOOLEAN | ACI_PathOwnedByModule (U8BIT path, U32BIT module) |
Checks whether path is owned by CI module. More... | |
void | ACI_RegisterStartTuneNotifyCallback (F_NotifyStartTuning cb_func) |
Register callback function to notify start of tuning process due to CI tune request. More... | |
Application level CI control functions.
BOOLEAN ACI_AcquireCISlot | ( | U8BIT | path, |
void * | s_ptr | ||
) |
Acquires a CI slot for the given path on the given service after releasing any slot already being used by the path.
path | decode path |
s_ptr | service to be used on the path |
BOOLEAN ACI_AcquireCISlotForRecording | ( | U8BIT | path, |
void * | s_ptr | ||
) |
Acquires a CI slot for the recording path. This function may need to "steal" the CI slot from the live path (if they are not the same path).
path | decode path for recording |
s_ptr | service to be used on the path |
BOOLEAN ACI_AskRelease | ( | U32BIT | module | ) |
Ask the host control module to restore replaced PIDs and to close the session with the host control resource.
module | specifies module required |
U8BIT ACI_FindCISlotForService | ( | void * | serv_ptr | ) |
Looks for a CAM that's able to descramble the given service and returns its slot id.
serv_ptr | service |
U8BIT ACI_GetCamUpgradeMode | ( | void | ) |
Return CAM upgrade option (Yes/No/Ask)
BOOLEAN ACI_GetFirstOperatorSearchModule | ( | U32BIT * | module | ) |
Checks all the CI+ profiles to see if any have requested an update search.
module | pointer to return the handle of the first module requiring an update Only valid if the function returns TRUE |
BOOLEAN ACI_GetFirstScheduledOperatorSearch | ( | U32BIT * | module, |
U16BIT * | date, | ||
U8BIT * | hours, | ||
U8BIT * | mins | ||
) |
Checks all the CI+ profiles to find the one with the earliest scheduled search. All returned values are only valid if the function returns TRUE.
module | pointer to return the handle of the first module requiring an update |
date | pointer to return the date code of the search |
hours | pointer to return the hour of the search |
mins | pointer to return the minute of the search |
E_CIP_START_OPERATOR_SEARCH ACI_GetOperatorSearchMode | ( | void | ) |
Return the option for starting an operator profile search (yes/no/ask)
U32BIT ACI_GetOperatorSearchModule | ( | void | ) |
Returns the module performing or requiring and operator search.
BOOLEAN ACI_HandlePrivateTimer | ( | U32BIT | timer_handle | ) |
Checks whether the given timer is associated with any of the CI+ profiles and starts the operator search if possible.
timer_handle | timer handle |
BOOLEAN ACI_IsOperatorSearchRequired | ( | void | ) |
Returns whether an operator profile search has been requested.
BOOLEAN ACI_IsTrustedPath | ( | U8BIT | path | ) |
The given decode path is only trusted if it doesn't include a CI slot or the CI slot contains a CI+ CAM.
path | decode path |
void ACI_OperatorSearchRequired | ( | U32BIT | module, |
BOOLEAN | required | ||
) |
Sets whether an operator profile search needs to be run.
module | module requesting or cancelling an operator search |
required | TRUE if a search is required, FALSE otherwise |
BOOLEAN ACI_PathOwnedByModule | ( | U8BIT | path, |
U32BIT | module | ||
) |
Checks whether path is owned by CI module.
module | specifies module (host control or operator) |
void ACI_ProgramMapTableChanged | ( | U8BIT * | pmt | ) |
Handle PMT change.
pmt | the new PMT |
S32BIT ACI_ReadPinForSlot | ( | U8BIT | slot_id | ) |
Checks if a pin has been saved for the CAM in the given slot and returns it.
slot_id | CI slot |
void ACI_RegisterStartTuneNotifyCallback | ( | F_NotifyStartTuning | cb_func | ) |
Register callback function to notify start of tuning process due to CI tune request.
cb_func | Callback function - NULL disables the call. |
void ACI_ScheduleOperatorSearch | ( | U32BIT | cicam_id, |
U16BIT | date, | ||
U8BIT | hour, | ||
U8BIT | min | ||
) |
Sets the date/time that an operator search should be started for the given module.
cicam_id | ID of the CICAM requesting an operator search |
date | UTC MJD date code |
hour | UTC hour |
min | UTC minute |
BOOLEAN ACI_SendPinToCam | ( | U8BIT | slot_id, |
U32BIT | pin | ||
) |
Converts the pin value to ASCII and sends it to the CAM An STB_EVENT_CI_PIN_STATUS event will be sent to notify the validity, or otherwise, of the pin.
slot_id | - slot Id |
pin | - pin value |
void ACI_SetCamUpgradeMode | ( | U8BIT | upgrade_mode | ) |
Sets the CAM upgrade option (Yes/No/Ask)
upgrade_mode | cam upgrade mode |
void ACI_SetOperatorSearchMode | ( | E_CIP_START_OPERATOR_SEARCH | search_mode | ) |
Sets the operator profile search mode (Yes/No/Ask). This should be used by the app to control whether a search can be started, or the user should be asked first, or can't run.
search_mode | search mode |
BOOLEAN ACI_StartOperatorSearchForModule | ( | U32BIT | module | ) |
Called by the app to start an operator profile search for the given module.
module | operator module |
void ACI_TuneReply | ( | U8BIT | path, |
U32BIT | module, | ||
E_CIP_TUNER_STATUS | status | ||
) |
This function is called by the host to send the status of the tune operation to the module.
path | - decode path used for tuning |
module | - host control module |
status | - tune operation status |
void ACI_TuneToDelSysDesc | ( | U32BIT | module, |
S_CIP_TUNE_DEL_SYS_DESC * | tune, | ||
E_CIP_TUNE_FLAGS | flags | ||
) |
Tune to a service/transport defined by a delivery system descriptor, possibly with PMT data, if it's a service.
module | - module id |
tune | - tuning parameters |
flags | flags to pass to presentation engine |
void ACI_TuneToService | ( | U32BIT | module, |
void * | s_ptr, | ||
E_CIP_TUNE_FLAGS | flags | ||
) |
Schedule a tune to a service.
module | module id |
s_ptr | target service pointer |
flags | flags to pass to presentation engine |
void ACI_TuneToTransport | ( | U32BIT | module, |
void * | t_ptr | ||
) |
Schedule a tune to a transport.
module | module id |
t_ptr | target transport pointer |
void ACI_UsageRulesStatusChanged | ( | U8BIT | path | ) |
Re-evaluate current state follwing a change related to usage rules.
path | decode path |
void ACI_UseCiModuleOnPath | ( | U8BIT | path, |
U32BIT | module | ||
) |
Use the CI module with the given path.
path | - decode path |
module | - CI module |
BOOLEAN ACI_WritePinForSlot | ( | U8BIT | slot_id, |
S32BIT | pin | ||
) |
Saves the given pin associated with the CAM in the given slot. If the pin for this CAM has previously been saved then the saved value will be updated. If all entries are used then the oldest will be overwritten.
slot_id | CI slot |
pin | pin value to be saved |