Thanks for reply. Comments are inline.
On 04/15/2016 07:36 PM, Holger Freyther wrote:
On 15 Apr 2016, at 12:16, Max msuraev@sysmocom.de wrote:
Hi.
How to properly use range_enc_arfcns() and range_enc_range*() from arfcn_range_decode.h? There're not many comments around the code. From function signature it seems like range_enc_arfcns() will put results into w parameter but in system_information.c after that there's also call to one of range_enc_range*().
I've tried to feed output to wireshark but it decode some unexpected stuff. So, if I have a sequence of ints which I'd like to run through range512 for example - ho do I get the output?
1st Determine which range to use
If I know range in advance than this step can be skipped - are there some side effects to range_enc_determine_range() function? What's the meaning of f0?
2nd filter out ARFCNs, e.g. if ARFCN 0 is included in the set or not
So, range_enc_filter_arfcns() changes both arfcns and f0_included ?
3rd encode according to the range
So how do I supply input and where do I get output? The input is previously processed arfcns parameter to range_enc_arfcn() and the output is taken from which parameter of range_enc_range()?
does this already help?
Not entirely but we're getting there.
range = range_enc_determine_range(arfcns, arfcns_used, &f0); if (range == ARFCN_RANGE_INVALID) return -2; /* * Manipulate the ARFCN list according to the rules in J4 depending * on the selected range. */ arfcns_used = range_enc_filter_arfcns(arfcns, arfcns_used, f0, &f0_included); memset(w, 0, sizeof(w)); rc = range_enc_arfcns(range, arfcns, arfcns_used, w, 0); if (rc != 0)...
switch (range) { case ARFCN_RANGE_128: return range_enc_range128(chan_list, f0, w); break; case ARFCN_RANGE_256: