On Wed, 2016-04-06 at 17:46 +0200, Neels Hofmeyr wrote:
On Wed, Apr 06, 2016 at 05:18:54PM +0200, Daniel
Willmann wrote:
In 3GPP
TS 25.413 in 9.2.3.55 PLMN Identity, I see a very similar definition
for BCD coding, but it omits the detail to put the last MNC digit into the
second byte. So, by omittance, it defines a different coding from 04.08:
21 f3 54 (same)
but
21 43 65
respectively.
This is what the hnb does. A PLMNID of 901123 results in
09 11 32 being transmitted in HNBAP.
PLMNID of 90123 corresponds to 09 f1 32
The RANAP fields for LAI and SAI are encoded the same.
[...]
Since the coding differs I wouldn't try to
merge the implementations.
I'd think that it would obscure more than it helps.
Excellent, thanks for testing it!! Quite curious result though.
I agree to not use gsm48_mcc_mnc_from_bcd() directly, but maybe
ranap_parse_lai() can reuse some more general bcd code...
Yeah, that could help. The BCD descrambling is needed for more than
those two (MSISDN, IMSI, ...).
Fun fact: The Dell phone displays the network correctly as 901123 - the
Sony Ericsson K800i incorrectly displays it as 901231. :-)
Daniel
--
- Daniel Willmann <dwillmann(a)sysmocom.de>
http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte