OTX Reference
|
|
Sequence of Bytes with arbitrary length. More...
Public Attributes | |
ByteFieldLiteral | init |
Cardinality [0..1] Initialisation of a ByteField declaration More... | |
Sequence of Bytes with arbitrary length.
An OTX ByteField is an arbitrary length sequence of bytes. Each byte is an unsigned eight bit value with a value space ranging from 0x00
to 0xFF
(0 to 255). The bytes in a ByteField of byte size n are ordered from left to right, where the leftmost byte have a byte index of 0 and the rightmost byte have a byte index of n-1. The bits in each byte of the ByteField are ordered from the least significant bit (LSB) to the most significant bit (MSB).
OTX ByteField values can be used to store raw data in memory representation which is used in the ECU. There is no assumption made for any interpretation of that raw data. A ByteField can therefore describe any kind of data, from simple integer data up to encoded text etc.
Conversion | Result | Sample |
---|---|---|
ToBoolean | Returns false if empty, otherwise true | Boolean b = ToBoolean(&0123); // Returns true
|
ToInteger | Returns the Integer value of the ByteField | Integer i = ToInteger(&7B); // Returns 123
|
ToFloat | Returns the Float value of the ByteField (interpretation according to [IEEE 754:2008]) | Float f = ToFloat(&405EDD2F1A9FBE77); // Returns 123.456
|
ToString | Returns the UTF-8 interpretation of the ByteField | String s = ToString(&313233); // Returns "123"
|
ToByteField | Returns the copy of the value | ByteField bf = ToByteField(&0123); // Returns &0123
|
&NULL
. ByteFieldLiteral OpenTestSystem.Otx.Core.DataTypes.ByteField.init |