/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ File: OCTVC1_GSM_API.h Copyright (c) 2015 Octasic Inc. All rights reserved. Description: Contains the definition of the GSM API. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Release: OCTSDR Software Development Kit OCTSDR_GSM-02.02.04-B403 (2015/04/27) $Revision: $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ #ifndef __OCTVC1_GSM_API_H__ #define __OCTVC1_GSM_API_H__ /***************************** INCLUDE FILES *******************************/ #include "../../octdev_types.h" #include "../../octdev_devices.h" #include "../octvc1_msg.h" #include "../octvc1_handle.h" #include "../octvc1_cursor.h" #include "../octvc1_list.h" #include "../octvc1_fifo.h" #include "../octvc1_file.h" #include "../octvc1_radio.h" #include "octvc1_gsm_id.h" #include "octvc1_gsm_rc.h" /************************ COMMON DEFINITIONS *******************************/ #define cOCTVC1_GSM_HOPPING_LIST_MAX_ENTRY 64 /* This is the maximum number of entries in a hopping list */ #define cOCTVC1_GSM_PHYSICAL_MIN_TIMESLOT_NUMBER 0 /* Minimum value of the Physical timeslot number. */ #define cOCTVC1_GSM_PHYSICAL_MAX_TIMESLOT_NUMBER 7 /* Maximum value of the Physical timeslot number. */ #define cOCTVC1_GSM_TRX_MAX_TIMESLOTS (cOCTVC1_GSM_PHYSICAL_MAX_TIMESLOT_NUMBER+1) /* This is the number of timeslots associated with a TRX. */ #define cOCTVC1_GSM_TIMESLOT_MIN_SUBCHANNEL_NUMBER 0 /* Minimum value of the timeslot sub-channel number. */ #define cOCTVC1_GSM_TIMESLOT_MAX_SUBCHANNEL_NUMBER 7 /* Maximum value of the timeslot sub-channel number. */ #define cOCTVC1_GSM_TIMESLOT_ALL_SUBCHANNEL_NUMBER 0xF1 /* Value used to specified an unused timeslot sub-channel. */ #define cOCTVC1_GSM_TIMESLOT_ALL_SUBCHANNEL_ENTRY_INDEX 8 /* Value used to specified the entry index used for ALL_SUBCHANNEL in subchannel */ /* array. */ #define cOCTVC1_GSM_TIMESLOT_MAX_SUBCHANNEL (cOCTVC1_GSM_TIMESLOT_MAX_SUBCHANNEL_NUMBER+2) /* This is the number of subchannels associated with a timeslot. */ #define cOCTVC1_GSM_MAX_FRAME_COUNT 2715647 /* Max frame tick count. */ #define cOCTVC1_GSM_DATA_CONTENT_SIZE 468 /* Data content buffer size in bytes. */ #define cOCTVC1_GSM_RATE_LIST_SIZE 4 /* Rate list size. */ #define cOCTVC1_GSM_RACH_IND_MSG_SIZE 32 /* RACH indication content buffer size. */ #define cOCTVC1_GSM_TRX_ID_LIST_MAX_ENTRY 32 /* Maximum number of TRX_ID per list. */ #define cOCTVC1_GSM_PHYSICAL_CHANNEL_ID_LIST_MAX_ENTRY 32 /* Maximum number of PHYSICAL_CHANNEL_ID per list. */ #define cOCTVC1_GSM_LOGICAL_CHANNEL_ID_LIST_MAX_ENTRY 128 /* Maximum number of LOGICAL_CHANNEL_ID per list. */ #define cOCTVC1_GSM_CIPHER_KEY_LENGTH 8 /* Cipher key bytes count. */ /*------------------------------------------------------------------------------------- tOCTVC1_GSM_CMI_PHASE_ENUM : CMI phase. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_CMI_PHASE_ENUM tOCT_UINT8 #define cOCTVC1_GSM_CMI_PHASE_ENUM_EVEN 0 #define cOCTVC1_GSM_CMI_PHASE_ENUM_ODD 1 /*------------------------------------------------------------------------------------- tOCTVC1_GSM_AMR_CODEC_MODE_ENUM : AMR codec mode. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_AMR_CODEC_MODE_ENUM tOCT_UINT8 #define cOCTVC1_GSM_AMR_CODEC_MODE_ENUM_RATE_4_75 0x00 #define cOCTVC1_GSM_AMR_CODEC_MODE_ENUM_RATE_5_15 0x01 #define cOCTVC1_GSM_AMR_CODEC_MODE_ENUM_RATE_5_90 0x02 #define cOCTVC1_GSM_AMR_CODEC_MODE_ENUM_RATE_6_70 0x03 #define cOCTVC1_GSM_AMR_CODEC_MODE_ENUM_RATE_7_40 0x04 #define cOCTVC1_GSM_AMR_CODEC_MODE_ENUM_RATE_7_95 0x05 #define cOCTVC1_GSM_AMR_CODEC_MODE_ENUM_RATE_10_2 0x07 #define cOCTVC1_GSM_AMR_CODEC_MODE_ENUM_RATE_12_2 0x08 #define cOCTVC1_GSM_AMR_CODEC_MODE_ENUM_UNSET 0x0f /*------------------------------------------------------------------------------------- tOCTVC1_GSM_ID_DIRECTION_ENUM : Sub Channel Direction. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_ID_DIRECTION_ENUM tOCT_UINT8 #define cOCTVC1_GSM_ID_DIRECTION_ENUM_NONE 0 #define cOCTVC1_GSM_ID_DIRECTION_ENUM_RX_BTS_MS 1 #define cOCTVC1_GSM_ID_DIRECTION_ENUM_TX_BTS_MS 3 /*------------------------------------------------------------------------------------- tOCTVC1_GSM_DIRECTION_ENUM : Sub Channel Direction. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_DIRECTION_ENUM tOCT_UINT8 #define cOCTVC1_GSM_DIRECTION_ENUM_NONE cOCTVC1_GSM_ID_DIRECTION_ENUM_NONE #define cOCTVC1_GSM_DIRECTION_ENUM_RX_BTS_MS cOCTVC1_GSM_ID_DIRECTION_ENUM_RX_BTS_MS #define cOCTVC1_GSM_DIRECTION_ENUM_TX_BTS_MS cOCTVC1_GSM_ID_DIRECTION_ENUM_TX_BTS_MS /*------------------------------------------------------------------------------------- tOCTVC1_GSM_ID_TIMESLOT_NB_ENUM : Time slot number. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_ID_TIMESLOT_NB_ENUM tOCT_UINT8 #define cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_0 0 #define cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_1 1 #define cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_2 2 #define cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_3 3 #define cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_4 4 #define cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_5 5 #define cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_6 6 #define cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_7 7 /*------------------------------------------------------------------------------------- tOCTVC1_GSM_TIMESLOT_NB_ENUM : Time slot number. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_TIMESLOT_NB_ENUM tOCT_UINT32 #define cOCTVC1_GSM_TIMESLOT_NB_ENUM_0 cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_0 #define cOCTVC1_GSM_TIMESLOT_NB_ENUM_1 cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_1 #define cOCTVC1_GSM_TIMESLOT_NB_ENUM_2 cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_2 #define cOCTVC1_GSM_TIMESLOT_NB_ENUM_3 cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_3 #define cOCTVC1_GSM_TIMESLOT_NB_ENUM_4 cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_4 #define cOCTVC1_GSM_TIMESLOT_NB_ENUM_5 cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_5 #define cOCTVC1_GSM_TIMESLOT_NB_ENUM_6 cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_6 #define cOCTVC1_GSM_TIMESLOT_NB_ENUM_7 cOCTVC1_GSM_ID_TIMESLOT_NB_ENUM_7 /*------------------------------------------------------------------------------------- tOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM : Sub Channel number. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM tOCT_UINT8 #define cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_0 0 #define cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_1 1 #define cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_2 2 #define cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_2 2 #define cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_3 3 #define cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_4 4 #define cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_5 5 #define cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_6 6 #define cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_7 7 #define cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_ALL 0xF1 /*------------------------------------------------------------------------------------- tOCTVC1_GSM_SUB_CHANNEL_NB_ENUM : Sub Channel number. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_SUB_CHANNEL_NB_ENUM tOCT_UINT32 #define cOCTVC1_GSM_SUB_CHANNEL_NB_ENUM_0 cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_0 #define cOCTVC1_GSM_SUB_CHANNEL_NB_ENUM_1 cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_1 #define cOCTVC1_GSM_SUB_CHANNEL_NB_ENUM_2 cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_2 #define cOCTVC1_GSM_SUB_CHANNEL_NB_ENUM_3 cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_3 #define cOCTVC1_GSM_SUB_CHANNEL_NB_ENUM_4 cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_4 #define cOCTVC1_GSM_SUB_CHANNEL_NB_ENUM_5 cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_5 #define cOCTVC1_GSM_SUB_CHANNEL_NB_ENUM_6 cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_6 #define cOCTVC1_GSM_SUB_CHANNEL_NB_ENUM_7 cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_7 #define cOCTVC1_GSM_SUB_CHANNEL_NB_ENUM_ALL cOCTVC1_GSM_ID_SUB_CHANNEL_NB_ENUM_ALL /*------------------------------------------------------------------------------------- tOCTVC1_GSM_CIPHERING_ID_ENUM : Sub Channel Direction. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_CIPHERING_ID_ENUM tOCT_UINT32 #define cOCTVC1_GSM_CIPHERING_ID_ENUM_UNUSED 0 #define cOCTVC1_GSM_CIPHERING_ID_ENUM_A5_0 1 #define cOCTVC1_GSM_CIPHERING_ID_ENUM_A5_1 2 #define cOCTVC1_GSM_CIPHERING_ID_ENUM_A5_2 3 #define cOCTVC1_GSM_CIPHERING_ID_ENUM_A5_3 4 /*------------------------------------------------------------------------------------- tOCTVC1_GSM_SUBCHANNEL_MASK : Sub channel Mask. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_SUBCHANNEL_MASK tOCT_UINT32 #define cOCTVC1_GSM_SUBCHANNEL_MASK_0 ((tOCT_UINT32)(1<<0) ) #define cOCTVC1_GSM_SUBCHANNEL_MASK_1 ((tOCT_UINT32)(1<<1) ) #define cOCTVC1_GSM_SUBCHANNEL_MASK_2 ((tOCT_UINT32)(1<<2) ) #define cOCTVC1_GSM_SUBCHANNEL_MASK_3 ((tOCT_UINT32)(1<<3) ) #define cOCTVC1_GSM_SUBCHANNEL_MASK_4 ((tOCT_UINT32)(1<<4) ) #define cOCTVC1_GSM_SUBCHANNEL_MASK_5 ((tOCT_UINT32)(1<<5) ) #define cOCTVC1_GSM_SUBCHANNEL_MASK_6 ((tOCT_UINT32)(1<<6) ) #define cOCTVC1_GSM_SUBCHANNEL_MASK_7 ((tOCT_UINT32)(1<<7) ) /*------------------------------------------------------------------------------------- tOCTVC1_GSM_BURST_TYPE_ENUM : Burst type. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_BURST_TYPE_ENUM tOCT_UINT32 #define cOCTVC1_GSM_BURST_TYPE_ENUM_SYNC 0 #define cOCTVC1_GSM_BURST_TYPE_ENUM_NORMAL 1 #define cOCTVC1_GSM_BURST_TYPE_ENUM_DUMMY 2 #define cOCTVC1_GSM_BURST_TYPE_ENUM_NORMAL_8PSK 3 #define cOCTVC1_GSM_BURST_TYPE_ENUM_ACCESS_TRAINING_0 4 #define cOCTVC1_GSM_BURST_TYPE_ENUM_ACCESS_TRAINING_1 5 #define cOCTVC1_GSM_BURST_TYPE_ENUM_ACCESS_TRAINING_2 6 #define cOCTVC1_GSM_BURST_TYPE_ENUM_FREQ_CORRECTION 7 /*------------------------------------------------------------------------------------- tOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM : Timeslot channel type. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM tOCT_UINT32 #define cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_EMPTY 0 #define cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_TCHF_FACCHF_SACCHTF 1 #define cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_TCHH_FACCHH_SACCHTH 2 #define cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_FCCH_SCH_BCCH_CCCH 3 #define cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_FCCH_SCH_BCCH_CCCH_SDCCH4_SACCHC4 4 #define cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_SDCCH8_SACCHC8 5 #define cOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM_PDTCHF_PACCHF_PTCCHF 6 /*------------------------------------------------------------------------------------- tOCTVC1_GSM_PAYLOAD_TYPE_ENUM : -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_PAYLOAD_TYPE_ENUM tOCT_UINT32 #define cOCTVC1_GSM_PAYLOAD_TYPE_ENUM_NONE 0 #define cOCTVC1_GSM_PAYLOAD_TYPE_ENUM_FULL_RATE 1 #define cOCTVC1_GSM_PAYLOAD_TYPE_ENUM_ENH_FULL_RATE 2 #define cOCTVC1_GSM_PAYLOAD_TYPE_ENUM_HALF_RATE 3 #define cOCTVC1_GSM_PAYLOAD_TYPE_ENUM_AMR_FULL_RATE 4 #define cOCTVC1_GSM_PAYLOAD_TYPE_ENUM_AMR_HALF_RATE 5 /*------------------------------------------------------------------------------------- tOCTVC1_GSM_SAPI_ENUM : Timeslot channel type. -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_SAPI_ENUM tOCT_UINT8 #define cOCTVC1_GSM_SAPI_ENUM_IDLE 0 #define cOCTVC1_GSM_SAPI_ENUM_FCCH 1 /* Frequency Correction burst pseudo-Channel */ #define cOCTVC1_GSM_SAPI_ENUM_SCH 2 /* Synchronization channel */ #define cOCTVC1_GSM_SAPI_ENUM_SACCH 3 /* Slow Associated Control Channel */ #define cOCTVC1_GSM_SAPI_ENUM_SDCCH 4 /* Stand-Alone Dedicated Control Channel */ #define cOCTVC1_GSM_SAPI_ENUM_BCCH 5 /* Broadcast Control Channel */ #define cOCTVC1_GSM_SAPI_ENUM_PCH_AGCH 7 /* Paging and Access Grant Channel */ #define cOCTVC1_GSM_SAPI_ENUM_CBCH 8 /* Cell Broadcast Channel */ #define cOCTVC1_GSM_SAPI_ENUM_RACH 9 /* Random Access Channel */ #define cOCTVC1_GSM_SAPI_ENUM_TCHF 10 /* Full rate speech TCH */ #define cOCTVC1_GSM_SAPI_ENUM_FACCHF 11 /* Full rate FACCH */ #define cOCTVC1_GSM_SAPI_ENUM_TCHH 12 /* Half rate speech TCH */ #define cOCTVC1_GSM_SAPI_ENUM_FACCHH 13 /* Half rate FACCH */ #define cOCTVC1_GSM_SAPI_ENUM_NCH 14 /* Notification Channel */ #define cOCTVC1_GSM_SAPI_ENUM_PDTCH 15 /* EGPRS Packet Data Traffic Channel */ #define cOCTVC1_GSM_SAPI_ENUM_PACCH 16 /* EGPRS Packet Associated Control Channel */ #define cOCTVC1_GSM_SAPI_ENUM_PBCCH 17 /* EGPRS Packet Broadcast Control Channel */ #define cOCTVC1_GSM_SAPI_ENUM_PAGCH 18 /* EGPRS Packet Access Grant Channel */ #define cOCTVC1_GSM_SAPI_ENUM_PPCH 19 /* EGPRS Packet Paging Channel */ #define cOCTVC1_GSM_SAPI_ENUM_PNCH 20 /* EGPRS Packet Notification Channel */ #define cOCTVC1_GSM_SAPI_ENUM_PTCCH 21 /* EGPRS Packet Timing advance Control Channel */ #define cOCTVC1_GSM_SAPI_ENUM_PRACH 22 /* EGPRS Packet Random Access Channel */ /*------------------------------------------------------------------------------------- tOCTVC1_GSM_SAPI_MASK : SAPI_MASK -------------------------------------------------------------------------------------*/ #define tOCTVC1_GSM_SAPI_MASK tOCT_UINT32 #define cOCTVC1_GSM_SAPI_MASK_IDLE ((tOCT_UINT32)(1<