Normally, there is a value in this line matching with "WORD", and I want to know where is it.
O = Offset of the encoded element in the unber input stream.
T = The tag class and value in human readable form.
V = The length of the value (V, encoded by the L), may be "Indefinite".
Where is my value? I don't really know what are this letters.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I understand you correctly, you'd like to know which field in the ASN.1 specification this WORD value corresponds to. You can infer this information, although not as quickly as you'd like.
The "unber" tool just decodes the BER-encoded binary byte stream. That BER stream must have been produced by the BER-compliant encoder, possibly with the help of some ASN.1 compiler and the corresponding ASN.1 module specification. The specification text (the "measObjInstId") is not retained in the BER-encoded binary byte stream. Unlike XML, the names which you see in the ASN.1 specifications do not get stored in BER files. Therefore, the "unber" tool cannot pinpoint the corresponding ASN.1 type by scanning the BER output. The "unber" tool has no knowledge of the ASN.1 specification involved in producing that BER file. It just outputs the raw BER structure that it sees in a little bit more readable way, and that structure does not contain the ASN.1 type names.
However, the BER structure contains the tag names that you can manually associate with the corresponding ASN.1 type.
Unfortunately, the version of MEAS specification that I have does not have the GraphicString type, so I suspect you either have a different version spec or that spec is possibly broken. It is almost certainly broken, since I see in my ASN.1 spec that measObjInstId is of type PrintableString, not of type GraphicString, and that spec would have ben outputted using human readable characters instead of hexadecimal bytes. The hexadecimal bytes in your <measObjInstId> means that asn1c thinks the string is not supposed to contain human readable values, and consequently does not print them as human readable values.
You can try to convert the values of <measObjInstId> back to string to see its contents:
This is likely the string that you were looking for.
In order to make asn1c generate code which would print this as a human readable string, you'd have to trick it into thinking this is a PrintableString. Somewhat like this: instead of
measObjInstId GraphicString
you'd put
measObjInstId IMPLICIT PrintableString
into the spec. This way, the value will be printed as human readable one.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
I use this command :
In the output.txt i have:
I would like to know where is the value matching with "WORD".
Can you help me?
Thanks.
It is in the file named "file", at byte offset 123.
Thanks, it's in "file" ou in "output"?
The only difference is output is the file decoded.
The offset is the line, isn't it?
I want the to know where is the value who correspond with "WORD".
Is it the number "25"?
I fail to understand the question. Would you please rephrase it differently?
In the file "output.txt", I have 200 000 lines, so I search the line containing "WORD".
So, I have this line :
Normally, there is a value in this line matching with "WORD", and I want to know where is it.
O = Offset of the encoded element in the unber input stream.
T = The tag class and value in human readable form.
V = The length of the value (V, encoded by the L), may be "Indefinite".
Where is my value? I don't really know what are this letters.
When I decode with asn1c, I have that:
<MeasValue>
<measObjInstId>41 42 49 53 49 50 2E 52 58 4F 54 47 2D 35 31</measObjInstId>
<measResults>
<iValue>63576</iValue>
<iValue>60332</iValue>
<iValue>0</iValue>
<iValue>900</iValue>
<iValue>131844</iValue>
<iValue>0</iValue>
</measResults>
<suspectFlag><false/></suspectFlag>
</MeasValue>
There is many value but "measObjInstId" is in HEX, and i can't find "WORD".
So I use "unber" for find WORD but now I can't find the value.
If I understand you correctly, you'd like to know which field in the ASN.1 specification this WORD value corresponds to. You can infer this information, although not as quickly as you'd like.
The "unber" tool just decodes the BER-encoded binary byte stream. That BER stream must have been produced by the BER-compliant encoder, possibly with the help of some ASN.1 compiler and the corresponding ASN.1 module specification. The specification text (the "measObjInstId") is not retained in the BER-encoded binary byte stream. Unlike XML, the names which you see in the ASN.1 specifications do not get stored in BER files. Therefore, the "unber" tool cannot pinpoint the corresponding ASN.1 type by scanning the BER output. The "unber" tool has no knowledge of the ASN.1 specification involved in producing that BER file. It just outputs the raw BER structure that it sees in a little bit more readable way, and that structure does not contain the ASN.1 type names.
However, the BER structure contains the tag names that you can manually associate with the corresponding ASN.1 type.
Unfortunately, the version of MEAS specification that I have does not have the GraphicString type, so I suspect you either have a different version spec or that spec is possibly broken. It is almost certainly broken, since I see in my ASN.1 spec that measObjInstId is of type PrintableString, not of type GraphicString, and that spec would have ben outputted using human readable characters instead of hexadecimal bytes. The hexadecimal bytes in your <measObjInstId> means that asn1c thinks the string is not supposed to contain human readable values, and consequently does not print them as human readable values.
You can try to convert the values of <measObjInstId> back to string to see its contents:
> echo "41 42 49 53 49 50 2E 52 58 4F 54 47 2D 35 31" | xxd -r
BISIP.RXOTG-51
>
This is likely the string that you were looking for.
In order to make asn1c generate code which would print this as a human readable string, you'd have to trick it into thinking this is a PrintableString. Somewhat like this: instead of
measObjInstId GraphicString
you'd put
measObjInstId IMPLICIT PrintableString
into the spec. This way, the value will be printed as human readable one.