Skip to content

Commit a74dfe3

Browse files
authored
Merge pull request #9 from Nakakiyo092/feature/update-cli
Add CLI with options
2 parents efd1456 + 648c36d commit a74dfe3

File tree

5 files changed

+258
-139
lines changed

5 files changed

+258
-139
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,81 @@ permissions:
1616
contents: read
1717

1818
jobs:
19+
Linux:
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
matrix:
23+
include:
24+
- { os: ubuntu-latest, python-version: "3.x" }
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install -r requirements.txt
39+
40+
- name: Verify CLI help
41+
run: |
42+
python3 ./reader/reader.py --help
43+
44+
macOS:
45+
runs-on: ${{ matrix.os }}
46+
strategy:
47+
matrix:
48+
include:
49+
- { os: macos-latest, python-version: "3.x" }
50+
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@v4
54+
55+
- name: Set up Python
56+
uses: actions/setup-python@v5
57+
with:
58+
python-version: ${{ matrix.python-version }}
59+
60+
- name: Install dependencies
61+
run: |
62+
python -m pip install --upgrade pip
63+
pip install -r requirements.txt
64+
65+
- name: Verify CLI help
66+
run: |
67+
python3 ./reader/reader.py --help
68+
69+
Windows:
70+
runs-on: ${{ matrix.os }}
71+
strategy:
72+
matrix:
73+
include:
74+
- { os: windows-latest, python-version: "3.x" }
75+
76+
steps:
77+
- name: Checkout repository
78+
uses: actions/checkout@v4
79+
80+
- name: Set up Python
81+
uses: actions/setup-python@v5
82+
with:
83+
python-version: ${{ matrix.python-version }}
84+
85+
- name: Install dependencies
86+
run: |
87+
python -m pip install --upgrade pip
88+
pip install -r requirements.txt
89+
90+
- name: Verify CLI help
91+
run: |
92+
python .\reader\reader.py --help
93+
1994
Test:
2095
runs-on: ${{ matrix.os }}
2196
strategy:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
venv/*
21
result/*
2+
.venv/*
33
.vscode/*

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ According to the standard, EDR is defined as:
1212
- See requirements.txt
1313

1414
## Usage
15-
By default, the script uses the slcan device `COM9` as a CAN interface.
15+
By default, the script uses the slcan device as a CAN interface.
1616
You can use any [python-can](https://github.com/hardbyte/python-can) compatible interface by modifying the following line in the middle of `reader.py`.
1717

1818
```python
19-
bus = can.Bus(interface='slcan', channel='COM9', bitrate=500000)
19+
bus = can.Bus(interface='slcan', channel=args.devicename, bitrate=500000)
2020
```
2121

2222
The communication is configured so that the example in the standard can be recreated.
2323
Modifications may be required to deal with specific ECUs.
2424

25-
Connect your CAN device to the vehicle's diagnostic connector, then the script will run by the command below:
25+
Connect your CAN device to the vehicle's diagnostic connector, then the script will tell you the usage by the command below:
2626

2727
Windows
28-
* `python .\reader\reader.py`
28+
* `python .\reader\reader.py --help`
2929

3030
Linux or macOS
31-
* `python3 ./reader/reader.py`
31+
* `python3 ./reader/reader.py --help`
3232

3333
If successful, the data will be stored in the `result` directory.
3434

0 commit comments

Comments
 (0)