Skip to content

Commit 6abd826

Browse files
committed
revert changes
1 parent 5866d59 commit 6abd826

File tree

1 file changed

+25
-27
lines changed
  • scapy/contrib/automotive

1 file changed

+25
-27
lines changed

scapy/contrib/automotive/uds.py

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class UDS_DSCPR(Packet):
152152

153153
def answers(self, other):
154154
return isinstance(other, UDS_DSC) and \
155-
other.diagnosticSessionType == self.diagnosticSessionType
155+
other.diagnosticSessionType == self.diagnosticSessionType
156156

157157

158158
bind_layers(UDS, UDS_DSCPR, service=0x50)
@@ -218,7 +218,7 @@ class UDS_SAPR(Packet):
218218

219219
def answers(self, other):
220220
return isinstance(other, UDS_SA) \
221-
and other.securityAccessType == self.securityAccessType
221+
and other.securityAccessType == self.securityAccessType
222222

223223

224224
bind_layers(UDS, UDS_SAPR, service=0x67)
@@ -273,7 +273,7 @@ class UDS_CCPR(Packet):
273273

274274
def answers(self, other):
275275
return isinstance(other, UDS_CC) \
276-
and other.controlType == self.controlType
276+
and other.controlType == self.controlType
277277

278278

279279
bind_layers(UDS, UDS_CCPR, service=0x68)
@@ -429,7 +429,7 @@ class UDS_AUTHPR(Packet):
429429

430430
def answers(self, other):
431431
return isinstance(other, UDS_AUTH) \
432-
and other.subFunction == self.subFunction
432+
and other.subFunction == self.subFunction
433433

434434

435435
bind_layers(UDS, UDS_AUTHPR, service=0x69)
@@ -491,7 +491,8 @@ class UDS_ATPPR(Packet):
491491

492492
def answers(self, other):
493493
return isinstance(other, UDS_ATP) \
494-
and other.timingParameterAccessType == self.timingParameterAccessType
494+
and other.timingParameterAccessType == \
495+
self.timingParameterAccessType
495496

496497

497498
bind_layers(UDS, UDS_ATPPR, service=0xC3)
@@ -604,7 +605,7 @@ class UDS_ROEPR(Packet):
604605

605606
def answers(self, other):
606607
return isinstance(other, UDS_ROE) \
607-
and other.eventType == self.eventType
608+
and other.eventType == self.eventType
608609

609610

610611
bind_layers(UDS, UDS_ROEPR, service=0xC6)
@@ -643,7 +644,7 @@ class UDS_LCPR(Packet):
643644

644645
def answers(self, other):
645646
return isinstance(other, UDS_LC) \
646-
and other.linkControlType == self.linkControlType
647+
and other.linkControlType == self.linkControlType
647648

648649

649650
bind_layers(UDS, UDS_LCPR, service=0xC7)
@@ -672,7 +673,7 @@ class UDS_RDBIPR(Packet):
672673

673674
def answers(self, other):
674675
return isinstance(other, UDS_RDBI) \
675-
and self.dataIdentifier in other.identifiers
676+
and self.dataIdentifier in other.identifiers
676677

677678

678679
bind_layers(UDS, UDS_RDBIPR, service=0x62)
@@ -742,7 +743,7 @@ class UDS_RSDBIPR(Packet):
742743

743744
def answers(self, other):
744745
return isinstance(other, UDS_RSDBI) \
745-
and other.dataIdentifier == self.dataIdentifier
746+
and other.dataIdentifier == self.dataIdentifier
746747

747748

748749
bind_layers(UDS, UDS_RSDBIPR, service=0x64)
@@ -779,7 +780,7 @@ class UDS_RDBPIPR(Packet):
779780

780781
def answers(self, other):
781782
return isinstance(other, UDS_RDBPI) \
782-
and other.periodicDataIdentifier == self.periodicDataIdentifier
783+
and other.periodicDataIdentifier == self.periodicDataIdentifier
783784

784785

785786
bind_layers(UDS, UDS_RDBPIPR, service=0x6A)
@@ -811,7 +812,7 @@ class UDS_DDDIPR(Packet):
811812

812813
def answers(self, other):
813814
return isinstance(other, UDS_DDDI) \
814-
and other.subFunction == self.subFunction
815+
and other.subFunction == self.subFunction
815816

816817

817818
bind_layers(UDS, UDS_DDDIPR, service=0x6C)
@@ -838,7 +839,7 @@ class UDS_WDBIPR(Packet):
838839

839840
def answers(self, other):
840841
return isinstance(other, UDS_WDBI) \
841-
and other.dataIdentifier == self.dataIdentifier
842+
and other.dataIdentifier == self.dataIdentifier
842843

843844

844845
bind_layers(UDS, UDS_WDBIPR, service=0x6E)
@@ -899,8 +900,8 @@ class UDS_WMBAPR(Packet):
899900

900901
def answers(self, other):
901902
return isinstance(other, UDS_WMBA) \
902-
and other.memorySizeLen == self.memorySizeLen \
903-
and other.memoryAddressLen == self.memoryAddressLen
903+
and other.memorySizeLen == self.memorySizeLen \
904+
and other.memoryAddressLen == self.memoryAddressLen
904905

905906

906907
bind_layers(UDS, UDS_WMBAPR, service=0x7D)
@@ -1012,10 +1013,8 @@ class UDS_RDTCI(Packet):
10121013
class DTC(Packet):
10131014
name = 'DTC and status record'
10141015
fields_desc = [
1015-
BitEnumField("system", 0, 2, {
1016-
0: "Powertrain", 1: "Chassis", 2: "Body", 3: "Network"}),
1017-
BitEnumField("type", 0, 2, {
1018-
0: "Generic", 1: "ManufacturerSpecific", 2: "Generic", 3: "Generic"}),
1016+
BitEnumField("system", 0, 2, {0: "Powertrain", 1: "Chassis", 2: "Body", 3: "Network"}),
1017+
BitEnumField("type", 0, 2, {0: "Generic", 1: "ManufacturerSpecific", 2: "Generic", 3: "Generic"}),
10191018
BitField("numeric_value_code", 0, 12),
10201019
ByteField("additional_information_code", 0),
10211020
FlagsField("status", 0, 8, UDS_RDTCI.dtcStatus)
@@ -1029,8 +1028,7 @@ class UDS_RDTCIPR(Packet):
10291028
name = 'ReadDTCInformationPositiveResponse'
10301029
fields_desc = [
10311030
ByteEnumField('reportType', 0, UDS_RDTCI.reportTypes),
1032-
ConditionalField(FlagsField('DTCStatusAvailabilityMask', 0, 8,
1033-
UDS_RDTCI.dtcStatus),
1031+
ConditionalField(FlagsField('DTCStatusAvailabilityMask', 0, 8, UDS_RDTCI.dtcStatus),
10341032
lambda pkt: pkt.reportType in [0x01, 0x07, 0x11,
10351033
0x12, 0x02, 0x0A,
10361034
0x0B, 0x0C, 0x0D,
@@ -1058,7 +1056,7 @@ class UDS_RDTCIPR(Packet):
10581056

10591057
def answers(self, other):
10601058
return isinstance(other, UDS_RDTCI) \
1061-
and other.reportType == self.reportType
1059+
and other.reportType == self.reportType
10621060

10631061

10641062
bind_layers(UDS, UDS_RDTCIPR, service=0x59)
@@ -1093,8 +1091,8 @@ class UDS_RCPR(Packet):
10931091

10941092
def answers(self, other):
10951093
return isinstance(other, UDS_RC) \
1096-
and other.routineControlType == self.routineControlType \
1097-
and other.routineIdentifier == self.routineIdentifier
1094+
and other.routineControlType == self.routineControlType \
1095+
and other.routineIdentifier == self.routineIdentifier
10981096

10991097

11001098
bind_layers(UDS, UDS_RCPR, service=0x71)
@@ -1213,7 +1211,7 @@ class UDS_TDPR(Packet):
12131211

12141212
def answers(self, other):
12151213
return isinstance(other, UDS_TD) \
1216-
and other.blockSequenceCounter == self.blockSequenceCounter
1214+
and other.blockSequenceCounter == self.blockSequenceCounter
12171215

12181216

12191217
bind_layers(UDS, UDS_TDPR, service=0x76)
@@ -1353,7 +1351,7 @@ class UDS_IOCBIPR(Packet):
13531351

13541352
def answers(self, other):
13551353
return isinstance(other, UDS_IOCBI) \
1356-
and other.dataIdentifier == self.dataIdentifier
1354+
and other.dataIdentifier == self.dataIdentifier
13571355

13581356

13591357
bind_layers(UDS, UDS_IOCBIPR, service=0x6F)
@@ -1418,8 +1416,8 @@ class UDS_NR(Packet):
14181416

14191417
def answers(self, other):
14201418
return self.requestServiceId == other.service and \
1421-
(self.negativeResponseCode != 0x78 or
1422-
conf.contribs['UDS']['treat-response-pending-as-answer'])
1419+
(self.negativeResponseCode != 0x78 or
1420+
conf.contribs['UDS']['treat-response-pending-as-answer'])
14231421

14241422

14251423
bind_layers(UDS, UDS_NR, service=0x7f)

0 commit comments

Comments
 (0)