CIInterfaceDoc.txt Driver File Contents (MantisBDADriverV1.0.3.0.zip)

//
// Mantis BDA IOCTL(ksProperty) interface document
//

===========================================================================================================================
 1. DiSEqC & lnb setup parameters
===========================================================================================================================

a. Interface:
#define THBDA_IOCTL_SET_LNB_DATA            CTL_CODE(THBDA_IO_INDEX, 128, METHOD_BUFFERED, FILE_ANY_ACCESS)

b. Structure:
typedef struct _LNB_DATA
{
    UCHAR           LNB_POWER;              // 1:LNB POWER ON, 0:LNB POWER OFF
    UCHAR           Tone_Data_Burst;        // 0:Tone/Data burst OFF, Tone Burst ON, Data Burst ON 
    ULONG           ulLNBLOFLowBand;        // LOF Low Band, in MHz
    ULONG           ulLNBLOFHighBand;       // LOF High Band, in MHz
    ULONG           ulLNBLOFHiLoSW;         // LOF High/Low Band Switch Freq, in MHz
    UCHAR           f22K_Output;			// 22KHz tone Control - 0:Set by High/Low band switch, 1:22K Off, 2: 22K On
    UCHAR           DiSEqC_Port;            // DiSEqC switch - 0:OFF, 1:DiSEqC_A, 2:DiSEqC_B, 3:DiSEqC_C, 4:DiSEqC_D
} LNB_DATA, *P_LNB_DATA;

c. Note:
This interface is used to set parameters which can't be set through standard BDA interface, like Tone/Data burst, 22k output and DiSEqC.


===========================================================================================================================
 2. Descrambling program
===========================================================================================================================

a. Interface:
#define THBDA_IOCTL_CI_SEND_PMT                 CTL_CODE(THBDA_IO_INDEX, 206, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define THBDA_IOCTL_CI_GET_PMT_REPLY            CTL_CODE(THBDA_IO_INDEX, 210, METHOD_BUFFERED, FILE_ANY_ACCESS)

b. Fitler
THPsiParser.ax
Please register THPsiParser.ax filter first. The PMT table is parsed by THPsiParser.ax filter.
A raw TS stream (from demux) should be fed to the input of THPsiParser.ax while running.

c. Compose CA_PMT table
   To start descrambling a program, we should get the corresponding CA_PMT table first.
   THPsiParser is responsible for composing CA_PMT table.

   The following parameters should be set to THPsiParser

   1.The prorgam's PMT_PID (must)
   2.The prorgam's SID (optional, set it to 0 for default)
   3.CA_PMT List Management (must)
        The value could be, 
	#define CA_PMT_LIST_MGT_MORE   0
	#define CA_PMT_LIST_MGT_FIRST  1
	#define CA_PMT_LIST_MGT_LAST   2
	#define CA_PMT_LIST_MGT_ONLY   3
	#define CA_PMT_LIST_MGT_ADD    4
	#define CA_PMT_LIST_MGT_UPDATE 5

	In general case, please set it to CA_PMT_LIST_MGT_ONLY.

   4.CA_PMT Command ID (must)
        The value could be, 
	#define CA_PMT_CMDID_Decrambleing 1
	#define CA_PMT_CMDID_MMI          2
	#define CA_PMT_CMDID_Query        3 
	#define CA_PMT_CMDID_NSelected    4
        
        If you want to descramble the stream, please set CA_PMT_CMDID_Decrambleing.
        If you want to query  the descrambling capability of the CAM with the stream, please set CA_PMT_CMDID_Query .

   5.A/V PID list (optional)
        The A/V pid to be descrambed.
        If not specified, THPsiParser will retrieve the corresponding PID's from TS with PMT PID & SID.       
 
   When the parameters are well set, call the interface GetPMTData() to get the composed CA_PMT table.

d. To descramble or query
   If CA_PMT Command ID is set to CA_PMT_CMDID_Decrambleing,
   Send the CA_PMT table to the driver with "THBDA_IOCTL_CI_SEND_PMT" interface, then CAM will start to descrambling the corresponding
   program.

   If CA_PMT Command ID is set to CA_PMT_CMDID_Query,
   Send the CA_PMT table to the driver with THBDA_IOCTL_CI_GET_PMT_REPLY interface, and get the reply from CAM.

Please refer to the sample program for details.
===========================================================================================================================
 3. CI/MMI information
===========================================================================================================================

a. Interfaces:
#define THBDA_IOCTL_CI_GET_STATE               CTL_CODE(THBDA_IO_INDEX, 200, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define THBDA_IOCTL_CI_INIT_MMI                CTL_CODE(THBDA_IO_INDEX, 202, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define THBDA_IOCTL_CI_GET_MMI                 CTL_CODE(THBDA_IO_INDEX, 203, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define THBDA_IOCTL_CI_ANSWER                  CTL_CODE(THBDA_IO_INDEX, 204, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define THBDA_IOCTL_CI_CLOSE_MMI               CTL_CODE(THBDA_IO_INDEX, 205, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define THBDA_IOCTL_CI_EVENT_CREATE            CTL_CODE(THBDA_IO_INDEX, 208, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define THBDA_IOCTL_CI_EVENT_CLOSE             CTL_CODE(THBDA_IO_INDEX, 209, METHOD_BUFFERED, FILE_ANY_ACCESS)

b. Wait CI/MMI event
Step 1: Send THBDA_IOCTL_CI_EVENT_CREATE to enable CI events.
Step 2: Send THBDA_IOCTL_CI_INIT_MMI to initial MMI.
Step 3: Wait the CI/MMI event
Event types:
enum CIMessage
{
// Old CI messages
	CI_STATUS_EMPTY_OLD = 0,		// NON_CI_INFO      0
	CI_STATUS_CAM_OK1_OLD,			// ME0				1
	CI_STATUS_CAM_OK2_OLD,			// ME1				2
	
	MMI_STATUS_GET_MENU_OK1_OLD,	// MMI0				3
	MMI_STATUS_GET_MENU_OK2_OLD,	// MMI1				4
	MMI_STATUS_GET_MENU_CLOSE1_OLD,	// MMI0_ClOSE		5
	MMI_STATUS_GET_MENU_CLOSE2_OLD,	// MMI1_ClOSE		6

// New CI messages
	CI_STATUS_EMPTY = 10,		// No CAM inserted
	CI_STATUS_INSERTED,			// CAM is inserted
	CI_STATUS_CAM_OK,			// Initila CAM OK
	CI_STATUS_CAM_UNKNOW,		// Unkonw CAM type

	MMI_STATUS_ANSWER_SEND,		// Communicating with CAM 
	MMI_STATUS_GET_MENU_OK,		// Get information from CAM
	MMI_STATUS_GET_MENU_FAIL,	// Fail to get information from CAM
	MMI_STATUS_GET_MENU_INIT,   // Init MMI
	MMI_STATUS_GET_MENU_CLOSE,  // Close MMI
	MMI_STATUS_GET_MENU_CLOSED, // MMI Closed
};
Step 4: Use THBDA_IOCTL_CI_GET_STATE to check which event that AP receives. "ulEventMessage" will show current event message.
    typedef struct {
    	ULONG ulCIState;		// CI/CAM status
        ULONG ulMMIState;		// MMI status
    	ULONG ulPMTState;
    	ULONG ulEventMessage;	// Current event status
    	ULONG Reserved[2];
    } THCIState, *PTHCIState;
Step5: If the ulEventMessage = MMI_STATUS_GET_MENU_OK, we can use THBDA_IOCTL_CI_GET_MMI to get MMI informations.
Step6: Send THBDA_IOCTL_CI_CLOSE_MMI to stop MMI.
Step7: Send THBDA_IOCTL_CI_EVENT_CLOSE to close CI events.

A polling mode for CI/MMI access is also supported, please refer to the attached sample program for further details.

===========================================================================================================================
 4. DiSEqC & lnb setup parameters
===========================================================================================================================

a. Interface:
#define THBDA_IOCTL_CI_SEND_RAW_CMD            CTL_CODE(THBDA_IO_INDEX, 211, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define THBDA_IOCTL_CI_GET_RAW_CMD_DATA        CTL_CODE(THBDA_IO_INDEX, 212, METHOD_BUFFERED, FILE_ANY_ACCESS)

b. Structure:
enum RAWCMDSSTYPE
{
    SESSION_TYPE_PROFILE = 0,   // Profile session command
    SESSION_TYPE_APP,           // Application session command
    SESSION_TYPE_CA,            // CA session command
    SESSION_TYPE_MMI            // MMI sesstion command
};

typedef struct _RAW_CMD_INFO
{
	DWORD   dwSessionType;      // Raw command session type
    PVOID   pRawCmdBuff;        // Raw command buffer
    DWORD   dwRawCmdBuffSize;   // Raw command buffer size
    DWORD   Reserved[5];
} RAW_CMD_INFO, *PRAW_CMD_INFO;

c. Send Raw command
Step1: Fill the RAW_CMD_INFO structure.
Step2: Use THBDA_IOCTL_CI_SEND_RAW_CMD interface to send raw command.
Step3: Use THBDA_IOCTL_CI_GET_RAW_CMD_DATA interface to get the return information.

Download Driver Pack

How To Update Drivers Manually

After your driver has been downloaded, follow these simple steps to install it.

  • Expand the archive file (if the download file is in zip or rar format).

  • If the expanded file has an .exe extension, double click it and follow the installation instructions.

  • Otherwise, open Device Manager by right-clicking the Start menu and selecting Device Manager.

  • Find the device and model you want to update in the device list.

  • Double-click on it to open the Properties dialog box.

  • From the Properties dialog box, select the Driver tab.

  • Click the Update Driver button, then follow the instructions.

Very important: You must reboot your system to ensure that any driver updates have taken effect.

For more help, visit our Driver Support section for step-by-step videos on how to install drivers for every file type.

server: web4, load: 0.91