blob: 7ec710c33ef8dd4100a03f1d8562aecae4bd11b8 [file] [log] [blame]
Holger Hans Peter Freyther511f9c32012-10-13 12:38:54 +02001#ifndef ARFCN_RANGE_ENCODE_H
2#define ARFCN_RANGE_ENCODE_H
3
4#include <stdint.h>
5
Max34be86b2016-12-16 18:45:51 +01006enum gsm48_range {
Holger Hans Peter Freyther511f9c32012-10-13 12:38:54 +02007 ARFCN_RANGE_INVALID = -1,
8 ARFCN_RANGE_128 = 127,
9 ARFCN_RANGE_256 = 255,
10 ARFCN_RANGE_512 = 511,
11 ARFCN_RANGE_1024 = 1023,
12};
13
14#define RANGE_ENC_MAX_ARFCNS 29
15
16int range_enc_determine_range(const int *arfcns, int size, int *f0_out);
Max34be86b2016-12-16 18:45:51 +010017int range_enc_arfcns(enum gsm48_range rng, const int *arfcns, int sze, int *out, int idx);
18int range_enc_find_index(enum gsm48_range rng, const int *arfcns, int size);
Jacob Erlbeck45014a02014-01-14 10:42:58 +010019int range_enc_filter_arfcns(int *arfcns, const int sze, const int f0, int *f0_included);
Holger Hans Peter Freyther511f9c32012-10-13 12:38:54 +020020
21int range_enc_range128(uint8_t *chan_list, int f0, int *w);
22int range_enc_range256(uint8_t *chan_list, int f0, int *w);
23int range_enc_range512(uint8_t *chan_list, int f0, int *w);
24int range_enc_range1024(uint8_t *chan_list, int f0, int f0_incl, int *w);
25
26#endif