diff --git a/canTest.py b/canTest.py index 025e1d8..68845c3 100644 --- a/canTest.py +++ b/canTest.py @@ -45,6 +45,7 @@ def waitForUserInput(waitForUserInput): def CanTest(bustype="socketcan", channel="can0"): # -----------------------------------------------------------------------------------------------------# + print("====================") print("Start testing the can bus connectivity ") global waitForUserInput if waitForUserInput(waitForUserInput) != 0: @@ -69,9 +70,14 @@ def CanTest(bustype="socketcan", channel="can0"): count = count + 1 print(recivedMessage) - print("Sending a single message test with answer result {}".format(result)) + print( + "Sending a single message test with result {}".format( + "PASSED" if result else "FAILED" + ) + ) # -----------------------------------------------------------------------------------------------------# + print("====================") print("testing for multiple sends") if waitForUserInput(waitForUserInput) != 0: return @@ -88,8 +94,8 @@ def CanTest(bustype="socketcan", channel="can0"): print(packet.data) print( - "Sending multiple testmessages test with answer result {}".format( - len(packete) == len(range(trials)) + "Sending multiple testmessages test with result {}".format( + "PASSED" if len(packete) == len(range(trials)) else "FAILED" ) ) diff --git a/eProm.py b/eProm.py index 034f25b..bc87d68 100644 --- a/eProm.py +++ b/eProm.py @@ -2,11 +2,13 @@ import canTest def ePromTest(): + print("====================") print("start eprom test") message = [4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] canTest.waitForUserInput(True) canTest.sendMessageOnCan(message) answer = canTest.recive() - print("ePromTest reult {}".format(str(answer.data) == "bytearray(b'iiiiBiii')")) + result = answer.data == bytearray(b"iiiBiiii") + print("ePromTest result {}".format("PASSED" if result else "FAILED")) print("I am done with this shit") diff --git a/realTest.py b/realTest.py index 3806d56..69fc5fd 100644 --- a/realTest.py +++ b/realTest.py @@ -6,17 +6,18 @@ import eProm def startBalancingTest(): message = [5, 0xC, 0, 0xF, 0xF, 0xE, 0xE] + print("====================") print("startBalancing") canTest.waitForUserInput(True) canTest.sendMessageOnCan(message) -# canTest.CanTest() -# eProm.ePromTest() -# voltageTest.voltagesTest() +canTest.CanTest() +eProm.ePromTest() +voltageTest.voltagesTest() tempTest.tempTest() -# startBalancingTest() +startBalancingTest() """ print("start Temp test") message = [3, 0xc, 0, 0xf, 0xf, 0xe, 0xe] diff --git a/tempTest.py b/tempTest.py index 2f57ae9..22a1442 100644 --- a/tempTest.py +++ b/tempTest.py @@ -44,6 +44,7 @@ def verifyNumbers(numberListList): def tempTest(): + print("====================") print("starting temperature test ") canTest.waitForUserInput(True) Temps = getTempOverCan() @@ -51,13 +52,13 @@ def tempTest(): changed = [] for temp in Temps: - allTemp.append(struct.unpack("> 4) * 0.0625)) + print("Interpreted temperatures:") print(changed) print("I am done with this shit") diff --git a/voltageTest.py b/voltageTest.py index e77dca6..2e096a6 100644 --- a/voltageTest.py +++ b/voltageTest.py @@ -50,6 +50,7 @@ def verifyNumbers(numberListList): def voltagesTest(): + print("====================") print("starting voltage test pls but 3.500 as reference value") canTest.waitForUserInput(True) voltages = getBatteryVoltageOverCan() # rausfinden welche id der Slave hat