Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
75f083c
fix platform independent path
PlumIsNoGeek Sep 18, 2020
d60fc5d
add canfd support for physical interfaces
PlumIsNoGeek Sep 18, 2020
3928ab8
increment version to 1.2.0
PlumIsNoGeek Sep 18, 2020
5f4e469
Merge pull request #1 from fgeyer/can-fd-support
fgeyer Sep 18, 2020
f3ec856
fix app_name parameter for CanConnectionFactory
PlumIsNoGeek Oct 22, 2020
f037181
add cast
PlumIsNoGeek Dec 4, 2020
b586c33
add connection shutdown to free can channel
PlumIsNoGeek Dec 5, 2020
6176bca
- Parse Data from ODX file of type Integer into an array of bytes bas…
fbekhechi Dec 11, 2020
ee69269
readd sleep which is better for performance
PlumIsNoGeek Dec 24, 2020
96066aa
- Shutdown CAN connection only if not created externally.
fbekhechi Jan 4, 2021
05e580f
Merge branch 'master' of https://github.com/fgeyer/python-uds
fbekhechi Jan 4, 2021
ecc4b24
add vector serial auto detection
PlumIsNoGeek Jan 19, 2021
9a06e17
fix key check
PlumIsNoGeek Jan 19, 2021
c7a4c5f
fix deprecation warning
PlumIsNoGeek Feb 12, 2021
6e6a5d8
- Fix min payload single frame bug.
fbekhechi Feb 16, 2021
47ea211
- Add property to change reqId and resId
fbekhechi Feb 18, 2021
9056fbd
add vector serial auto detection
Feb 26, 2021
bb94f3d
Update version
fgeyer Mar 10, 2021
e726851
- reset CanConnectionFactory at can disconnect
fbekhechi Apr 9, 2021
39b00d2
Refactored CanTp.py and UdsConfigTool.py for usage of uds auxiliary
mol4rt May 17, 2021
79e5f65
Refactored CanTp.py and UdsConfigTool.py for usage of uds auxiliary
mol4rt May 18, 2021
a4b1952
Merge pull request #2 from fgeyer/TMSEA3-1232-itf-refactor-can-uds
fgeyer May 18, 2021
ee838a4
Revert "Refactored CanTp.py and UdsConfigTool.py for usage of uds aux…
fgeyer May 20, 2021
1aeab45
Merge pull request #3 from fgeyer/revert-2-TMSEA3-1232-itf-refactor-c…
fgeyer May 20, 2021
e848581
prepare 1.2.2
Jun 20, 2021
e68346c
Tmsea3 1232 itf refactor can uds (#5)
fgeyer Jun 21, 2021
8e2ef50
fix typo
Jun 21, 2021
8f76e0b
fix return types
Jun 21, 2021
9717990
readd lost lines
Jun 21, 2021
e9b4196
fix isotp
Jun 21, 2021
5f17bb4
fix wait
Jun 21, 2021
596abab
fix thread overload while waiting for uds response
Jun 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include uds\uds_configuration\defaultConfig.ini
include uds\uds_communications\Uds\config.ini
include uds\uds_communications\TransportProtocols\config.ini
include uds\uds_communications\TransportProtocols\Can\config.ini
include uds\uds_communications\TransportProtocols\Lin\config.ini
include uds/uds_configuration/defaultConfig.ini
include uds/uds_communications/Uds/config.ini
include uds/uds_communications/TransportProtocols/config.ini
include uds/uds_communications/TransportProtocols/Can/config.ini
include uds/uds_communications/TransportProtocols/Lin/config.ini
Comment on lines +1 to +5
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you change this manually? Or was it automatic?

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Needed for dependencies
install_requires=['python-can>=3.0.0', 'python-lin>=0.1.0'],
# *strongly* suggested for sharing
version='1.1.0',
version='1.2.3',
# The license can be anything you like
license='MIT',
description='A library for interfacing with UDS using python',
Expand Down
12 changes: 6 additions & 6 deletions test/Uds-Config-Tool/Unit Tests/unittest_ClearDTCFunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_ecuResetNegResponse_0x13(self,
tp_recv):

tp_send.return_value = False
tp_recv.return_value = [0x7F, 0x13]
tp_recv.return_value = [0x7F, 0x14, 0x13]

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/EBC-Diagnostics_old.odx', 'bootloader', transportProtocol="TEST")
Expand All @@ -60,7 +60,7 @@ def test_ecuResetNegResponse_0x13(self,
except:
b = traceback.format_exc().split("\n")[-2:-1][0] # ... extract the exception text
tp_send.assert_called_with([0x14, 0xF1, 0xC8, 0x55],False)
self.assertEqual("Exception: Detected negative response: ['0x7f', '0x13']", b)
self.assertEqual(0x13, b['NRC'])


# patches are inserted in reverse order
Expand All @@ -71,7 +71,7 @@ def test_ecuResetNegResponse_0x22(self,
tp_recv):

tp_send.return_value = False
tp_recv.return_value = [0x7F, 0x22]
tp_recv.return_value = [0x7F, 0x14, 0x22]

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/EBC-Diagnostics_old.odx', 'bootloader', transportProtocol="TEST")
Expand All @@ -82,7 +82,7 @@ def test_ecuResetNegResponse_0x22(self,
except:
b = traceback.format_exc().split("\n")[-2:-1][0] # ... extract the exception text
tp_send.assert_called_with([0x14, 0xF1, 0xC8, 0x55],False)
self.assertEqual("Exception: Detected negative response: ['0x7f', '0x22']", b)
self.assertEqual(0x22, b['NRC'])


# patches are inserted in reverse order
Expand All @@ -93,7 +93,7 @@ def test_ecuResetNegResponse_0x31(self,
tp_recv):

tp_send.return_value = False
tp_recv.return_value = [0x7F, 0x31]
tp_recv.return_value = [0x7F, 0x14, 0x31]

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/EBC-Diagnostics_old.odx', 'bootloader', transportProtocol="TEST")
Expand All @@ -104,7 +104,7 @@ def test_ecuResetNegResponse_0x31(self,
except:
b = traceback.format_exc().split("\n")[-2:-1][0] # ... extract the exception text
tp_send.assert_called_with([0x14, 0xF1, 0xC8, 0x55],False)
self.assertEqual("Exception: Detected negative response: ['0x7f', '0x31']", b)
self.assertEqual(0x31, b['NRC'])



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
class DiagnosticSessionControlTestCase(unittest.TestCase):

# patches are inserted in reverse order
@mock.patch('uds.CanTp.recv')
@mock.patch('uds.CanTp.send')
@mock.patch('uds.TestTp.recv')
@mock.patch('uds.TestTp.send')
def test_diagSessCtrlRequestDfltNoSuppress(self,
canTp_send,
canTp_recv):
Expand All @@ -30,7 +30,7 @@ def test_diagSessCtrlRequestDfltNoSuppress(self,
canTp_recv.return_value = [0x50, 0x01, 0x00, 0x05, 0x00, 0x0A] # ... can return 1 to N bytes in the sessionParameterRecord - looking into this one

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader')
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
# ... creates the uds object and returns it; also parses out the rdbi info and attaches the __diagnosticSessionControl to diagnosticSessionControl in the uds object, so can now call below

b = a.diagnosticSessionControl('Default Session') # ... calls __diagnosticSessionControl, which does the Uds.send
Expand All @@ -39,8 +39,8 @@ def test_diagSessCtrlRequestDfltNoSuppress(self,


# patches are inserted in reverse order
@mock.patch('uds.CanTp.recv')
@mock.patch('uds.CanTp.send')
@mock.patch('uds.TestTp.recv')
@mock.patch('uds.TestTp.send')
def test_diagSessCtrlRequestNoSuppress(self,
canTp_send,
canTp_recv):
Expand All @@ -49,7 +49,7 @@ def test_diagSessCtrlRequestNoSuppress(self,
canTp_recv.return_value = [0x50, 0x01, 0x00, 0x05, 0x00, 0x0A] # ... can return 1 to N bytes in the sessionParameterRecord - looking into this one

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader')
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
# ... creates the uds object and returns it; also parses out the rdbi info and attaches the __diagnosticSessionControl to diagnosticSessionControl in the uds object, so can now call below

b = a.diagnosticSessionControl('Default Session',suppressResponse=False) # ... calls __diagnosticSessionControl, which does the Uds.send
Expand All @@ -58,14 +58,14 @@ def test_diagSessCtrlRequestNoSuppress(self,


# patches are inserted in reverse order
@mock.patch('uds.CanTp.send')
@mock.patch('uds.TestTp.send')
def test_diagSessCtrlRequestSuppress(self,
canTp_send):

canTp_send.return_value = False

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader')
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
# ... creates the uds object and returns it; also parses out the rdbi info and attaches the __diagnosticSessionControl to diagnosticSessionControl in the uds object, so can now call below

b = a.diagnosticSessionControl('Default Session',suppressResponse=True) # ... calls __diagnosticSessionControl, which does the Uds.send
Expand All @@ -76,8 +76,8 @@ def test_diagSessCtrlRequestSuppress(self,


# patches are inserted in reverse order
@mock.patch('uds.CanTp.recv')
@mock.patch('uds.CanTp.send')
@mock.patch('uds.TestTp.recv')
@mock.patch('uds.TestTp.send')
def test_diagSessCtrlRequestProgrammingSession(self,
canTp_send,
canTp_recv):
Expand All @@ -86,7 +86,7 @@ def test_diagSessCtrlRequestProgrammingSession(self,
canTp_recv.return_value = [0x50, 0x02, 0x00, 0x06, 0x00, 0x09] # ... can return 1 to N bytes in the sessionParameterRecord - looking into this one

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader')
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
# ... creates the uds object and returns it; also parses out the rdbi info and attaches the __diagnosticSessionControl to diagnosticSessionControl in the uds object, so can now call below

b = a.diagnosticSessionControl('Programming Session') # ... calls __diagnosticSessionControl, which does the Uds.send
Expand All @@ -95,8 +95,8 @@ def test_diagSessCtrlRequestProgrammingSession(self,


# patches are inserted in reverse order
@mock.patch('uds.CanTp.recv')
@mock.patch('uds.CanTp.send')
@mock.patch('uds.TestTp.recv')
@mock.patch('uds.TestTp.send')
def test_diagSessCtrlRequestExtendedDiagnosticSession(self,
canTp_send,
canTp_recv):
Expand All @@ -105,7 +105,7 @@ def test_diagSessCtrlRequestExtendedDiagnosticSession(self,
canTp_recv.return_value = [0x50, 0x03, 0x00, 0x07, 0x00, 0x08] # ... can return 1 to N bytes in the sessionParameterRecord - looking into this one

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader')
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
# ... creates the uds object and returns it; also parses out the rdbi info and attaches the __diagnosticSessionControl to diagnosticSessionControl in the uds object, so can now call below

b = a.diagnosticSessionControl('Extended Diagnostic Session') # ... calls __diagnosticSessionControl, which does the Uds.send
Expand All @@ -115,69 +115,69 @@ def test_diagSessCtrlRequestExtendedDiagnosticSession(self,


# patches are inserted in reverse order
@mock.patch('uds.CanTp.recv')
@mock.patch('uds.CanTp.send')
@mock.patch('uds.TestTp.recv')
@mock.patch('uds.TestTp.send')
def test_diagSessCtrlNegResponse_0x12(self,
canTp_send,
canTp_recv):

canTp_send.return_value = False
canTp_recv.return_value = [0x7F, 0x12]
canTp_recv.return_value = [0x7F, 0x10, 0x12]

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader')
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
# ... creates the uds object and returns it; also parses out the rdbi info and attaches the __diagnosticSessionControl to diagnosticSessionControl in the uds object, so can now call below

try:
b = a.diagnosticSessionControl('Default Session',suppressResponse=False) # ... calls __diagnosticSessionControl, which does the Uds.send
except:
b = traceback.format_exc().split("\n")[-2:-1][0] # ... extract the exception text
canTp_send.assert_called_with([0x10, 0x01],False)
self.assertEqual("Exception: Detected negative response: ['0x7f', '0x12']", b) # ... diagnosticSessionControl should not return a value
self.assertEqual(0x12, b['NRC'])


# patches are inserted in reverse order
@mock.patch('uds.CanTp.recv')
@mock.patch('uds.CanTp.send')
@mock.patch('uds.TestTp.recv')
@mock.patch('uds.TestTp.send')
def test_diagSessCtrlNegResponse_0x13(self,
canTp_send,
canTp_recv):

canTp_send.return_value = False
canTp_recv.return_value = [0x7F, 0x13]
canTp_recv.return_value = [0x7F, 0x10, 0x13]

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader')
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
# ... creates the uds object and returns it; also parses out the rdbi info and attaches the __diagnosticSessionControl to diagnosticSessionControl in the uds object, so can now call below

try:
b = a.diagnosticSessionControl('Default Session',suppressResponse=False) # ... calls __diagnosticSessionControl, which does the Uds.send
except:
b = traceback.format_exc().split("\n")[-2:-1][0] # ... extract the exception text
canTp_send.assert_called_with([0x10, 0x01],False)
self.assertEqual("Exception: Detected negative response: ['0x7f', '0x13']", b) # ... diagnosticSessionControl should not return a value
self.assertEqual(0x13, b['NRC'])


# patches are inserted in reverse order
@mock.patch('uds.CanTp.recv')
@mock.patch('uds.CanTp.send')
@mock.patch('uds.TestTp.recv')
@mock.patch('uds.TestTp.send')
def test_diagSessCtrlNegResponse_0x22(self,
canTp_send,
canTp_recv):

canTp_send.return_value = False
canTp_recv.return_value = [0x7F, 0x22]
canTp_recv.return_value = [0x7F, 0x10, 0x22]

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader')
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
# ... creates the uds object and returns it; also parses out the rdbi info and attaches the __diagnosticSessionControl to diagnosticSessionControl in the uds object, so can now call below

try:
b = a.diagnosticSessionControl('Default Session',suppressResponse=False) # ... calls __diagnosticSessionControl, which does the Uds.send
except:
b = traceback.format_exc().split("\n")[-2:-1][0] # ... extract the exception text
canTp_send.assert_called_with([0x10, 0x01],False)
self.assertEqual("Exception: Detected negative response: ['0x7f', '0x22']", b) # ... diagnosticSessionControl should not return a value
self.assertEqual(0x22, b['NRC'])



Expand Down
12 changes: 6 additions & 6 deletions test/Uds-Config-Tool/Unit Tests/unittest_ECUResetFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_ecuResetNegResponse_0x12(self,
tp_recv):

tp_send.return_value = False
tp_recv.return_value = [0x7F, 0x12]
tp_recv.return_value = [0x7F, 0x11, 0x12]

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
Expand All @@ -95,7 +95,7 @@ def test_ecuResetNegResponse_0x12(self,
except:
b = traceback.format_exc().split("\n")[-2:-1][0] # ... extract the exception text
tp_send.assert_called_with([0x11, 0x01],False)
self.assertEqual("Exception: Detected negative response: ['0x7f', '0x12']", b) # ... wdbi should not return a value
self.assertEqual(0x12, b['NRC'])


# patches are inserted in reverse order
Expand All @@ -106,7 +106,7 @@ def test_ecuResetNegResponse_0x13(self,
tp_recv):

tp_send.return_value = False
tp_recv.return_value = [0x7F, 0x13]
tp_recv.return_value = [0x7F, 0x11, 0x13]

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
Expand All @@ -117,7 +117,7 @@ def test_ecuResetNegResponse_0x13(self,
except:
b = traceback.format_exc().split("\n")[-2:-1][0] # ... extract the exception text
tp_send.assert_called_with([0x11, 0x01],False)
self.assertEqual("Exception: Detected negative response: ['0x7f', '0x13']", b) # ... wdbi should not return a value
self.assertEqual(0x13, b['NRC'])


# patches are inserted in reverse order
Expand All @@ -128,7 +128,7 @@ def test_ecuResetNegResponse_0x22(self,
tp_recv):

tp_send.return_value = False
tp_recv.return_value = [0x7F, 0x22]
tp_recv.return_value = [0x7F, 0x11, 0x22]

# Parameters: xml file (odx file), ecu name (not currently used) ...
a = createUdsConnection('../Functional Tests/Bootloader.odx', 'bootloader', transportProtocol="TEST")
Expand All @@ -139,7 +139,7 @@ def test_ecuResetNegResponse_0x22(self,
except:
b = traceback.format_exc().split("\n")[-2:-1][0] # ... extract the exception text
tp_send.assert_called_with([0x11, 0x01],False)
self.assertEqual("Exception: Detected negative response: ['0x7f', '0x22']", b) # ... wdbi should not return a value
self.assertEqual(0x22, b['NRC'])



Expand Down
Loading