libosmogsm  1.4.0
Osmocom GSM library
bts_features.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <osmocom/core/utils.h>
4 #include <osmocom/core/bitvec.h>
5 
6 #define MAX_BTS_FEATURES 128
7 
8 /* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility
9  with BTS compiled against earlier version of this header. Also make sure that the description strings
10  gsm_bts_features_descs[] in gsm_data.c are also updated accordingly! */
27  BTS_FEAT_PAGING_COORDINATION, /* BTS hands CS paging to PCU/PACCH */
30 };
31 
32 extern const struct value_string osmo_bts_features_descs[];
33 
34 const char *osmo_bts_feature_name(enum osmo_bts_features feature);
35 
36 static inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
37 {
39  return bitvec_set_bit_pos(features, feature, 1);
40 }
41 
42 static inline int osmo_bts_unset_feature(struct bitvec *features, enum osmo_bts_features feature)
43 {
45  return bitvec_set_bit_pos(features, feature, 0);
46 }
47 
48 static inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
49 {
51  return bitvec_get_bit_pos(features, feature) == ONE;
52 }
BTS_FEAT_ETWS_PN
@ BTS_FEAT_ETWS_PN
Definition: bts_features.h:26
_NUM_BTS_FEAT
@ _NUM_BTS_FEAT
Definition: bts_features.h:29
bitvec_set_bit_pos
int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnr, enum bit_value bit)
bitvec_get_bit_pos
enum bit_value bitvec_get_bit_pos(const struct bitvec *bv, unsigned int bitnr)
OSMO_ASSERT
#define OSMO_ASSERT(exp)
utils.h
BTS_FEAT_SPEECH_H_AMR
@ BTS_FEAT_SPEECH_H_AMR
Definition: bts_features.h:25
osmo_bts_features
osmo_bts_features
Definition: bts_features.h:11
BTS_FEAT_OML_ALERTS
@ BTS_FEAT_OML_ALERTS
Definition: bts_features.h:18
BTS_FEAT_HOPPING
@ BTS_FEAT_HOPPING
Definition: bts_features.h:16
BTS_FEAT_CBCH
@ BTS_FEAT_CBCH
Definition: bts_features.h:20
BTS_FEAT_ECSD
@ BTS_FEAT_ECSD
Definition: bts_features.h:15
BTS_FEAT_SPEECH_F_AMR
@ BTS_FEAT_SPEECH_F_AMR
Definition: bts_features.h:24
osmo_bts_features_descs
const struct value_string osmo_bts_features_descs[]
Definition: bts_features.c:26
BTS_FEAT_SPEECH_H_V1
@ BTS_FEAT_SPEECH_H_V1
Definition: bts_features.h:22
BTS_FEAT_GPRS
@ BTS_FEAT_GPRS
Definition: bts_features.h:13
BTS_FEAT_IPV6_NSVC
@ BTS_FEAT_IPV6_NSVC
Definition: bts_features.h:28
BTS_FEAT_HSCSD
@ BTS_FEAT_HSCSD
Definition: bts_features.h:12
bitvec.h
BTS_FEAT_MULTI_TSC
@ BTS_FEAT_MULTI_TSC
Definition: bts_features.h:17
BTS_FEAT_PAGING_COORDINATION
@ BTS_FEAT_PAGING_COORDINATION
Definition: bts_features.h:27
osmo_bts_has_feature
static bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:48
bitvec
ONE
ONE
value_string
BTS_FEAT_AGCH_PCH_PROP
@ BTS_FEAT_AGCH_PCH_PROP
Definition: bts_features.h:19
BTS_FEAT_EGPRS
@ BTS_FEAT_EGPRS
Definition: bts_features.h:14
osmo_bts_unset_feature
static int osmo_bts_unset_feature(struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:42
BTS_FEAT_SPEECH_F_EFR
@ BTS_FEAT_SPEECH_F_EFR
Definition: bts_features.h:23
osmo_bts_set_feature
static int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:36
osmo_bts_feature_name
const char * osmo_bts_feature_name(enum osmo_bts_features feature)
return string representation of a BTS feature
Definition: bts_features.c:48
MAX_BTS_FEATURES
#define MAX_BTS_FEATURES
Definition: bts_features.h:6
BTS_FEAT_SPEECH_F_V1
@ BTS_FEAT_SPEECH_F_V1
Definition: bts_features.h:21