hw-vx-config 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: hw-vx-config
3
+ Version: 0.1.0
4
+ Summary: Network configuration tool for HW-VX6330K / HW-VX6346KL serial-to-Ethernet modules
5
+ Author: xynogen
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/xynogen/hw-vx-config
8
+ Project-URL: Repository, https://github.com/xynogen/hw-vx-config
9
+ Project-URL: Issues, https://github.com/xynogen/hw-vx-config/issues
10
+ Keywords: hw-vx6330k,hw-vx6346kl,serial-to-ethernet,network-config,udp
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: System Administrators
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: System :: Networking
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=7.0; extra == "dev"
26
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
27
+ Requires-Dist: mypy>=1.0; extra == "dev"
28
+ Requires-Dist: ruff>=0.4; extra == "dev"
29
+
30
+ # hw-vx-config
31
+
32
+ Network configuration tool for HW-VX6330K / HW-VX6346KL serial-to-Ethernet modules on Linux.
33
+ Sends UDP packets directly to the device — no DLLs, no runtime dependencies, pure stdlib.
34
+
35
+ Accepts a device IP or discovers via broadcast; reads and writes all network, serial, and
36
+ advanced settings over the HW-VX UDP protocol (port 65535).
37
+
38
+ ## Table of Contents
39
+
40
+ - [Requirements](#requirements)
41
+ - [Quick Start](#quick-start)
42
+ - [CLI Reference](#cli-reference)
43
+ - [Interactive Menu](#interactive-menu)
44
+ - [Protocol](#protocol)
45
+ - [Examples](#examples)
46
+ - [Development](#development)
47
+ - [License](#license)
48
+
49
+ ## Requirements
50
+
51
+ - Python 3.10 or later
52
+ - Linux (uses `SO_BROADCAST`; port 65535 requires no root)
53
+ - Device reachable on the local network (same subnet or routed UDP)
54
+
55
+ ## Quick Start
56
+
57
+ ```bash
58
+ python -m venv .venv && source .venv/bin/activate
59
+ pip install -e .
60
+
61
+ # Discover all readers on the network
62
+ hw-vx-config search
63
+
64
+ # Or run directly without installing
65
+ python main.py
66
+ ```
67
+
68
+ ## CLI Reference
69
+
70
+ All operations take the current device IP as the first positional argument.
71
+
72
+ ```bash
73
+ # Discover all readers via broadcast
74
+ hw-vx-config search
75
+
76
+ # Print full configuration for a device
77
+ hw-vx-config config <ip>
78
+
79
+ # Change static IP and reboot
80
+ hw-vx-config set-ip <current-ip> <new-ip>
81
+
82
+ # Enable or disable DHCP and reboot
83
+ hw-vx-config dhcp <ip> on|off
84
+
85
+ # Send reboot command
86
+ hw-vx-config reboot <ip>
87
+
88
+ # Launch interactive menu
89
+ hw-vx-config interactive
90
+ hw-vx-config # same — interactive is the default
91
+ ```
92
+
93
+ ## Interactive Menu
94
+
95
+ The interactive menu (`hw-vx-config` with no arguments) provides a numbered prompt:
96
+
97
+ ```
98
+ 1. Search for readers — broadcast discovery, select from results
99
+ 2. Connect to specific IP — skip discovery, target a known address directly
100
+ 3. Show current configuration
101
+ 4. Change IP address
102
+ 5. Enable/Disable DHCP
103
+ 6. Edit & save full configuration — field-by-field editor, confirm before write
104
+ 7. Change remote server — set Remote IP, Remote Port, Work Mode
105
+ 8. Reboot reader
106
+ q. Quit
107
+ ```
108
+
109
+ Option 2 is useful when the device is on a different subnet and broadcast cannot reach it.
110
+
111
+ ## Protocol
112
+
113
+ UDP on port **65535**. Every packet is ASCII. Replies are prefixed with `A`.
114
+
115
+ | Prefix | Direction | Action |
116
+ |:---|:---|:---|
117
+ | `X` | → device | Broadcast echo — triggers discovery reply |
118
+ | `W{mac}` | → device | Select device by MAC |
119
+ | `L` | → device | Login |
120
+ | `O` | → device | Logout |
121
+ | `G{code}` | → device | Get one setting |
122
+ | `S{code}{value}\|{seq}` | → device | Set one setting |
123
+ | `E` | → device | Save and reboot |
124
+ | `A{payload}` | ← device | All replies |
125
+
126
+ Discovery reply format: `A{mac}/{port}/.../{username}/{device_name}` from the device's source IP.
127
+
128
+ Setting codes of note: `IP` (IP address), `NM` (subnet mask), `GI` (gateway), `DH` (DHCP),
129
+ `BR` (baud rate), `TP` (protocol), `RM` (work mode). Full table in `src/hw_vx_config/constants.py`.
130
+
131
+ ## Examples
132
+
133
+ The `examples/` directory contains companion scripts.
134
+
135
+ | File | Description |
136
+ |:---|:---|
137
+ | `server_uhf.py` | TCP server that receives RFID tag data from the reader on port 2077. Run this alongside the reader when `Work Mode` is set to `Client` and `Remote Port` is `2077`. |
138
+ | `library_usage.py` | Shows how to use `HwVxDevice` and `HwVxNetworking` directly in Python code — discover, read config, change settings, and quick operations. |
139
+
140
+ ```bash
141
+ python examples/server_uhf.py
142
+ # Listening on 0.0.0.0:2077
143
+ ```
144
+
145
+ ## Development
146
+
147
+ Install with dev extras, then use the standard toolchain:
148
+
149
+ ```bash
150
+ pip install -e ".[dev]"
151
+
152
+ # Lint and format
153
+ ruff check --fix src/ tests/
154
+ ruff format src/ tests/
155
+
156
+ # Type check
157
+ mypy src/
158
+
159
+ # Run tests
160
+ pytest
161
+
162
+ # Tests with coverage
163
+ pytest --cov=hw_vx_config --cov-report=term-missing
164
+ ```
165
+
166
+ Tests live in `tests/` and mock the UDP socket — no device needed to run them.
167
+
168
+ ## Tested with
169
+
170
+ - Package version: **0.1.0**
171
+ - Hardware: HW-VX6330K, HW-VX6346KL
172
+ - Protocol: UDP port 65535, ASCII request/reply
173
+ - OS: Linux (Ubuntu 22.04+)
174
+
175
+ ## License
176
+
177
+ MIT
@@ -0,0 +1,148 @@
1
+ # hw-vx-config
2
+
3
+ Network configuration tool for HW-VX6330K / HW-VX6346KL serial-to-Ethernet modules on Linux.
4
+ Sends UDP packets directly to the device — no DLLs, no runtime dependencies, pure stdlib.
5
+
6
+ Accepts a device IP or discovers via broadcast; reads and writes all network, serial, and
7
+ advanced settings over the HW-VX UDP protocol (port 65535).
8
+
9
+ ## Table of Contents
10
+
11
+ - [Requirements](#requirements)
12
+ - [Quick Start](#quick-start)
13
+ - [CLI Reference](#cli-reference)
14
+ - [Interactive Menu](#interactive-menu)
15
+ - [Protocol](#protocol)
16
+ - [Examples](#examples)
17
+ - [Development](#development)
18
+ - [License](#license)
19
+
20
+ ## Requirements
21
+
22
+ - Python 3.10 or later
23
+ - Linux (uses `SO_BROADCAST`; port 65535 requires no root)
24
+ - Device reachable on the local network (same subnet or routed UDP)
25
+
26
+ ## Quick Start
27
+
28
+ ```bash
29
+ python -m venv .venv && source .venv/bin/activate
30
+ pip install -e .
31
+
32
+ # Discover all readers on the network
33
+ hw-vx-config search
34
+
35
+ # Or run directly without installing
36
+ python main.py
37
+ ```
38
+
39
+ ## CLI Reference
40
+
41
+ All operations take the current device IP as the first positional argument.
42
+
43
+ ```bash
44
+ # Discover all readers via broadcast
45
+ hw-vx-config search
46
+
47
+ # Print full configuration for a device
48
+ hw-vx-config config <ip>
49
+
50
+ # Change static IP and reboot
51
+ hw-vx-config set-ip <current-ip> <new-ip>
52
+
53
+ # Enable or disable DHCP and reboot
54
+ hw-vx-config dhcp <ip> on|off
55
+
56
+ # Send reboot command
57
+ hw-vx-config reboot <ip>
58
+
59
+ # Launch interactive menu
60
+ hw-vx-config interactive
61
+ hw-vx-config # same — interactive is the default
62
+ ```
63
+
64
+ ## Interactive Menu
65
+
66
+ The interactive menu (`hw-vx-config` with no arguments) provides a numbered prompt:
67
+
68
+ ```
69
+ 1. Search for readers — broadcast discovery, select from results
70
+ 2. Connect to specific IP — skip discovery, target a known address directly
71
+ 3. Show current configuration
72
+ 4. Change IP address
73
+ 5. Enable/Disable DHCP
74
+ 6. Edit & save full configuration — field-by-field editor, confirm before write
75
+ 7. Change remote server — set Remote IP, Remote Port, Work Mode
76
+ 8. Reboot reader
77
+ q. Quit
78
+ ```
79
+
80
+ Option 2 is useful when the device is on a different subnet and broadcast cannot reach it.
81
+
82
+ ## Protocol
83
+
84
+ UDP on port **65535**. Every packet is ASCII. Replies are prefixed with `A`.
85
+
86
+ | Prefix | Direction | Action |
87
+ |:---|:---|:---|
88
+ | `X` | → device | Broadcast echo — triggers discovery reply |
89
+ | `W{mac}` | → device | Select device by MAC |
90
+ | `L` | → device | Login |
91
+ | `O` | → device | Logout |
92
+ | `G{code}` | → device | Get one setting |
93
+ | `S{code}{value}\|{seq}` | → device | Set one setting |
94
+ | `E` | → device | Save and reboot |
95
+ | `A{payload}` | ← device | All replies |
96
+
97
+ Discovery reply format: `A{mac}/{port}/.../{username}/{device_name}` from the device's source IP.
98
+
99
+ Setting codes of note: `IP` (IP address), `NM` (subnet mask), `GI` (gateway), `DH` (DHCP),
100
+ `BR` (baud rate), `TP` (protocol), `RM` (work mode). Full table in `src/hw_vx_config/constants.py`.
101
+
102
+ ## Examples
103
+
104
+ The `examples/` directory contains companion scripts.
105
+
106
+ | File | Description |
107
+ |:---|:---|
108
+ | `server_uhf.py` | TCP server that receives RFID tag data from the reader on port 2077. Run this alongside the reader when `Work Mode` is set to `Client` and `Remote Port` is `2077`. |
109
+ | `library_usage.py` | Shows how to use `HwVxDevice` and `HwVxNetworking` directly in Python code — discover, read config, change settings, and quick operations. |
110
+
111
+ ```bash
112
+ python examples/server_uhf.py
113
+ # Listening on 0.0.0.0:2077
114
+ ```
115
+
116
+ ## Development
117
+
118
+ Install with dev extras, then use the standard toolchain:
119
+
120
+ ```bash
121
+ pip install -e ".[dev]"
122
+
123
+ # Lint and format
124
+ ruff check --fix src/ tests/
125
+ ruff format src/ tests/
126
+
127
+ # Type check
128
+ mypy src/
129
+
130
+ # Run tests
131
+ pytest
132
+
133
+ # Tests with coverage
134
+ pytest --cov=hw_vx_config --cov-report=term-missing
135
+ ```
136
+
137
+ Tests live in `tests/` and mock the UDP socket — no device needed to run them.
138
+
139
+ ## Tested with
140
+
141
+ - Package version: **0.1.0**
142
+ - Hardware: HW-VX6330K, HW-VX6346KL
143
+ - Protocol: UDP port 65535, ASCII request/reply
144
+ - OS: Linux (Ubuntu 22.04+)
145
+
146
+ ## License
147
+
148
+ MIT
@@ -0,0 +1,87 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "hw-vx-config"
7
+ version = "0.1.0"
8
+ description = "Network configuration tool for HW-VX6330K / HW-VX6346KL serial-to-Ethernet modules"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.10"
12
+ authors = [{ name = "xynogen" }]
13
+ keywords = [
14
+ "hw-vx6330k",
15
+ "hw-vx6346kl",
16
+ "serial-to-ethernet",
17
+ "network-config",
18
+ "udp",
19
+ ]
20
+ classifiers = [
21
+ "Development Status :: 3 - Alpha",
22
+ "Environment :: Console",
23
+ "Intended Audience :: System Administrators",
24
+ "Operating System :: POSIX :: Linux",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.10",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Topic :: System :: Networking",
31
+ "Typing :: Typed",
32
+ ]
33
+
34
+ # No runtime dependencies — pure stdlib
35
+ dependencies = []
36
+
37
+ [project.optional-dependencies]
38
+ dev = ["pytest>=7.0", "pytest-cov>=4.0", "mypy>=1.0", "ruff>=0.4"]
39
+
40
+ [project.urls]
41
+ Homepage = "https://github.com/xynogen/hw-vx-config"
42
+ Repository = "https://github.com/xynogen/hw-vx-config"
43
+ Issues = "https://github.com/xynogen/hw-vx-config/issues"
44
+
45
+ [project.scripts]
46
+ hw-vx-config = "hw_vx_config.cli:main"
47
+
48
+ [tool.setuptools.packages.find]
49
+ where = ["src"]
50
+
51
+ # ─── Ruff ────────────────────────────────────────────────────────────
52
+
53
+ [tool.ruff]
54
+ target-version = "py310"
55
+ line-length = 100
56
+ src = ["src", "tests"]
57
+
58
+ [tool.ruff.lint]
59
+ select = ["E", "F", "W", "I", "N", "UP", "B", "A", "SIM", "RUF"]
60
+ ignore = ["E501"]
61
+
62
+ [tool.ruff.lint.isort]
63
+ known-first-party = ["hw_vx_config"]
64
+
65
+ # ─── Pytest ──────────────────────────────────────────────────────────
66
+
67
+ [tool.pytest.ini_options]
68
+ testpaths = ["tests"]
69
+ addopts = "-v --tb=short"
70
+
71
+ # ─── Mypy ────────────────────────────────────────────────────────────
72
+
73
+ [tool.mypy]
74
+ python_version = "3.10"
75
+ warn_return_any = true
76
+ warn_unused_configs = true
77
+ disallow_untyped_defs = true
78
+
79
+ # ─── Coverage ────────────────────────────────────────────────────────
80
+
81
+ [tool.coverage.run]
82
+ source = ["hw_vx_config"]
83
+ omit = ["*/cli.py"]
84
+
85
+ [tool.coverage.report]
86
+ show_missing = true
87
+ skip_empty = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,21 @@
1
+ """
2
+ HW-VX6330K / HW-VX6346KL Network Configuration Tool for Linux.
3
+
4
+ Ported from the C# Demo v2.11 (Networking.cs + Form1.cs).
5
+ Protocol: UDP packets to port 65535 (HW-VX IP Protocol).
6
+
7
+ No DLLs needed — pure Python sockets.
8
+ """
9
+
10
+ __version__ = "1.0.0"
11
+
12
+ from hw_vx_config.device import HwVxDevice
13
+ from hw_vx_config.models import DeviceConfig, SearchResult
14
+ from hw_vx_config.transport import HwVxNetworking
15
+
16
+ __all__ = [
17
+ "DeviceConfig",
18
+ "HwVxDevice",
19
+ "HwVxNetworking",
20
+ "SearchResult",
21
+ ]
@@ -0,0 +1,6 @@
1
+ """Allow running as ``python -m hw_vx_config``."""
2
+
3
+ from hw_vx_config.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ main()