Open srikanta-lekha opened 2 years ago
Hello, I am facing the same issue. Did you find a solution?
Hi, I re-generated ASN files by using latest ASN compiler. In the newly generated file data type became "long long".
/*
Thank you, guess I will have to build the newest version
Hi,
I am trying to encode a 40bit unsigned integer.
Constraint generated by ASN compiler: asn_per_constraints_t asn_PER_type_NGAP_AMF_UE_NGAP_ID_constr_1 CC_NOTUSED = { { APC_CONSTRAINED, 40, -1, 0, 1099511627775 } / (0..1099511627775) /, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 / No PER value map / };
By using Size-specific conversion helpers available in INTEGER.h I could able to fill its value. But when I tried to encode it using "aper_encode_to_buffer()", constraint check is failing.
What I observed is :
/*
here upper_bound is of type long, and tries to store 1099511627775. So the per constraint value becomes: (gdb) p *td->encoding_constraints.per_constraints $5 = {value = {flags = APC_CONSTRAINED, range_bits = 40, effective_bits = -1, lower_bound = 0, upper_bound = -1}, size = {flags = APC_UNCONSTRAINED, range_bits = -1, effective_bits = -1, lower_bound = 0, upper_bound = 0}, value2code = 0, code2value = 0}
Since the upper bound becomes -1, every time asn encoding is failing.
Could you please help me to resolve this. Please let me know if you need more information.
Thanks in advance.