DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
Macros | Typedefs | Functions
ap_cihc.c File Reference

Application level CI Host Control functions. More...

#include <stdio.h>
#include <string.h>
#include "techtype.h"
#include "dbgfuncs.h"
#include "stbhwos.h"
#include "stberc.h"
#include "stbheap.h"
#include "ap_dbdef.h"
#include "ap_cntrl.h"
#include "stbci.h"
#include "stbcicc.h"
#include "ap_ci_int.h"
#include "ap_ci_support.h"
#include "ap_cihc.h"

Macros

#define DEBUG_HC
 
#define DBG_HC(x,...)   STB_SPDebugWrite( "%s:%d " x, __FUNCTION__, __LINE__, ##__VA_ARGS__);
 
#define DBG_ERR(x,...)   STB_SPDebugWrite( "ERROR %s:%d" x, __FUNCTION__, __LINE__, ##__VA_ARGS__);
 
#define DTAG_DEL_SYS_DVBT   0x5a
 
#define DTAG_DEL_SYS_DVBT2   0x04
 
#define DTAG_DEL_SYS_DVBC   0x44
 
#define DTAG_DEL_SYS_DVBC2   0x0d
 
#define DTAG_DEL_SYS_DVBS   0x43
 
#define DTAG_DEL_SYS_DVBS2   0x79
 
#define DTAG_EXT_DESC   0x7f
 

Typedefs

typedef struct s_hc_status S_HC_STATUS
 

Functions

void ACI_HcInitialise (void)
 Initialise CI Host Control support.
 
void ACI_HcNotifyHostControlSession (U32BIT module)
 This function is used by the CI stack to notify the host that a session with the host countrol resource has been opened by the module. This signals to the host that the module intends to request that the host tunes to other transport streams / services. Following this notification, the host must call the function STB_CIAskRelease to request that the module closes the session. The function STB_CIAskReleaseReply will be called to let the host know whether the control over the tuner has been released or not. More...
 
void ACI_HcNotifyHostControlSessionClosed (U32BIT module)
 This function is used by the CI stack to notify the host that a session with the host control resource has been closed by the module. This signals to the host that it has controls over the tuner and it does not need to call STB_CIAskRelease before using it. Following this call, any PIDs that have been replaced by STB_CIReplace should be restored, if possible. More...
 
BOOLEAN ACI_HcAskRelease (U32BIT module)
 Ask the module to restore replaced PIDs and to close the session with the host control resource. More...
 
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. This function is called in response to a call to STB_CIAskRelease. The host must not assume that it has control over the tuner until this function is called. More...
 
void ACI_HcTune (U32BIT module, U16BIT nid, U16BIT onid, U16BIT tsid, U16BIT sid)
 Handle Tune request from the CAM. More...
 
void ACI_HcTuneBroadcastRequest (U32BIT module, U16BIT service_id, U16BIT desc_loop_len, U8BIT *desc_loop, U8BIT *pmt)
 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...
 
BOOLEAN ACI_HcTuneReply (U32BIT module, E_STB_CI_TUNE_STATUS status)
 Send status of tune operation to the CAM host control module. More...
 

Detailed Description

Application level CI Host Control functions.

Date
December 2016
Author
Adam Sturtridge

Function Documentation

BOOLEAN ACI_HcAskRelease ( U32BIT  module)

Ask the module to restore replaced PIDs and to close the session with the host control resource.

Parameters
modulespecifies module required
Returns
TRUE if operation successful, FALSE otherwise
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. This function is called in response to a call to STB_CIAskRelease. The host must not assume that it has control over the tuner until this function is called.

Parameters
modulespecifies module required
release_replythe reply to the release request
void ACI_HcNotifyHostControlSession ( U32BIT  module)

This function is used by the CI stack to notify the host that a session with the host countrol resource has been opened by the module. This signals to the host that the module intends to request that the host tunes to other transport streams / services. Following this notification, the host must call the function STB_CIAskRelease to request that the module closes the session. The function STB_CIAskReleaseReply will be called to let the host know whether the control over the tuner has been released or not.

Parameters
modulehost control module
void ACI_HcNotifyHostControlSessionClosed ( U32BIT  module)

This function is used by the CI stack to notify the host that a session with the host control resource has been closed by the module. This signals to the host that it has controls over the tuner and it does not need to call STB_CIAskRelease before using it. Following this call, any PIDs that have been replaced by STB_CIReplace should be restored, if possible.

Parameters
module- host control module
void ACI_HcTune ( U32BIT  module,
U16BIT  nid,
U16BIT  onid,
U16BIT  tsid,
U16BIT  sid 
)

Handle Tune request from the CAM.

Parameters
moduleHost control module
nidnetwork ID
onidoriginal network ID
tsidtransport stream ID
sidservice ID
void ACI_HcTuneBroadcastRequest ( U32BIT  module,
U16BIT  service_id,
U16BIT  desc_loop_len,
U8BIT *  desc_loop,
U8BIT *  pmt 
)

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)
BOOLEAN ACI_HcTuneReply ( U32BIT  module,
E_STB_CI_TUNE_STATUS  status 
)

Send status of tune operation to the CAM host control module.

Parameters
modulehost control module
statustune operation status
Returns
TRUE if valid module, FALSE otherwise