@@ -152,7 +152,7 @@ class UDS_DSCPR(Packet):
152
152
153
153
def answers (self , other ):
154
154
return isinstance (other , UDS_DSC ) and \
155
- other .diagnosticSessionType == self .diagnosticSessionType
155
+ other .diagnosticSessionType == self .diagnosticSessionType
156
156
157
157
158
158
bind_layers (UDS , UDS_DSCPR , service = 0x50 )
@@ -218,7 +218,7 @@ class UDS_SAPR(Packet):
218
218
219
219
def answers (self , other ):
220
220
return isinstance (other , UDS_SA ) \
221
- and other .securityAccessType == self .securityAccessType
221
+ and other .securityAccessType == self .securityAccessType
222
222
223
223
224
224
bind_layers (UDS , UDS_SAPR , service = 0x67 )
@@ -273,7 +273,7 @@ class UDS_CCPR(Packet):
273
273
274
274
def answers (self , other ):
275
275
return isinstance (other , UDS_CC ) \
276
- and other .controlType == self .controlType
276
+ and other .controlType == self .controlType
277
277
278
278
279
279
bind_layers (UDS , UDS_CCPR , service = 0x68 )
@@ -429,7 +429,7 @@ class UDS_AUTHPR(Packet):
429
429
430
430
def answers (self , other ):
431
431
return isinstance (other , UDS_AUTH ) \
432
- and other .subFunction == self .subFunction
432
+ and other .subFunction == self .subFunction
433
433
434
434
435
435
bind_layers (UDS , UDS_AUTHPR , service = 0x69 )
@@ -491,7 +491,8 @@ class UDS_ATPPR(Packet):
491
491
492
492
def answers (self , other ):
493
493
return isinstance (other , UDS_ATP ) \
494
- and other .timingParameterAccessType == self .timingParameterAccessType
494
+ and other .timingParameterAccessType == \
495
+ self .timingParameterAccessType
495
496
496
497
497
498
bind_layers (UDS , UDS_ATPPR , service = 0xC3 )
@@ -604,7 +605,7 @@ class UDS_ROEPR(Packet):
604
605
605
606
def answers (self , other ):
606
607
return isinstance (other , UDS_ROE ) \
607
- and other .eventType == self .eventType
608
+ and other .eventType == self .eventType
608
609
609
610
610
611
bind_layers (UDS , UDS_ROEPR , service = 0xC6 )
@@ -643,7 +644,7 @@ class UDS_LCPR(Packet):
643
644
644
645
def answers (self , other ):
645
646
return isinstance (other , UDS_LC ) \
646
- and other .linkControlType == self .linkControlType
647
+ and other .linkControlType == self .linkControlType
647
648
648
649
649
650
bind_layers (UDS , UDS_LCPR , service = 0xC7 )
@@ -672,7 +673,7 @@ class UDS_RDBIPR(Packet):
672
673
673
674
def answers (self , other ):
674
675
return isinstance (other , UDS_RDBI ) \
675
- and self .dataIdentifier in other .identifiers
676
+ and self .dataIdentifier in other .identifiers
676
677
677
678
678
679
bind_layers (UDS , UDS_RDBIPR , service = 0x62 )
@@ -742,7 +743,7 @@ class UDS_RSDBIPR(Packet):
742
743
743
744
def answers (self , other ):
744
745
return isinstance (other , UDS_RSDBI ) \
745
- and other .dataIdentifier == self .dataIdentifier
746
+ and other .dataIdentifier == self .dataIdentifier
746
747
747
748
748
749
bind_layers (UDS , UDS_RSDBIPR , service = 0x64 )
@@ -779,7 +780,7 @@ class UDS_RDBPIPR(Packet):
779
780
780
781
def answers (self , other ):
781
782
return isinstance (other , UDS_RDBPI ) \
782
- and other .periodicDataIdentifier == self .periodicDataIdentifier
783
+ and other .periodicDataIdentifier == self .periodicDataIdentifier
783
784
784
785
785
786
bind_layers (UDS , UDS_RDBPIPR , service = 0x6A )
@@ -811,7 +812,7 @@ class UDS_DDDIPR(Packet):
811
812
812
813
def answers (self , other ):
813
814
return isinstance (other , UDS_DDDI ) \
814
- and other .subFunction == self .subFunction
815
+ and other .subFunction == self .subFunction
815
816
816
817
817
818
bind_layers (UDS , UDS_DDDIPR , service = 0x6C )
@@ -838,7 +839,7 @@ class UDS_WDBIPR(Packet):
838
839
839
840
def answers (self , other ):
840
841
return isinstance (other , UDS_WDBI ) \
841
- and other .dataIdentifier == self .dataIdentifier
842
+ and other .dataIdentifier == self .dataIdentifier
842
843
843
844
844
845
bind_layers (UDS , UDS_WDBIPR , service = 0x6E )
@@ -899,8 +900,8 @@ class UDS_WMBAPR(Packet):
899
900
900
901
def answers (self , other ):
901
902
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
904
905
905
906
906
907
bind_layers (UDS , UDS_WMBAPR , service = 0x7D )
@@ -1012,10 +1013,8 @@ class UDS_RDTCI(Packet):
1012
1013
class DTC (Packet ):
1013
1014
name = 'DTC and status record'
1014
1015
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" }),
1019
1018
BitField ("numeric_value_code" , 0 , 12 ),
1020
1019
ByteField ("additional_information_code" , 0 ),
1021
1020
FlagsField ("status" , 0 , 8 , UDS_RDTCI .dtcStatus )
@@ -1029,8 +1028,7 @@ class UDS_RDTCIPR(Packet):
1029
1028
name = 'ReadDTCInformationPositiveResponse'
1030
1029
fields_desc = [
1031
1030
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 ),
1034
1032
lambda pkt : pkt .reportType in [0x01 , 0x07 , 0x11 ,
1035
1033
0x12 , 0x02 , 0x0A ,
1036
1034
0x0B , 0x0C , 0x0D ,
@@ -1058,7 +1056,7 @@ class UDS_RDTCIPR(Packet):
1058
1056
1059
1057
def answers (self , other ):
1060
1058
return isinstance (other , UDS_RDTCI ) \
1061
- and other .reportType == self .reportType
1059
+ and other .reportType == self .reportType
1062
1060
1063
1061
1064
1062
bind_layers (UDS , UDS_RDTCIPR , service = 0x59 )
@@ -1093,8 +1091,8 @@ class UDS_RCPR(Packet):
1093
1091
1094
1092
def answers (self , other ):
1095
1093
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
1098
1096
1099
1097
1100
1098
bind_layers (UDS , UDS_RCPR , service = 0x71 )
@@ -1213,7 +1211,7 @@ class UDS_TDPR(Packet):
1213
1211
1214
1212
def answers (self , other ):
1215
1213
return isinstance (other , UDS_TD ) \
1216
- and other .blockSequenceCounter == self .blockSequenceCounter
1214
+ and other .blockSequenceCounter == self .blockSequenceCounter
1217
1215
1218
1216
1219
1217
bind_layers (UDS , UDS_TDPR , service = 0x76 )
@@ -1353,7 +1351,7 @@ class UDS_IOCBIPR(Packet):
1353
1351
1354
1352
def answers (self , other ):
1355
1353
return isinstance (other , UDS_IOCBI ) \
1356
- and other .dataIdentifier == self .dataIdentifier
1354
+ and other .dataIdentifier == self .dataIdentifier
1357
1355
1358
1356
1359
1357
bind_layers (UDS , UDS_IOCBIPR , service = 0x6F )
@@ -1418,8 +1416,8 @@ class UDS_NR(Packet):
1418
1416
1419
1417
def answers (self , other ):
1420
1418
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' ])
1423
1421
1424
1422
1425
1423
bind_layers (UDS , UDS_NR , service = 0x7f )
0 commit comments