libosmogsm  1.4.1
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 }
Definition: bts_features.h:23
osmo_bts_features
Definition: bts_features.h:11
Definition: bts_features.h:21
Definition: bts_features.h:12
Definition: bts_features.h:24
#define OSMO_ASSERT(exp)
Definition: bts_features.h:16
Definition: bts_features.h:25
int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnr, enum bit_value bit)
ONE
Definition: bts_features.h:13
const struct value_string osmo_bts_features_descs[]
Definition: bts_features.c:26
enum bit_value bitvec_get_bit_pos(const struct bitvec *bv, unsigned int bitnr)
Definition: bts_features.h:18
Definition: bts_features.h:15
Definition: bts_features.h:20
Definition: bts_features.h:22
Definition: bts_features.h:17
Definition: bts_features.h:19
static int osmo_bts_unset_feature(struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:42
static bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:48
Definition: bts_features.h:27
Definition: bts_features.h:28
Definition: bts_features.h:14
#define MAX_BTS_FEATURES
Definition: bts_features.h:6
Definition: bts_features.h:26
Definition: bts_features.h:29
static int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:36
const char * osmo_bts_feature_name(enum osmo_bts_features feature)
return string representation of a BTS feature
Definition: bts_features.c:48