From 5baa3ab09fff0836306324f7e98e1fe0bd679f38 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 18 Nov 2012 09:55:59 +0100 Subject: [PATCH] update to femtobts API version v2.4 --- include/gsml1const.h | 27 ++++++++++++++++++++++++--- include/gsml1prim.h | 2 ++ include/gsml1types.h | 39 ++++++++++++++++++++++++++++++++++++++- include/superfemto.h | 2 +- 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/include/gsml1const.h b/include/gsml1const.h index 318bf08..dc8a30f 100644 --- a/include/gsml1const.h +++ b/include/gsml1const.h @@ -5,6 +5,7 @@ extern "C" { #endif // __cplusplus +#define L1_HAS_EFR /**************************************************************************** * Public macro * @@ -337,7 +338,7 @@ typedef enum GsmL1_If2FrTypeIdx_t * typedef enum : GsmL1_TchPlType_t ************************************************************************//** * - * List of every payload type supported on a Half-Rate physical channel + * List of every payload type supported on a TCH physical channel. * * @ingroup gsml1_api_const * @@ -346,8 +347,9 @@ typedef enum GsmL1_TchPlType_t { GsmL1_TchPlType_NA = 0, ///< Not applicable, unknown, invalid - GsmL1_TchPlType_Fr, ///< Compacted ETSI hull-rate traffic speech frame + GsmL1_TchPlType_Fr, ///< Compacted ETSI full-rate traffic speech frame GsmL1_TchPlType_Hr, ///< Compacted ETSI half-rate traffic speech frame + GsmL1_TchPlType_Efr, ///< Compacted ETSI enhanced full-rate traffic speech frame GsmL1_TchPlType_Amr, ///< RTP/IF2 adaptive multi-rate traffic speech frame // These cannot be formatted using IF2 format !! @@ -364,6 +366,25 @@ typedef enum GsmL1_TchPlType_t } GsmL1_TchPlType_t; +/**************************************************************************** + * typedef enum : GsmL1_PdtchPlType_t + ************************************************************************//** + * + * List of every payload type supported on a PDTCH physical channel. + * + * @ingroup gsml1_api_const + * + ***************************************************************************/ +typedef enum GsmL1_PdtchPlType_t +{ + GsmL1_PdtchPlType_NA = 0x00, ///< Not applicable, unknown, invalid + GsmL1_PdtchPlType_Hdr = 0x01, ///< Header only is present and valid + GsmL1_PdtchPlType_Hdr_Data1 = 0x03, ///< Header and 1st half of data (2nd half is present but invalid) + GsmL1_PdtchPlType_Hdr_Data2 = 0x05, ///< Header and 2nd half of data (1st half is present but invalid) + GsmL1_PdtchPlType_Full = 0x07 ///< Full data present and valid + +} GsmL1_PdtchPlType_t; + /**************************************************************************** * typedef enum : GsmL1_AmrCodec_t ************************************************************************//** @@ -451,7 +472,7 @@ typedef enum GsmL1_ConfigParamId_t ****************************************************************************/ /// Maximum length of a layer 2 message unit. -#define MAX_L2MSGSIZE 157 // ( Based on a PDTCH block type 13 (MCS-9) [155 bytes] ) +#define MAX_L2MSGSIZE 160 // ( Based on a PDTCH block type 13 (MCS-9) [155 bytes] ) /// Advance taken by the library (counted in frames where 1 frame = 8 timeslots ) #define GSML1_FN_ADVANCE 6 diff --git a/include/gsml1prim.h b/include/gsml1prim.h index 7cd5b56..ba86b6e 100644 --- a/include/gsml1prim.h +++ b/include/gsml1prim.h @@ -281,6 +281,8 @@ typedef struct GsmL1_MphActivateReq_t GsmL1_Sapi_t sapi; ///< Service access point identifier GsmL1_Dir_t dir; ///< Direction path to configure + float fBFILevel; /**< Bad Frame Indication RX power level in dBm + (use 0 do disable BFI) */ GsmL1_LogChParam_t logChPrm; ///< Additional configuration parameters } GsmL1_MphActivateReq_t; diff --git a/include/gsml1types.h b/include/gsml1types.h index 805f1b8..3b2d3f0 100644 --- a/include/gsml1types.h +++ b/include/gsml1types.h @@ -39,7 +39,42 @@ typedef uint32_t HANDLE; * @ingroup gsml1_api_types * ***************************************************************************/ - typedef struct GsmL1_RxBurst_t +#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) @@ -72,6 +107,7 @@ typedef uint32_t HANDLE; int8_t pi8Burst[148]; ///< Burst data (148 bytes) } GsmL1_RxBurst_t; +#endif /**************************************************************************** * typedef : GsmL1_TxBurst @@ -143,6 +179,7 @@ typedef union // TCH struct { + 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 GsmL1_AmrCodec_t amrActiveCodecSet[4]; ///< AMR Active Codec Set diff --git a/include/superfemto.h b/include/superfemto.h index 3fd6c7a..a8db0d8 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,3,0) +#define FEMTOBTS_API_VERSION FEMTOBTS_API(2,4,0) #ifdef __cplusplus extern "C" {