libosmogsm  0.11.0-dirty
Osmocom GSM library
include/osmocom/gsm/bts_features.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <osmocom/core/utils.h>
00004 #include <osmocom/core/bitvec.h>
00005 
00006 #define MAX_BTS_FEATURES 128
00007 
00008 /* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility
00009    with BTS compiled against earlier version of this header. Also make sure that the description strings
00010    gsm_bts_features_descs[] in gsm_data.c are also updated accordingly! */
00011 enum osmo_bts_features {
00012         BTS_FEAT_HSCSD,
00013         BTS_FEAT_GPRS,
00014         BTS_FEAT_EGPRS,
00015         BTS_FEAT_ECSD,
00016         BTS_FEAT_HOPPING,
00017         BTS_FEAT_MULTI_TSC,
00018         BTS_FEAT_OML_ALERTS,
00019         BTS_FEAT_AGCH_PCH_PROP,
00020         BTS_FEAT_CBCH,
00021         BTS_FEAT_SPEECH_F_V1,
00022         BTS_FEAT_SPEECH_H_V1,
00023         BTS_FEAT_SPEECH_F_EFR,
00024         BTS_FEAT_SPEECH_F_AMR,
00025         BTS_FEAT_SPEECH_H_AMR,
00026         _NUM_BTS_FEAT
00027 };
00028 
00029 extern const struct value_string osmo_bts_features_descs[];
00030 
00031 const char *osmo_bts_feature_name(enum osmo_bts_features feature);
00032 
00033 static inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
00034 {
00035         OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
00036         return bitvec_set_bit_pos(features, feature, 1);
00037 }
00038 
00039 static inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
00040 {
00041         OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
00042         return bitvec_get_bit_pos(features, feature);
00043 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines