• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bacnet-js / client / 36873434322
85%

Build:
DEFAULT BRANCH: master
Ran 01 Oct 2026 02:06PM UTC
Jobs 1
Files 44
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Oct 2026 02:03PM UTC coverage: 85.274% (+0.01%) from 85.263%
36873434322

push

github

web-flow
fix: default NPDU hop count to 0xff so routed requests are not discarded (#87)

## Summary

Fixes #86.

Most service methods call `npdu.encode()` without the `hopCount`
argument, so when the receiver address contains a routed destination
(`net`/`adr` set) the NPDU hop count byte is encoded as `0x00`. Per
ASHRAE 135 §6.2.2 a router must discard routed NPDUs with hop count 0,
so services like `subscribeCov`, `subscribeProperty`,
`writePropertyMultiple`, `readRange` and `timeSync` never reach devices
behind a router and time out.
`readProperty`/`writeProperty`/`readPropertyMultiple`/`whoIs` are
unaffected because they pass `DEFAULT_HOP_COUNT` explicitly.

## Change

Default the `hopCount` parameter in `npdu.encode()` to `0xff` (and drop
the `hopCount || 0` fallback), fixing all call sites in one change. This
matches the spec's guidance to initialize the hop count to 255. Callers
that pass an explicit hop count (e.g. `DEFAULT_HOP_COUNT`) are
unchanged.

## Verification

- `npm run build` clean
- `npm run test:unit` — 204/204 pass
- Encoding check: `npdu.encode(buf, 0x04, { net: 2, adr: [12] })` now
produces `01 24 00 02 01 0c ff` (previously `...0c 00`)
- Tested end-to-end against a bacnet-stack `router-mstp` (BACnet/IP net
1 ↔ MS/TP net 2): `subscribeCov` to an MS/TP device previously logged
`NPDU: DNET=2. Discarded!` on the router and timed out; with this fix
the subscription is acknowledged and COV notifications are received.

1053 of 1545 branches covered (68.16%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

5589 of 6244 relevant lines covered (89.51%)

37.82 hits per line

Jobs
ID Job ID Ran Files Coverage
1 36873434322.1 01 Oct 2026 02:06PM UTC 44
85.27
GitHub Action Run
Source Files on build 36873434322
  • Tree
  • List 44
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36873434322
  • 7ad9057f on github
  • Prev Build on master (#25485390981)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc