From 64277e6514d5b305af97d6cfe07601ba00d8afaa Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Fri, 10 Jan 2014 17:47:43 +0100 Subject: si: Implement range 128, 256, 1024 encoding This commit adds the implementation of these range formats to the encoder. In addition, the work-around that tried range 512 first is removed, so that the selection is primarily based on the max distance between frequencies. Ticket: OW#1061 Sponsored-by: On-Waves ehf --- openbsc/src/libbsc/arfcn_range_encode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'openbsc/src/libbsc/arfcn_range_encode.c') diff --git a/openbsc/src/libbsc/arfcn_range_encode.c b/openbsc/src/libbsc/arfcn_range_encode.c index 1a26523e9..e67bf0a70 100644 --- a/openbsc/src/libbsc/arfcn_range_encode.c +++ b/openbsc/src/libbsc/arfcn_range_encode.c @@ -270,8 +270,8 @@ int range_enc_range128(uint8_t *chan_list, int f0, int *w) chan_list[0] = 0x8C; write_orig_arfcn(chan_list, f0); - LOGP(DRR, LOGL_ERROR, "Range128 encoding is not implemented.\n"); - return -1; + write_all_wn(&chan_list[2], 1, w, 28, 7); + return 0; } int range_enc_range256(uint8_t *chan_list, int f0, int *w) @@ -279,8 +279,8 @@ int range_enc_range256(uint8_t *chan_list, int f0, int *w) chan_list[0] = 0x8A; write_orig_arfcn(chan_list, f0); - LOGP(DRR, LOGL_ERROR, "Range256 encoding is not implemented.\n"); - return -1; + write_all_wn(&chan_list[2], 1, w, 21, 8); + return 0; } int range_enc_range512(uint8_t *chan_list, int f0, int *w) @@ -296,8 +296,8 @@ int range_enc_range1024(uint8_t *chan_list, int f0, int f0_included, int *w) { chan_list[0] = 0x80 | (f0_included << 2); - LOGP(DRR, LOGL_ERROR, "Range1024 encoding is not implemented.\n"); - return -1; + write_all_wn(&chan_list[0], 6, w, 16, 10); + return 0; } int range_enc_filter_arfcns(int *arfcns, -- cgit v1.2.3