I'm working with IEC61850 standard. And at first time I faced OSI Selectors: Transport selector, Session selector and Presentation selector. I'm not interested in their physical meaning. The task is to convert their values from parsing file (from std::string) into uint8_t. I don't understand how are these values presented?
The values from file(xml schema):
<P type="OSI-PSEL">00000001</P>
<P type="OSI-SSEL">0001</P>
<P type="OSI-TSEL">0001</P>
or it can be
<P type="OSI-TSEL">00000001</P>
<P type="OSI-PSEL">01</P>
<P type="OSI-SSEL">01</P>
in xsd I got this infromation about them:
<xs:complexType name="tP_OSI-TSEL">
<xs:restriction base="tP">
<xs:maxLength value="8"/>
<xs:pattern value="[0-9,A-F]+"/>
</xs:restriction>
</xs:complexType>
<xs:complexType name="tP_OSI-SSEL">
<xs:restriction base="tP">
<xs:maxLength value="16"/>
<xs:pattern value="[0-9,A-F]+"/>
</xs:restriction>
</xs:complexType>
<xs:complexType name="tP_OSI-PSEL">
<xs:restriction base="tP">
<xs:maxLength value="16"/>
<xs:pattern value="[0-9,A-F]+"/>
</xs:restriction>
</xs:complexType>
Are 01 or 00001 or 00000001 etc represented in binary number system? Why do they have different length? I mean if 00000001 is an octet, what is 00001 and 01 then?