uds.message.service_identifiers

Service Identifier (SID) data parameter implementation.

Note

Service Identifiers values and their meanings are defined by ISO 14229-1 and SAE J1979 standards.

Attributes

RESPONSE_REQUEST_SID_DIFF

Difference between request and response SID values (SID = RSID + 0x40).

ALL_REQUEST_SIDS

Set with all possible values of Request SID data parameter according to SAE J1979 and ISO 14229 standards.

ALL_RESPONSE_SIDS

Set with all possible values of Response SID data parameter according to SAE J1979 and ISO 14229 standards.

SERVICES_WITH_SUBFUNCTION

SID and RSID values for services that contain sub-function in their message format.

Exceptions

UnrecognizedSIDWarning

Warning about SID value that is legit but not recognized by the package.

Classes

RequestSID

Request Service Identifier values.

ResponseSID

Response Service Identifier values.

Functions

define_service(sid, name)

Define SID and RSID values for a non-standard service.

Module Contents

uds.message.service_identifiers.RESPONSE_REQUEST_SID_DIFF: int = 64

Difference between request and response SID values (SID = RSID + 0x40).

uds.message.service_identifiers.ALL_REQUEST_SIDS: uds.utilities.RawBytesSetAlias

Set with all possible values of Request SID data parameter according to SAE J1979 and ISO 14229 standards.

uds.message.service_identifiers.ALL_RESPONSE_SIDS: uds.utilities.RawBytesSetAlias

Set with all possible values of Response SID data parameter according to SAE J1979 and ISO 14229 standards.

exception uds.message.service_identifiers.UnrecognizedSIDWarning[source]

Bases: Warning

Inheritance diagram of uds.message.service_identifiers.UnrecognizedSIDWarning

Warning about SID value that is legit but not recognized by the package.

Note

If you want to register a SID value, you need to define members (for this SID) manually using add_member() method (on RequestSID and ResponseSID classes).

You can also create feature request in the UDS project issues management system to register a SID value (for which this warning was raised).

Initialize self. See help(type(self)) for accurate signature.

class uds.message.service_identifiers.RequestSID[source]

Bases: uds.utilities.ValidatedEnum, uds.utilities.ExtendableEnum, uds.utilities.ByteEnum

Inheritance diagram of uds.message.service_identifiers.RequestSID

Request Service Identifier values.

Note

Request SID is always the first payload byte of all request message.

Initialize self. See help(type(self)) for accurate signature.

classmethod is_request_sid(value)[source]

Check whether given value is Service Identifier (SID).

Parameters:

value (int) – Value to check.

Returns:

True if value is valid SID, else False.

Return type:

bool

AccessTimingParameter: RequestSID = 131
DiagnosticSessionControl: RequestSID = 16
ECUReset: RequestSID = 17
SecurityAccess: RequestSID = 39
CommunicationControl: RequestSID = 40
Authentication: RequestSID = 41
TesterPresent: RequestSID = 62
ControlDTCSetting: RequestSID = 133
ResponseOnEvent: RequestSID = 134
LinkControl: RequestSID = 135
ReadDataByIdentifier: RequestSID = 34
ReadMemoryByAddress: RequestSID = 35
ReadScalingDataByIdentifier: RequestSID = 36
ReadDataByPeriodicIdentifier: RequestSID = 42
DynamicallyDefineDataIdentifier: RequestSID = 44
WriteDataByIdentifier: RequestSID = 46
WriteMemoryByAddress: RequestSID = 61
ClearDiagnosticInformation: RequestSID = 20
ReadDTCInformation: RequestSID = 25
InputOutputControlByIdentifier: RequestSID = 47
RoutineControl: RequestSID = 49
RequestDownload: RequestSID = 52
RequestUpload: RequestSID = 53
TransferData: RequestSID = 54
RequestTransferExit: RequestSID = 55
RequestFileTransfer: RequestSID = 56
SecuredDataTransmission: RequestSID = 132
class uds.message.service_identifiers.ResponseSID[source]

Bases: uds.utilities.ValidatedEnum, uds.utilities.ExtendableEnum, uds.utilities.ByteEnum

Inheritance diagram of uds.message.service_identifiers.ResponseSID

Response Service Identifier values.

Note

Response SID is always the first payload byte of all request message.

Warning

This enum contains multiple members (for all the services as RequestSID), but most of them are dynamically (implicitly) added and invisible in the documentation.

Initialize self. See help(type(self)) for accurate signature.

NegativeResponse: ResponseSID = 127
AccessTimingParameter: ResponseSID
DiagnosticSessionControl: ResponseSID
ECUReset: ResponseSID
SecurityAccess: ResponseSID
CommunicationControl: ResponseSID
Authentication: ResponseSID
TesterPresent: ResponseSID
ControlDTCSetting: ResponseSID
ResponseOnEvent: ResponseSID
LinkControl: ResponseSID
ReadDataByIdentifier: ResponseSID
ReadMemoryByAddress: ResponseSID
ReadScalingDataByIdentifier: ResponseSID
ReadDataByPeriodicIdentifier: ResponseSID
DynamicallyDefineDataIdentifier: ResponseSID
WriteDataByIdentifier: ResponseSID
WriteMemoryByAddress: ResponseSID
ClearDiagnosticInformation: ResponseSID
ReadDTCInformation: ResponseSID
InputOutputControlByIdentifier: ResponseSID
RoutineControl: ResponseSID
RequestDownload: ResponseSID
RequestUpload: ResponseSID
TransferData: ResponseSID
RequestTransferExit: ResponseSID
RequestFileTransfer: ResponseSID
SecuredDataTransmission: ResponseSID
classmethod is_response_sid(value)[source]

Check whether given value is Response Service Identifier (RSID).

Parameters:

value (int) – Value to check.

Returns:

True if value is valid RSID, else False.

Return type:

bool

uds.message.service_identifiers.SERVICES_WITH_SUBFUNCTION

SID and RSID values for services that contain sub-function in their message format.

uds.message.service_identifiers.define_service(sid, name)[source]

Define SID and RSID values for a non-standard service.

Parameters:
  • sid (int) – Service Identifier value.

  • name (str) – Name of the Service.

Raises:
Returns:

Defined RequestSID and ResponseSID members.

Return type:

Tuple[RequestSID, ResponseSID]