-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
43 lines (33 loc) · 1011 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#coding:utf-8
import sys
import os
from time import sleep
sys.path.append(r'C:\Drive-W\Internal_tools\Libraries\D2DProjectLibrary\trunk\out')
sys.path.append(r'C:\Drive-W\Internal_tools\Libraries\CANOBDIILibrary\trunk\out')
from D2DWrapper import D2DWrapper
from CANInterface import CANInterface
def test_can():
canDev = CANInterface()
canDev.Connected()
baudRate = canDev.Get_BaudRate()
print(baudRate[0])
print(baudRate[1])
canDev.Set_BaudRate(100000, 100000)
baudRate = canDev.Get_BaudRate()
print(baudRate[0])
print(baudRate[1])
canDev.Set_BaudRate(500000, 500000)
canDev.CAN_Disconnected()
def test_d2d():
d2d_conn = D2DWrapper("COM2")
sleep(2)
d2d_conn.Send_D2D_Function('unlock door rem1 on')
sleep(5)
extStatus = d2d_conn.D2D_Extended_Status('0', True)
print(extStatus)
d2d_conn.Send_Raw_Data('91')
sleep(5)
d2d_conn.Send_D2D_Function('unlock door rem1 on')
d2d_conn.D2D_Disconnected()
#test_can()
test_d2d()