fix(emulator): CLI --port for TCP fails with 'TCP transport requires port'
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- cli, networking
Research direction
Start in packages/emulator/src/cli.ts and trace how --port is parsed and passed to ModbusEmulator; check how the TCP transport exposes getTcpPort(). Find the CLI tests and add coverage for numeric, invalid, and zero ports. Done when TCP starts on the requested port, rejects abc clearly, and reports the actual bound port.
Written by the indexing model from the issue text.
Description
Found while working on #705.
ya-modbus-emulator --transport tcp --host 127.0.0.1 --port 5020 --slave-id 1 passes --port as the string '5020' (packages/emulator/src/cli.ts). ModbusEmulator needs a number for TCP, so the CLI cannot start a TCP emulator. Before #705 the message was TCP transport requires port (a port was given); after #705 it says the port must be a whole number.
Also, the start message prints the configured port, so with --port 0 it would print 0 and not the real port (getTcpPort()).
Done when
-
--port 5020with--transport tcpstarts the emulator on port 5020 (a number string from the CLI becomes a number for TCP). -
--port abcwith TCP gives a clear error. - The start message shows the real TCP port (
getTcpPort()), also for--port 0. - A CLI test covers these.
- Dominant language
- TypeScript
- Stars
- 3
- Forks
- 0
- Avg merge
- 13h 46m
- Merged PRs (30d)
- 58
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from groupsky/ya-modbus
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
codex-ok
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
codex-ok developer-experience scope:mqtt-bridge
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
All issues in groupsky/ya-modbus
Similar issues
-
enhancement UX
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
online-go/online-go.com#4000 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
SnosMe/awakened-poe-trade#1976 ·
-
[BUG]Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
jonp-h/TillerQuest#319 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
terrazzoapp/terrazzo#902 ·