From 85335047454f2b196abc4406580edad2d3b1d67b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 18 Nov 2012 09:57:44 +0100 Subject: [PATCH] update to femtobts API version 2.6 --- include/gsml1const.h | 33 ++++++++++++ include/gsml1dbg.h | 20 -------- include/gsml1prim.h | 32 ++++++------ include/gsml1types.h | 116 +------------------------------------------ include/superfemto.h | 2 +- 5 files changed, 51 insertions(+), 152 deletions(-) diff --git a/include/gsml1const.h b/include/gsml1const.h index dc8a30f..f4f5119 100644 --- a/include/gsml1const.h +++ b/include/gsml1const.h @@ -6,6 +6,7 @@ #endif // __cplusplus #define L1_HAS_EFR +#define L1_HAS_RTP_MODE /**************************************************************************** * Public macro * @@ -243,6 +244,22 @@ typedef enum GsmL1_FreqBand_t } GsmL1_FreqBand_t; +/**************************************************************************** + * Enum : GsmL1_TchFormat_t + ************************************************************************//** + * + * TCH message packin format. + * + * @ingroup gsml1_api_const + * + ****************************************************************************/ +typedef enum GsmL1_TchFormat_t +{ + GsmL1_TchFormat_Rtp = 0, ///< RTP format + GsmL1_TchFormat_If2 ///< IF2 format (AMR), custom (HR, FR, EFR) + +} GsmL1_TchFormat_t; + /**************************************************************************** * Enum : GsmL1_PrimId_t ************************************************************************//** @@ -366,6 +383,22 @@ typedef enum GsmL1_TchPlType_t } GsmL1_TchPlType_t; +/**************************************************************************** + * Enum : GsmL1_TchPlFmt_t + ************************************************************************//** + * + * List of every payload packing format supported on a TCH physical channel. + * + * @ingroup gsml1_api_const + * + ****************************************************************************/ +typedef enum GsmL1_TchPlFmt_t +{ + GsmL1_TchPlFmt_Rtp = 0, ///< RFC XXXX - RTP format + GsmL1_TchPlFmt_If2 ///< Etsi IF2 format (AMR), custom (HR, FR, EFR) + +} GsmL1_TchPlFmt_t; + /**************************************************************************** * typedef enum : GsmL1_PdtchPlType_t ************************************************************************//** diff --git a/include/gsml1dbg.h b/include/gsml1dbg.h index 34308bc..df99be9 100644 --- a/include/gsml1dbg.h +++ b/include/gsml1dbg.h @@ -167,26 +167,6 @@ void GsmL1Dbg_DumpBuffer( uint32_t u32Level, uint32_t u32Length, uint8_t *pu8Buffer ); -/**************************************************************************** - * Function : GsmL1Dbg_DumpRxBurst - ************************************************************************//** - * - * Dump a RxBurst - * - * @param [in] u32Level - * Verbosity level of the printed message. - * - * @param [in] prxBurst - * Pointer to the dumped RX burst - * - * @return - * None. - * - * @ingroup gsm_common_debug - * - ***************************************************************************/ -void GsmL1Dbg_DumpRxBurst( uint32_t u32Level, GsmL1_RxBurst_t *prxBurst ); - #ifdef __cplusplus } #endif // extern "C" diff --git a/include/gsml1prim.h b/include/gsml1prim.h index ba86b6e..0e2ac93 100644 --- a/include/gsml1prim.h +++ b/include/gsml1prim.h @@ -68,17 +68,17 @@ typedef struct GsmL1_MeasParam_t ***************************************************************************/ typedef struct GsmL1_DeviceParam_t { - GsmL1_DevType_t devType; ///< Device type + GsmL1_DevType_t devType; ///< Device type - GsmL1_FreqBand_t freqBand; ///< GSM Frequency band used by the TRX device - uint16_t u16Arfcn; ///< Radio frequency channel number - uint16_t u16BcchArfcn; ///< Associated beacon radio frequency channel number - - uint8_t u8NbTsc; ///< Training sequence code to be used for normal bursts - uint8_t u8AutoTA; ///< Automatic timing advance (0:TA is handled by upper layers, 1:TA is handled by layer 1) - float fRxPowerLevel; ///< Nominal RX power level in dBm (use 0 if the control is handled by upper layers) - float fTxPowerLevel; /**< Transmission power level if applicable (in dBm). - @see Verify the values supported by the hardware. */ + GsmL1_FreqBand_t freqBand; ///< GSM Frequency band used by the TRX device + uint16_t u16Arfcn; ///< Radio frequency channel number + uint16_t u16BcchArfcn; ///< Associated beacon radio frequency channel number + + uint8_t u8NbTsc; ///< Training sequence code to be used for normal bursts + uint8_t u8AutoTA; ///< Automatic timing advance (0:TA is handled by upper layers, 1:TA is handled by layer 1) + float fRxPowerLevel; ///< Nominal RX power level in dBm (use 0 if the control is handled by upper layers) + float fTxPowerLevel; /**< Transmission power level if applicable (in dBm). + @see Verify the values supported by the hardware. */ } GsmL1_DeviceParam_t; @@ -179,13 +179,13 @@ typedef struct GsmL1_MphCloseCnf_t ****************************************************************************/ typedef struct GsmL1_MphConnectReq_t { - HANDLE hLayer3; ///< Handle to a layer 3 entity - HANDLE hLayer1; /**< Handle to the layer1 on which the - physical channel is connected. */ + HANDLE hLayer3; ///< Handle to a layer 3 entity + HANDLE hLayer1; /**< Handle to the layer1 on which the + physical channel is connected. */ - uint8_t u8Tn; ///< Time-slot [0..7] - GsmL1_LogChComb_t logChComb; /**< Logical channel multiplexing - over the physical channel */ + uint8_t u8Tn; ///< Time-slot [0..7] + GsmL1_LogChComb_t logChComb; /**< Logical channel multiplexing + over the physical channel */ } GsmL1_MphConnectReq_t; diff --git a/include/gsml1types.h b/include/gsml1types.h index 3b2d3f0..4226719 100644 --- a/include/gsml1types.h +++ b/include/gsml1types.h @@ -30,121 +30,6 @@ ***************************************************************************/ typedef uint32_t HANDLE; -/**************************************************************************** - * typedef : GsmL1_RxBurst - ************************************************************************//** - * - * Individual physical channel message received from the demodulator. - * - * @ingroup gsml1_api_types - * - ***************************************************************************/ -#ifdef QUAD_BAND__ // Quad-Band -typedef struct GsmL1_RxBurst_t -{ - uint32_t u32Sync; ///< Synchronization word (Word 1) - - uint32_t u22Fn : 24; ///< Frame number (Word 2 [0-23]) - uint32_t u8Tn : 8; ///< Time slot number (Word 2 [24-32]) - - uint32_t u8DeviceId : 8; ///< Device Id ( Word 3 [0-7] ) - uint32_t u8AgcScaleFactor : 8; ///< Agc Gain applied to the burst sample is 2^(AGC_SCALE_FACTOR) ( Word 3 [8 - 15] ) - uint32_t u16RfAtten :16; ///< RF attenuator ( Word 3 [16 - 31] ) - - uint32_t u8BurstType : 8; ///< Burst type ( Word 4 [0-7] ) - uint32_t u8RfSync : 8; ///< RF synchronization flag ( Word 4 [8 - 15] ) - int32_t i16Offset : 16; ///< Burst offset ( Word 4 [16-31] ) - - float fRssi; ///< Received signal strength indicator in femtowatt( Word 5 ) - - union - { - float fLQ; ///< Link quality ( Word 6 [0 - 31] ) - float fTsRssi; ///< Received training sequence signal strength indicator in femtowatt( Word 6 ) - } u; - - uint32_t u16XCorr : 16; ///< Correlation result ( Word 7 [0 - 15] ) - uint32_t u16Arfcn : 16; ///< Arfcn (Set by the PhyRf layer ( Word 8 [0 - 15] ) - - GsmL1_Dir_t dir; ///< Direction ( Word 8 [0 - 31] ) - //uint32_t u16Arfcn : 16; ///< Arfcn (Set by the PhyRf layer ( Word 8 [0 - 15] ) - //uint32_t : 16; ///< Reserved bits ( Word 8, [16 - 31] ) - - int8_t pi8Burst[148]; ///< Burst data (148 bytes) - -} GsmL1_RxBurst_t; -#else // DCS-1800 -typedef struct GsmL1_RxBurst_t -{ - uint32_t u32Sync; ///< Synchronization word (Word 1) - - uint32_t u22Fn : 24; ///< Frame number (Word 2 [0-23]) - uint32_t u8Tn : 8; ///< Time slot number (Word 2 [24-32]) - - uint32_t u16DeviceId :16; ///< Device Id ( Word 3 [0-15] ) - uint32_t u8AgcScaleFactor : 8; ///< Agc Gain applied to the burst sample is 2^(AGC_SCALE_FACTOR) ( Word 3 [16 - 23] ) - uint32_t u8RfAtten : 8; ///< RF attenuator ( Word 3 [24 - 31] ) - - uint32_t u8BurstType : 8; ///< Burst type ( Word 4 [0-7] ) - uint32_t u8RfSync : 8; ///< RF synchronization flag ( Word 4 [8 - 15] ) - int32_t i16Offset : 16; ///< Burst offset ( Word 4 [16-31] ) - - float fRssi; ///< Received signal strength indicator in femtowatt( Word 5 ) - - union - { - float fLQ; ///< Link quality ( Word 6 [0 - 31] ) - float fTsRssi; ///< Received training sequence signal strength indicator in femtowatt( Word 6 ) - } u; - - uint32_t u16XCorr : 16; ///< Correlation result ( Word 7 [0 - 15] ) - uint32_t u16Arfcn : 16; ///< Arfcn (Set by the PhyRf layer ( Word 8 [0 - 15] ) - - GsmL1_Dir_t dir; ///< Direction ( Word 8 [0 - 31] ) - //uint32_t u16Arfcn : 16; ///< Arfcn (Set by the PhyRf layer ( Word 8 [0 - 15] ) - //uint32_t : 16; ///< Reserved bits ( Word 8, [16 - 31] ) - - int8_t pi8Burst[148]; ///< Burst data (148 bytes) - -} GsmL1_RxBurst_t; -#endif - -/**************************************************************************** - * typedef : GsmL1_TxBurst - ************************************************************************//** - * - * Individual physical channel message transmitted to the demodulator. - * - * @ingroup gsml1_api_types - * - * @note The [LB] tag means that this field is set in Dsp/Fpga loopback only - ***************************************************************************/ -typedef struct GsmL1_TxBurst_t -{ - uint32_t u32Sync; ///< Synchronization word (Word 1 [0 - 31] ) - - uint32_t u22Fn : 24; ///< Frame number (Word 2 [0-23]) - uint32_t u8Tn : 8; ///< Time slot number (Word 2 [24-32]) - - uint32_t u16DeviceId : 16; ///< Fpga device Id (Word 3 [0 - 15] ) - uint32_t : 16; ///< Reserved bits ( Word 3 [16 - 31] ) - - uint32_t u8BurstType : 8; ///< Burst type ( Word 4 [0-7] ) - uint32_t : 24; ///< Reserved bits ( Word 4 [8-31] ) - - uint32_t u32SubCh : 32; ///< Reserved bits ( Word 5 ) - - uint32_t : 32; ///< Reserved bits ( Word 6 ) - - uint32_t u16Arfcn : 16; ///< [LB] Absolute radio frequency channel number ( Word 8 [ 16-31 ] ) - uint32_t : 16; ///< Reserved word ( Word 8 [ 0-15 ] ) - - GsmL1_Dir_t dir; ///< Direction ( Word 8 [0 - 31] ) - - int8_t pi8Burst[148]; ///< Burst data (148 bytes) - -} GsmL1_TxBurst_t; - /**************************************************************************** * typedef : GsmL1_LogChParam_t ************************************************************************//** @@ -179,6 +64,7 @@ typedef union // TCH struct { + GsmL1_TchPlFmt_t tchPlFmt; ///< Payload format (RFC RTP, Etsi IF2) GsmL1_TchPlType_t tchPlType; ///< Expected payload type (HR, FR, EFR or AMR) GsmL1_AmrCmiPhase_t amrCmiPhase; ///< AMR Codec Mode Indication phase (downlink) GsmL1_AmrCodecMode_t amrInitCodecMode; ///< AMR Initial Codec Mode diff --git a/include/superfemto.h b/include/superfemto.h index a8db0d8..e9c94f4 100644 --- a/include/superfemto.h +++ b/include/superfemto.h @@ -2,7 +2,7 @@ #define FemtoBts_H__ #define FEMTOBTS_API(x,y,z) ((x << 16) | (y << 8) | z) -#define FEMTOBTS_API_VERSION FEMTOBTS_API(2,4,0) +#define FEMTOBTS_API_VERSION FEMTOBTS_API(2,6,0) #ifdef __cplusplus extern "C" {