From d6a45b402c5c09e079371eddbb6fbb6c4757aeab Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Tue, 8 Dec 2015 13:55:17 +0100 Subject: asn1helpers: Add 28 bit conversion function and use it for Cell ID The padding bits in the bit string are at the end and the byte-order is MSB-first. This means the number needs to be shifted left so the padding bits are the least significant. --- src/hnbgw_hnbap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/hnbgw_hnbap.c') diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index 3e3715c..97cb32b 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -120,7 +120,7 @@ static int hnbgw_rx_hnb_register_req(struct hnb_context *ctx, ANY_t *in) ctx->id.lac = asn1str_to_u16(&ies.lac); ctx->id.sac = asn1str_to_u16(&ies.sac); ctx->id.rac = asn1str_to_u8(&ies.rac); - ctx->id.cid = asn1bitstr_to_u32(&ies.cellIdentity); + ctx->id.cid = asn1bitstr_to_u28(&ies.cellIdentity); //ctx->id.mcc FIXME //ctx->id.mnc FIXME -- cgit v1.2.3