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

bacnet-js / client / 22664488652
85%

Build:
DEFAULT BRANCH: master
Ran 04 Mar 2026 10:06AM 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

04 Mar 2026 10:03AM UTC coverage: 85.155% (-0.1%) from 85.279%
22664488652

push

github

web-flow
feat: foreign device registration (#74)

## Summary

This PR adds BACnet Foreign Device Registration (FDR) support and
BBMD-based Who-Is discovery to `@bacnet-js/client`, including forwarded
response handling and examples for manual validation.

Fixes #54 

## What changed

- Added `registerForeignDevice(receiver, ttl)` to `BACnetClient`:
  - Sends BVLC `REGISTER_FOREIGN_DEVICE` (`0x05`)
  - Resolves/rejects based on `BVLC_RESULT` from the target BBMD
  - Validates TTL range (`1..65535`)
  - Requires BBMD address format `host:port`
- Serializes parallel registrations per BBMD target to avoid ambiguous
result correlation
- Added `whoIsThroughBBMD(bbmd, options?)` to `BACnetClient`:
- Sends Who-Is wrapped in BVLC `DISTRIBUTE_BROADCAST_TO_NETWORK`
(`0x09`)
- Extended outbound BVLC encode path:
- Added support for `distributeBroadcastToNetwork` receiver flag in
`sendBvlc`
- Extended inbound BVLC handling:
  - Added `BVLC_RESULT` parsing/emission via `bvlcResult` event
  - Added guard to require BVLC-Result payload length before decode
  - Preserved `FORWARDED_NPDU` origin metadata (`forwardedFrom`)
- Improved decode robustness:
- Added guard for invalid BVLC header length (`msgLength <
BVLC_HEADER_LENGTH`)
  - `IAm.decode` now reports correct decoded `len`
- Added examples:
  - `examples/register-foreign-device.ts`
  - `examples/discover-devices-via-bbmd.ts`
- Added/extended tests:
  - Unit coverage for FDR success/NAK/timeout/address validation
- Unit coverage for dedupe + serialized handling of parallel
registrations
- Unit coverage for queued retry behavior after failed prior
registration
  - Unit coverage for BBMD Who-Is (`0x09`)
  - BVLC strict-length behavior test (reject trailing bytes)
  - `IAm` decode-length assertion
  - Improved `register-foreign-device` integration payload assertions

## Type consistency

- Added `BACnetClientEvents.bvlcResult` typing
- Added `BvlcResultPayload` type
- Added `BACNetAddress.distributeBroadcastToNetwork?: boolea... (continued)

1045 of 1543 branches covered (67.73%)

Branch coverage included in aggregate %.

94 of 112 new or added lines in 4 files covered. (83.93%)

5569 of 6224 relevant lines covered (89.48%)

37.4 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
18
67.77
2.47% src/lib/client.ts
Jobs
ID Job ID Ran Files Coverage
1 22664488652.1 04 Mar 2026 10:06AM UTC 44
85.16
GitHub Action Run
Source Files on build 22664488652
  • Tree
  • List 44
  • Changed 8
  • Source Changed 7
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #22664488652
  • 15f3960e on github
  • Prev Build on master (#22634073103)
  • Next Build on master (#22664539794)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc