Command: CMD_GET_ENCODING_INFO
Destination: SD_LIN
Destination Channel: 0
Description
Clients use this command to retrieve detailed information about a signal encoding defined in the LDF (LIN Description File) that has been parsed.
Command Data Format
Signal Encoding Name padding variable 0-3 bytes
Signal Encoding Name
The name of the signal encoding for which information will be returned. The name is a null terminated string.
Response Data Format
Encodings Encoding Data . . . padding 2 bytes variable . . . 0-3 bytes
Encodings
The number of blocks of Encoding Data to follow. Each block of Encoding Data specifies how a raw value or range of raw values is to be converted for the signal. The contents of each Encoding Data block depends on the type of encoding specified. There is at least one Encoding Data block. It is possible to have a mixture of logical and physical encodings for a signal. The valid range could be represented by one or more physical encodings and invalid value(s) could be represented by one or more logical encodings.
Encoding Data Type Value P1 P2 P3 P4 "logical" (2 bytes) (variable) "physical" (2 bytes) (2 bytes) (variable) (variable) (variable) "bcd" (2 bytes) "ascii" (2 bytes)
Type
This field is 12 bytes long and contains the null padded type of conversion. Possible values are: logical, physical, bcd and ascii.
Value
This field is 2 bytes long and is the first or only raw value of the encoding. For a logical encoding this value represents the string P1. For a physical encoding this is two bytes long and is the minimum raw value for the conversion.
P1
For a logical encoding this is the string to be used for the value present in the preceding Value field. It is a null terminated string of variable length.For a physical encoding this is two bytes long and is the maximum raw value for the conversion.
P2
This field holds the scale value for converting physical values. This is null terminated string. If the scale value is 3.14, the string would be five bytes long, including the terminating null character.
P3
This field holds the offset value for converting physical values. This is a null terminated string. If the offset value is 10.237, the string would be six bytes long, including the terminating null character.
P4
This field contains the text info (units or description) for the physical encoded values. This is a null terminated string.
note:
The physical conversion formula is:
physical_value = scale * raw_value + offset.
Response Return Codes
RESP_OK Execution of the command was successful. RESP_INVAL_PARAM No LDF (LIN Description File) has been parsed or the signal is not defined in the LDF. RESP_UNSUPPORTED This command is not supported on the specified channel. RESP_UNREG The specified source channel is not registered with the server. RESP_UNKNOWN_ERR An unknown error occurred.