DVBCore  22.11.0
Open Source DVB Engine
Macros | Functions
ci_plus_glue.c File Reference

CI+ Glue. More...

#include "techtype.h"
#include "dbgfuncs.h"
#include "stbhwos.h"
#include "stbgc.h"
#include "stberc.h"
#include "stbcicc.h"
#include "ap_cfg.h"
#include "ap_ci.h"
#include "ap_ci_support.h"
#include "ap_dbacc.h"
#include "stbci.h"

Macros

#define DBG(x)
 
#define SAT_DEL_SYS_DTAG   0x43
 
#define CABLE_DEL_SYS_DTAG   0x44
 
#define TERR_DEL_SYS_DTAG   0x5a
 
#define EXT_DTAG   0x7f
 
#define T2_DELIVERY_SYS_DTAG   0x04
 
#define DELIVERY_TYPE_DVBT   0x01
 
#define DELIVERY_TYPE_DVBS   0x02
 
#define DELIVERY_TYPE_DVBC   0x04
 
#define DELIVERY_TYPE_DVBT2   0x10
 

Functions

void STB_CINotifyAppInfo (U32BIT module, U8BIT app_type, U16BIT app_manf, U16BIT manf_code, U8BIT *menu_string)
 Notify application information. More...
 
void STB_CINotifyModuleInsert (U8BIT slot_id)
 Notify module insertion. More...
 
void STB_CINotifyModuleRemove (U8BIT slot_id)
 Notify module removal. More...
 
void STB_CINotifyScreenEvent (U32BIT module, U8BIT event)
 Notify UI screen event. More...
 
void STB_CITune (U32BIT module, U16BIT nid, U16BIT onid, U16BIT tsid, U16BIT sid)
 Handle Tune request from the CAM. More...
 
void STB_CIReplace (U32BIT module, U8BIT ref, U16BIT replaced_pid, U16BIT replacement_pid)
 Handle Replace message from the CAM. More...
 
void STB_CIClearReplace (U32BIT module, U8BIT ref)
 Clear PID replacement. More...
 
void STB_CINotifyHostControlSession (U32BIT module)
 
void STB_CINotifyHostControlSessionClosed (U32BIT module)
 
void STB_CIAskReleaseReply (U32BIT module, U8BIT release_reply)
 
void STB_CITunerStatusRequest (U32BIT module)
 This function is used by the CI+ stack to ask the host what broadcast delivery systems are supported, and the likely success of a tune depending on the delivery system type. The host must reply calling the function STB_CITunerStatusReply. More...
 
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 given parameters. If the service_id is zero, the host should not report a PMT using STB_CIUpdatePmt. If the PMT is provided, it should be used when selecting elementary streams on the service. The PMT is not provided if service_id is zero. Following the tune operation (whether successful or not), the host must call the function STB_CITuneReply. More...
 
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 parameters. Following the tune operation (whether successful or not), the host must call the function STB_CITuneReply. More...
 
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 parameters. Following the tune operation (whether successful or not), the host must call the function STB_CITuneReply. More...
 
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 service described by a ServiceLocation element. Following the tune operation (whether successful or not), the host must call the function STB_CITuneReply(). If tune to IP is not supported STB_CITuneReply() must be called with STB_CI_TUNE_UNSUPPORTED_SYSTEM. More...
 
void STB_CIGetDateTime (U16BIT *mjd, U8BIT *hour, U8BIT *minute, U8BIT *second, S16BIT *offset)
 Return current date and time. More...
 
void STB_CIGetHostCountryCode (U32BIT module, U8BIT *code)
 Return country code. More...
 
void STB_CIGetHostLanguageCode (U32BIT module, U8BIT *code)
 Return language code. More...
 
U8BIT STB_CINotifyFirmwareUpgrade (U8BIT slot_id, U8BIT type, U16BIT download_time)
 Handle firmware upgrade notification. More...
 
void STB_CINotifyFirmwareUpgradeProgress (U8BIT slot_id, U8BIT status)
 Handle firmware upgrade progress notification. More...
 
void STB_CINotifyFirmwareUpgradeComplete (U8BIT slot_id)
 Handle firmware upgrade complete notification. More...
 
void STB_CINotifyFirmwareUpgradeFailure (U8BIT slot_id)
 Handle firmware upgrade failure notification. More...
 
void STB_CINotifyOperatorStatus (U32BIT module, S_STB_CI_OPERATOR_STATUS *status)
 
void STB_CINotifyOperatorInfo (U32BIT module, U8BIT info_version, S_STB_CI_OPERATOR_INFO *info)
 
void STB_CINotifyOperatorTune (U32BIT module, U16BIT desc_loop_len, U8BIT *desc_loop)
 
void STB_CINotifyOperatorSearchStatus (U32BIT module, S_STB_CI_OPERATOR_STATUS *status)
 
void STB_CINotifyOperatorNit (U32BIT module, U16BIT nit_loop_length, U8BIT *nit_sections)
 
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 only occur after STB_CISendOperatorOSDTRequest() has been called. The OSD data must be copied if it used after this function returns. More...
 
U8BIT STB_CIGetCSUV (void)
 This function is called by the CI+ stack to find out the CSUV value when requested by the CAM. More...
 
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 displayed or to stop displaying. The host should respond with a STB_CIHDSConfirm() call, even if it is to indicate that the host does not implement a diagnostic screen. More...
 

Detailed Description

CI+ Glue.

Date
19 February 2009
Author
Omri Barel

Function Documentation

void STB_CIClearReplace ( U32BIT  module,
U8BIT  ref 
)

Clear PID replacement.


Parameters
module- module ID
ref- replacement reference (provided by STB_CIReplace)
U8BIT STB_CIGetCSUV ( void  )

This function is called by the CI+ stack to find out the CSUV value when requested by the CAM.

Returns
Critical Security Update Version
void STB_CIGetDateTime ( U16BIT *  mjd,
U8BIT *  hour,
U8BIT *  minute,
U8BIT *  second,
S16BIT *  offset 
)

Return current date and time.


Parameters
mjd- modified Julian date (date part only)
hour- hours
min- minutes
secs- seconds
offset- offset from UTC in minutes
void STB_CIGetHostCountryCode ( U32BIT  module,
U8BIT *  code 
)

Return country code.


Parameters
module- module ID
code- three letter country code
void STB_CIGetHostLanguageCode ( U32BIT  module,
U8BIT *  code 
)

Return language code.


Parameters
module- module ID
code- three letter language code
void STB_CINotifyAppInfo ( U32BIT  module,
U8BIT  app_type,
U16BIT  app_manf,
U16BIT  manf_code,
U8BIT *  menu_string 
)

Notify application information.


Parameters
module- module ID
app_type- application type
app_manf- application manufacturer
manf_code- manufacturer code
menu_string- top level menu string
U8BIT STB_CINotifyFirmwareUpgrade ( U8BIT  slot_id,
U8BIT  type,
U16BIT  download_time 
)

Handle firmware upgrade notification.


Parameters
slot_id- slot ID
type- type of firmware upgrade (immediate/delayed)
download_time- estimated download time in seconds (0 = unknown)
Returns
CAM upgrade reply
void STB_CINotifyFirmwareUpgradeComplete ( U8BIT  slot_id)

Handle firmware upgrade complete notification.


Parameters
module- module ID
void STB_CINotifyFirmwareUpgradeFailure ( U8BIT  slot_id)

Handle firmware upgrade failure notification.


Parameters
module- module ID
void STB_CINotifyFirmwareUpgradeProgress ( U8BIT  slot_id,
U8BIT  status 
)

Handle firmware upgrade progress notification.


Parameters
slot_id- slot ID
status- status of progress (percentage in 10% steps)
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 displayed or to stop displaying. The host should respond with a STB_CIHDSConfirm() call, even if it is to indicate that the host does not implement a diagnostic screen.

Parameters
modulespecifies module required
display_diagnostic_screenTRUE if requested to display the diagnostic screen, FALSE if requested to stop displaying the diagnostic screen
void STB_CINotifyModuleInsert ( U8BIT  slot_id)

Notify module insertion.


Parameters
slot_id- slot ID for module
void STB_CINotifyModuleRemove ( U8BIT  slot_id)

Notify module removal.


Parameters
slot_id- slot ID for module
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 only occur after STB_CISendOperatorOSDTRequest() has been called. The OSD data must be copied if it used after this function returns.

Note
This message is only supported for version 2 of the Operator Profile resource
Parameters
moduleoperator profile module
osdt_lengthlength of OSDT in bytes (may be 0)
osdtthe data, if any
void STB_CINotifyScreenEvent ( U32BIT  module,
U8BIT  event 
)

Notify UI screen event.


Parameters
module- module ID
event- screen event
void STB_CIReplace ( U32BIT  module,
U8BIT  ref,
U16BIT  replaced_pid,
U16BIT  replacement_pid 
)

Handle Replace message from the CAM.


Parameters
module- module ID
ref- reference for replacement operation
replaced_pid- PID to be replaced
replacement_pid- replacement PID
void STB_CITune ( U32BIT  module,
U16BIT  nid,
U16BIT  onid,
U16BIT  tsid,
U16BIT  sid 
)

Handle Tune request from the CAM.


Parameters
module- module ID
nid- network ID
onid- original network ID
tsid- transport stream ID
sid- service ID
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 given parameters. If the service_id is zero, the host should not report a PMT using STB_CIUpdatePmt. If the PMT is provided, it should be used when selecting elementary streams on the service. The PMT is not provided if service_id is zero. Following the tune operation (whether successful or not), the host must call the function STB_CITuneReply.

Parameters
modulehost control module
service_idthe service to tune to
desc_loop_lenlength of descriptor loop in bytes
desc_loopthe descriptor loop
pmtthe PMT to use (or NULL)
tune_quietlyparameter specified in v3 of tune_broadcas t_request message from CAM, or STB_CI_TUNE_QUIETLY_UNKNOWN if not received with message
keep_app_runningparameter specified in v3 of tune_broadcast_request message from CAM, or STB_CI_KEEP_APP_RUNNING_UNKNOWN if not received with message
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 service described by a ServiceLocation element. Following the tune operation (whether successful or not), the host must call the function STB_CITuneReply(). If tune to IP is not supported STB_CITuneReply() must be called with STB_CI_TUNE_UNSUPPORTED_SYSTEM.

Parameters
modulehost control module
tune_quietlyparameter specified in v3 of tune_ip_request message from CAM, should never be STB_CI_TUNE_QUIETLY_UNKNOWN in this usage
keep_app_runningparameter specified in v3 of tune_ip_request message from CAM, should never be STB_CI_KEEP_APP_RUNNING_UNKNOWN in this usage
service_location_lengththe size of the data in service_location_data parameter
service_location_dataa text string which describes a valid XML description containing a single ServiceLocation element conforming to the XML schema defined in specification
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 parameters. Following the tune operation (whether successful or not), the host must call the function STB_CITuneReply.

Parameters
modulehost control module
lcnof the service to tune, shall be within the range 0-9999 inclusive, the host shall resolve this to its active channel list
tune_quietlyparameter specified in v3 of tune_broadcast_request message from CAM, should never be STB_CI_TUNE_QUIETLY_UNKNOWN in this usage
keep_app_runningparameter specified in v3 of tune_broadcast_request message from CAM, should never be STB_CI_KEEP_APP_RUNNING_UNKNOWN in this usage
void STB_CITunerStatusRequest ( U32BIT  module)

This function is used by the CI+ stack to ask the host what broadcast delivery systems are supported, and the likely success of a tune depending on the delivery system type. The host must reply calling the function STB_CITunerStatusReply.

Parameters
modulespecifies module required
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 parameters. Following the tune operation (whether successful or not), the host must call the function STB_CITuneReply.

Parameters
modulehost control module
original_network_idnetwork id of the triplet
transport_stream_idtransport stream id of the triplet
service_idservice id of the triplet
delivery_system_descriptor_tagthe delivery system type from which the service is requested. Tag values are defined in DVB SI specification
descriptor_tag_extensiononly valid if delivery_system_descriptor_tag is 0x7F, as with delivery_system_descriptor_tag values are defined in DVB SI specification
tune_quietlyparameter specified in v3 of tune_broadcast_request message from CAM, should never be STB_CI_TUNE_QUIETLY_UNKNOWN in this usage
keep_app_runningparameter specified in v3 of tune_broadcast_request message from CAM, should never be STB_CI_KEEP_APP_RUNNING_UNKNOWN in this usage