⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smsctrllib.h

📁 组拨技术
💻 H
📖 第 1 页 / 共 4 页
字号:

//! TMID definition
typedef enum
{
	DAB_TMID_MSC_STREAM_AUDIO = 0,
	DAB_TMID_MSC_STREAM_DATA  = 1,
	DAB_TMID_FIDC			  = 2,
	DAB_TMID_MSC_PACKET_DATA  = 3
} SMSHOSTLIB_TMID_TYPES_ET;

/*************************************************************************
*			 Typedefs
*************************************************************************/

/// Single instance control lib client callback function prototype 
//  Kept for backward compatibility
typedef void (*SmsCtrlCbFunc)( SMSHOSTLIB_MSG_TYPE_RES_E	MsgType,		//!< Response type	
							  SMSHOSTLIB_ERR_CODES_E		ErrCode,		//!< Response success code
							  void* 						pPayload,		//!< Response payload
							  UINT32						PayloadLen);	//!< Response payload length


/// HostApi control lib client callback function prototype
typedef void (*SmsHostApiCtrlCbFunc)( 
									 void*						ClientContext,	//!< Context of client
									 SMSHOSTLIB_MSG_TYPE_RES_E	MsgType,		//!< Response type	
									 SMSHOSTLIB_ERR_CODES_E		ErrCode,		//!< Response success code
									 void* 						pPayload,		//!< Response payload
									 UINT32						PayloadLen);	//!< Response payload length

// Callback for service data read from an active service, passed to OpenService_req
typedef void ( *SmsHostApiDataCbFunc)(
									  void*	ClientPtr, 
									  UINT32	ServiceHandle, 
									  UINT8*	pBuffer, 
									  UINT32	BufferSize );

/// A device instance handle
typedef void* SmsHostApiDeviceHandle ;

typedef void* HANDLE;

/*************************************************************************
*			 Structures
*************************************************************************/

/// Initialization - init lib params for single instance compatibility
typedef struct SMSHOSTLIB_INITLIB_PARAMS_S
{
	UINT32						Size;				//!< Put sizeof(#SMSHOSTLIB_INITLIB_PARAMS_ST)into this field
	SMSHOSTLIB_COMM_TYPES_E		CommType;			//!< Communication type (according to 
													//!<		#SMSHOSTLIB_COMM_TYPES_E enumerator)
	void*						pCommParam;			//!< Additional Communication Params. This is platform 
													//!<		dependent and usually should be set to NULL.
	UINT32						padding;
	const char*					WorkingDirectory;	//!< File system directory for saving service information
} SMSHOSTLIB_INITLIB_PARAMS_ST;

/// Initialization - multiple instances init lib params
typedef struct SMSHOSTLIB_API_INITLIB_PARAMS_S
{
	UINT32						Size;				//!< Put sizeof(#SMSHOSTLIB_API_INITLIB_PARAMS_ST)into this field
	SmsHostApiCtrlCbFunc		pCtrlCallback ;		//!< Callback for control responses
	SmsHostApiDataCbFunc		pDataCallback ;		//!< Callback for asynchronous data reading
													//!<  Leave NULL for synchronous read
	SMSHOSTLIB_COMM_TYPES_E		CommType;			//!< Communication type (according to 
													//!<		#SMSHOSTLIB_COMM_TYPES_E enumerator)
	void*						pCommParam;			//!< Additional Communication Params. This is platform 
													//!<		dependent and usually should be set to NULL.
	const char*					WorkingDirectory;	//!< File system directory for saving service information
	BOOL						IsSupportMultInstances ; //!< Is multiple instances support needed
} SMSHOSTLIB_API_INITLIB_PARAMS_ST ;


/// Logging
//format of SMSHOSTLIB_MSG_LOG_ITEM. 
//Actual size is sizeof(SMSHOSTLIB_LOG_HEADER_ST) + ( number_of_parameters * sizeof(UINT32) )

typedef struct SMSHOSTLIB_LOG_HEADER_S
{
    UINT32 n_filtering_classification;
    UINT32 e_format_string_tag;
    UINT32 n_timestamp_microseconds;
} SMSHOSTLIB_LOG_HEADER_ST;

typedef struct SMSHOSTLIB_LOG_ITEM_S
{
    SMSHOSTLIB_LOG_HEADER_ST x_header;
    UINT32                   a_n_parameters[SMSHOSTLIB_MAX_NUM_LOG_PARAMETERS];
} SMSHOSTLIB_LOG_ITEM_ST;

/// Versioning
typedef struct SMSHOSTLIB_VERSIONING_S
{
	UINT32	Version;
	UINT32	Revision;
} SMSHOSTLIB_VERSIONING_ST;

/// Version
typedef struct SMSHOSTLIB_FIRMWARE_STAMP_S
{
	char	SIANO_MS[8];		//!< SIANO-MS (constant) 
	char	Version[4];			//!< Version (0-9999) 
	char	Revision[4];		//!< Revision (0-9999) 
	char	Date[8];			//!< Date (DDMMYYYY) 
	char	Standards[4];		/*!< Standards (Each standard will get binary bit-wise value, 
									 the field value will be OR combination translated to ASCII) */
	char	Target[4];			//!< Targeted hardware
	char	Remark[24];			//!< Remark 
	char	CRC32[8];			//!< CRC32 of the firmware image. 
} SMSHOSTLIB_FIRMWARE_STAMP_ST;

/// All exist versions information
typedef struct
{
	SMSHOSTLIB_VERSIONING_ST		RF_Tuner;	//!< RF Tuner version 
	SMSHOSTLIB_VERSIONING_ST		Demod_Rom;	//!< Demodulator version
	SMSHOSTLIB_FIRMWARE_STAMP_ST	Firmware;	//!< Firmware stamp
	SMSHOSTLIB_VERSIONING_ST		CtrlLib;	//!< Host control library version
} SMSHOSTLIB_VERSION_INFO_ST;

typedef struct SMSHOSTLIB_COMM_STATE_CHG_IND_S
{
	SMSHOSTLIB_COMM_STATE_ET NewState;	

} SMSHOSTLIB_COMM_STATE_CHG_IND_ST;

/// Statistics information returned as response for SmsHostGetStatistics_Req
typedef struct SMSHOSTLIB_STATISTICS_S
{
	UINT32 Reserved;				//!< Reserved

	/// Common parameters
	UINT32 IsRfLocked;				//!< 0 - not locked, 1 - locked
	UINT32 IsDemodLocked;			//!< 0 - not locked, 1 - locked
	UINT32 IsExternalLNAOn;			//!< 0 - external LNA off, 1 - external LNA on

	/// Reception quality
	INT32  SNR;						//!< dB
	UINT32 BER;						//!< Post Viterbi BER [1E-5]
	UINT32 FIB_CRC;					//!< CRC errors percentage, valid only for DAB
	UINT32 TS_PER;					//!< Transport stream PER, 0xFFFFFFFF indicate N/A, valid only for DVB-T/H
	UINT32 MFER;					//!< DVB-H frame error rate in percentage, 0xFFFFFFFF indicate N/A, valid only for DVB-H
	INT32  RSSI;					//!< dBm
	INT32  InBandPwr;				//!< In band power in dBM
	INT32  CarrierOffset;			//!< Carrier Offset in bin/1024

	/// Transmission parameters
	UINT32 Frequency;				//!< Frequency in Hz
	UINT32 Bandwidth;				//!< Bandwidth in MHz, valid only for DVB-T/H
	UINT32 TransmissionMode;		//!< Transmission Mode, for DAB modes 1-4, for DVB-T/H FFT mode carriers in Kilos
	UINT32 ModemState;				//!< from SMS_DvbModemState_ET , valid only for DVB-T/H
	UINT32 GuardInterval;			//!< Guard Interval, 1 divided by value , valid only for DVB-T/H
	UINT32 CodeRate;				//!< Code Rate from SMS_DvbModemState_ET, valid only for DVB-T/H
	UINT32 LPCodeRate;				//!< Low Priority Code Rate from SMS_DvbModemState_ET, valid only for DVB-T/H
	UINT32 Hierarchy;				//!< Hierarchy from SMS_Hierarchy_ET, valid only for DVB-T/H
	UINT32 Constellation;			//!< Constellation from SMS_Constellation_ET, valid only for DVB-T/H

	/// Burst parameters, valid only for DVB-H
	UINT32 BurstSize;				//!< Current burst size in bytes, valid only for DVB-H
	UINT32 BurstDuration;			//!< Current burst duration in mSec, valid only for DVB-H
	UINT32 BurstCycleTime;			//!< Current burst cycle time in mSec, valid only for DVB-H
	UINT32 CalculatedBurstCycleTime;//!< Current burst cycle time in mSec, as calculated by demodulator, valid only for DVB-H
	UINT32 NumOfRows;				//!< Number of rows in MPE table, valid only for DVB-H
	UINT32 NumOfPaddCols;			//!< Number of padding columns in MPE table, valid only for DVB-H
	UINT32 NumOfPunctCols;			//!< Number of puncturing columns in MPE table, valid only for DVB-H
	UINT32 ErrorTSPackets;			//!< Number of erroneous transport-stream packets
	UINT32 TotalTSPackets;			//!< Total number of transport-stream packets
	UINT32 NumOfValidMpeTlbs;		//!< Number of MPE tables which do not include errors after MPE RS decoding
	UINT32 NumOfInvalidMpeTlbs;		//!< Number of MPE tables which include errors after MPE RS decoding
	UINT32 NumOfCorrectedMpeTlbs;	//!< Number of MPE tables which were corrected by MPE RS decoding
 	/// Common params
	UINT32 BERErrorCount;			//!< Number of errornous SYNC bits.
	UINT32 BERBitCount;				//!< Total number of SYNC bits.

	/// Interface information
	UINT32 SmsToHostTxErrors;		//!< Total number of transmission errors.

	/// DAB/T-DMB  
	UINT32 PreBER; 					//!< DAB/T-DMB only: Pre Viterbi BER [1E-5]

	/// DVB-H TPS parameters
	UINT32 CellId;					//!< TPS Cell ID in bits 15..0, bits 31..16 zero; if set to 0xFFFFFFFF cell_id not yet recovered

} SMSHOSTLIB_STATISTICS_ST;

/// Scan by given range structure
typedef struct SMSHOSTLIB_SCAN_RANGE_S
{
	UINT32		BottomFreq;		//!< The bottom center frequency of the range (Hz)
	UINT32		Gap;			//!< The gap in Hz between consequent center frequencies 
	UINT32		UpFreq;			//!< The upper center frequency of the range (Hz)
} SMSHOSTLIB_SCAN_RANGE_ST; 

/// Scan by given table structure
typedef struct SMSHOSTLIB_SCAN_TABLE_S
{
	UINT32		NumOfFreq;		//!< Number of frequencies 
	UINT32*		pFreqBuff;		//!< Pointer to a buffer contains frequencies (Hz) 
} SMSHOSTLIB_SCAN_TABLE_ST; 

/// DAB/DMB Ensemble information structure
typedef struct
{
	UINT32	EID;			//!< Ensemble ID
	UINT32	Frequency;		//!< Ensemble Frequency 
	UINT32	NumOfService;	//!< Number of services in ensemble 
	UINT8	pDateAndTime[SMSHOSTLIB_MAX_DATE_N_TIME_SIZE]; //!< Date and time 
	UINT8	pLabel[SMSHOSTLIB_MAX_LABEL_SIZE+1];	//!< Ensemble label; Add one byte for End Of String 

} SMSHOSTLIB_ENSEMBLE_INFO_ST;

/// DAB/DMB Service information structure
typedef struct
{
	UINT32	SID;				  	//!< Service ID
	UINT32	Frequency;				//!< Frequency that service is served
	UINT32	Pty;				 	//!< Program type 
	UINT32	CAID;				 	//!< Conditional access ID 
	UINT32	NumOfServiceComponent;	//!< Number of service component for current service
	UINT8	pLabel[SMSHOSTLIB_MAX_LABEL_SIZE+1];	//!< Service label; Add one byte for End Of String

} SMSHOSTLIB_SERVICE_INFO_ST;

typedef struct
{
    UINT32 UserApplicationType;
	UINT32 UserApplicationDataLength;
    UINT8  Data[SMSHOSTLIB_MAX_LEN_OF_APPLICATION_DATA];

} SMSHOSTLIB_COMPONENT_USER_APPL_DATA_ST;

/// DAB/DMB component information structure
typedef struct
{
	UINT32	TMID;			//!< TMID type (according to #SMSHOSTLIB_TMID_TYPES_ET enumerator)
	UINT32	ASCTy;			//!< Audio service type 
	UINT32	DSCTy;			//!< Data service type. see. EN300 401 6.3.1 (0x18:DMB Video service) 
	UINT32	SCIdS;			//!< Service component Index within service
	UINT32	SCId;			//!< Service component (if packet mode)
	UINT32	SubChID;		//!< Sub-channel ID 
	UINT32	FIDCID;			//!< FIDC channel ID (if FIDC channel) 
	UINT32	PacketAddress;	//!< Packet address (if packet mode) 
	UINT32	Primary;		//!< Primary or not primary 	
	UINT32	CAFlag;			//!< Conditional access flag 
	UINT32  SCCA;			//!< Service Component Conditional Access
	UINT32  DG_flag;		//!< Data Groups are used or not to transport the Service Component
	UINT32	Language;		//!< Component Language 
	UINT32  NumOfUserApplications;//!< Component User Applications information
	SMSHOSTLIB_COMPONENT_USER_APPL_DATA_ST UserAppData[SMSHOSTLIB_MAX_USER_APPLICATIONS];
	UINT8	pLabel[SMSHOSTLIB_MAX_LABEL_SIZE+1];	//!< Service component label; Add one byte for End Of String

} SMSHOSTLIB_COMPONENT_INFO_ST;

/// DAB/DMB component information structure
typedef struct
{
	UINT32							EnsembleIdx;	// !< The ensemble index
	SMSHOSTLIB_ENSEMBLE_INFO_ST		EnsembleInfo;	// !< Ensemble information
	SMSHOSTLIB_SERVICE_INFO_ST		ServiceInfo;	// !< Service information
	SMSHOSTLIB_COMPONENT_INFO_ST	ComponentInfo;	// !< Component information

} SMSHOSTLIB_COMBINED_COMPONENT_INFO_ST;

/// Obsolete PID list structure
typedef struct SMSHOSTLIB_PID_FILTERS_S
{
	UINT32	PID_List_Len;
	UINT32	PID_Filters[SMSHOSTLIB_MAX_FILTERS_LIST_LEN];

} SMSHOSTLIB_PID_FILTERS_ST;

//! IPv4 basic structure
typedef	struct SMSHOSTLIB_IPv4_S
{
	UINT8				a_IPv4_addr[4];			//!< IPv4 address

} SMSHOSTLIB_IPV4_ST;

//! IPv6 basic structure
typedef	struct SMSHOSTLIB_IPv6_S
{
	UINT8				a_IPv6_addr[16];			//!< IPv6 address

} SMSHOSTLIB_IPV6_ST;

union SMSHOSTLIB_IP_UN
{	//! Either IPv4 or IPv6 union
	SMSHOSTLIB_IPV4_ST	IPv4;
	SMSHOSTLIB_IPV6_ST	IPv6;
};

//! Platform and provider names structure											
typedef struct SMSHOSTLIB_IP_PL_NAME_S
{
	UINT8 Language[3];										//!< Language code, 3 character
	UINT8 PlatformNameLen;									//!< Platform name length
	UINT8 pPlatformName[SMSHOSTLIB_IP_PLAT_NAME_MAX_LEN];	//!< Platform name
	UINT8 ProviderNameLen;									//!< Provider name length
	UINT8 pProviderName[SMSHOSTLIB_IP_PLAT_NAME_MAX_LEN];	//!< Provider name
} SMSHOSTLIB_IP_PL_NAME_ST;
											
//! Platform IDs basic structure
typedef struct SMSHOSTLIB_IP_PLAT_S
{
	UINT32							PlatformID; 
	SMSHOSTLIB_IP_PL_NAME_ST		Name[SMSHOSTLIB_IP_PLAT_LANGUAGE_MAX_VARIANT]; 
} SMSHOSTLIB_IP_PLAT_ST; 

/// IP Service (DVB-H) structure
typedef struct SMSHOSTLIB_IP_DVBH_SRV_S
{
	UINT32					IpPlatformID;
	SMSHOSTLIB_IP_TYPE_ET	IpType;
	union SMSHOSTLIB_IP_UN	pIpSrcAddr;
	union SMSHOSTLIB_IP_UN	pIpDstAddr;
} SMSHOSTLIB_IP_DVBH_SRV_ST;

/// GPIO Configuration structure
typedef struct SMSHOSTLIB_GPIO_CONFIG_S
{
	UINT8	Direction;				//!< GPIO direction: Input - 0, Output - 1
	UINT8	PullUpDown;				//!< PullUp/PullDown: None - 0, PullDown - 1, PullUp - 2, Keeper - 3
	UINT8	InputCharacteristics;	//!< Input Characteristics: Normal - 0, Schmitt trigger - 1
	UINT8	OutputSlewRate;			//!< Output Slew Rate:	Fast slew rate - 0, Slow slew rate - 1
	UINT8	OutputDriving;			//!< Output driving capability: 4mA - 0, 8mA - 1, 12mA - 2, 16mA - 3
} SMSHOSTLIB_GPIO_CONFIG_ST;

/// UTC Time structure

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -