{"_id":"@csllc/mb-conn-noble-ble","_rev":"2-e25e2efb788d3f690fa7b422f3251468","name":"@csllc/mb-conn-noble-ble","dist-tags":{"latest":"1.2.0"},"versions":{"1.1.0":{"name":"@csllc/mb-conn-noble-ble","version":"1.1.0","author":{"url":"http://wwww.icloud.com/","name":"Bill Glase","email":"bglase@icloud.com"},"license":"MIT","_id":"@csllc/mb-conn-noble-ble@1.1.0","maintainers":[{"name":"gfang","email":"gfang@controls.com"},{"name":"cwalden-cs","email":"cwalden@controls.com"},{"name":"sean.kudrna.cs","email":"skudrna@controls.com"},{"name":"incuiti","email":"incuiti@icloud.com"},{"name":"dayaeger","email":"dyaeger@controls.com"}],"dist":{"shasum":"a3a55455e6d92cd33b3ffef41a4d4c15ed6a81a7","tarball":"https://registry.npmjs.org/@csllc/mb-conn-noble-ble/-/mb-conn-noble-ble-1.1.0.tgz","fileCount":11,"integrity":"sha512-xwTPRvRQlPbEPmoH/Glrjs+1pD3L9SiY5SNtNTnsbR6dzxEXZto4eDCMwx0Wx/8p3CKcMBO8Ot+TxEsfGx1QUQ==","signatures":[{"sig":"MEUCIQDXCqjm1lAIfuegkV2bkunGE1uQnvOCwREHwZ3vATCxxAIgAS5AGX79GXxU9lcKNOLZnvaLDx+mHo1LW5UwAa2VK9Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9245},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"0fd150c83012da8251a2da724a25b4dd1692b3ce","scripts":{"lint":"eslint","test":"node --experimental-vm-modules ../../node_modules/.bin/jest","build":"tsc","clean":"rm -rf dist/*","watch":"tsc --watch","preversion":"npm run clean && npm run build","type:check":"tsc -p tsconfig.json --noEmit","postversion":"git push --follow-tags"},"_npmUser":{"name":"incuiti","email":"incuiti@icloud.com"},"_npmVersion":"10.9.4","description":"Connection type for MODBUS using Noble BLE transparent UART","directories":{},"_nodeVersion":"22.21.1","dependencies":{"@csllc/noble-ble":"*","@csllc/blejs-types":"*","@csllc/modbus-types":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.6","typescript":"^5.3.2","@types/jest":"^29.5.11"},"_npmOperationalInternal":{"tmp":"tmp/mb-conn-noble-ble_1.1.0_1775514956077_0.5162455035839613","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@csllc/mb-conn-noble-ble","version":"1.2.0","publishConfig":{"access":"public"},"description":"Connection type for MODBUS using Noble BLE transparent UART","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"type:check":"tsc -p tsconfig.json --noEmit","clean":"rm -rf dist/*","build":"tsc","watch":"tsc --watch","preversion":"npm run clean && npm run build","postversion":"git push --follow-tags","test":"node --experimental-vm-modules ../../node_modules/.bin/jest","lint":"eslint"},"author":{"name":"Bill Glase","email":"bglase@icloud.com","url":"http://wwww.icloud.com/"},"license":"MIT","dependencies":{"@csllc/modbus-types":"*","@csllc/noble-ble":"*","@csllc/blejs-types":"*"},"devDependencies":{"@types/jest":"^29.5.11","jest":"^29.7.0","ts-jest":"^29.4.6","typescript":"^5.3.2"},"_id":"@csllc/mb-conn-noble-ble@1.2.0","gitHead":"6a9bd507f0aa9f94936f8dee3b8c5fd1cfaa84ea","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-t3P/52yNrRY/Bcg+fY/WYwGt/2lNgGNLj73OL1C8ENzwELvCVRwEb/sal7KEiuIKYaF2RnkSQUIgYRI2Iajqcg==","shasum":"e47badbd14cc0ab1ca155fb85e2d5d3d3b8f1e84","tarball":"https://registry.npmjs.org/@csllc/mb-conn-noble-ble/-/mb-conn-noble-ble-1.2.0.tgz","fileCount":11,"unpackedSize":9649,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGfixb/jFdNJ4Zlm0gID3Te3CKiK8VBDFUb76Hbi/L7fAiEAoscPjvGhaMneIPOpCKchNAsg7n/DdBVaEEAUZQ1MJ7I="}]},"_npmUser":{"name":"incuiti","email":"incuiti@icloud.com"},"directories":{},"maintainers":[{"name":"gfang","email":"gfang@controls.com"},{"name":"cwalden-cs","email":"cwalden@controls.com"},{"name":"sean.kudrna.cs","email":"skudrna@controls.com"},{"name":"incuiti","email":"incuiti@icloud.com"},{"name":"dayaeger","email":"dyaeger@controls.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mb-conn-noble-ble_1.2.0_1775615703779_0.8835917589392634"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-06T22:35:55.912Z","modified":"2026-04-08T02:35:04.080Z","1.1.0":"2026-04-06T22:35:56.209Z","1.2.0":"2026-04-08T02:35:03.929Z"},"author":{"name":"Bill Glase","email":"bglase@icloud.com","url":"http://wwww.icloud.com/"},"license":"MIT","description":"Connection type for MODBUS using Noble BLE transparent UART","maintainers":[{"name":"gfang","email":"gfang@controls.com"},{"name":"cwalden-cs","email":"cwalden@controls.com"},{"name":"sean.kudrna.cs","email":"skudrna@controls.com"},{"name":"incuiti","email":"incuiti@icloud.com"},{"name":"dayaeger","email":"dyaeger@controls.com"}],"readme":"# @csllc/mb-conn-noble-ble\n\nMODBUS-over-BLE connection package using [@abandonware/noble](https://github.com/abandonware/noble).\n\nProvides a `BleConnection` class (extending `Connection` from `@csllc/modbus-types`) that bridges BLE transparent UART characteristics to the MODBUS connection API, and a `scan()` utility for discovering BLE peripherals.\n\n## Installation\n\n```bash\nnpm install @csllc/mb-conn-noble-ble\n```\n\n## Exports\n\n### `BleConnection`\n\nA `Connection` subclass that bridges BLE UART RX/TX characteristics to the `Connection` API used by `@csllc/modbus-types`.\n\n```typescript\nimport { BleConnection } from '@csllc/mb-conn-noble-ble';\n\nconst connection = new BleConnection(ble, peripheral, rxChar, txChar);\nawait connection.open(); // subscribes to UART RX notifications\nawait connection.write(buf); // writes to UART TX characteristic\nawait connection.close(); // unsubscribes and disconnects\n```\n\n- **`open()`** — Subscribes to the UART RX characteristic. Incoming BLE notifications are converted to `ArrayBuffer` and emitted as `'data'` events.\n- **`write(data: ArrayBuffer)`** — Writes bytes to the UART TX characteristic. Emits `'write'`.\n- **`close()`** — Unsubscribes from RX and disconnects the peripheral. Emits `'close'`.\n- **`isOpen()`** — Returns `true` if the connection is active.\n- **`destroy()`** — Closes and removes all listeners.\n\nEvents: `'open'`, `'close'`, `'data'`, `'write'`, `'error'`\n\n### `scan(serviceUuids?, duration?)`\n\nDiscovers BLE peripherals using `NobleBleManager` from `@csllc/noble-ble`.\n\n```typescript\nimport { scan } from '@csllc/mb-conn-noble-ble';\n\nconst peripherals = await scan(['180a'], 5000);\n// [{ id: '...', type: 'ble', peripheralId: '...', name: 'CS1816' }]\n```\n\n### `BleConnectionInfo`\n\n```typescript\ninterface BleConnectionInfo {\n  id: string; // unique identifier\n  type: 'ble'; // connection type\n  peripheralId: string; // BLE peripheral ID\n  name?: string; // advertised name\n}\n```\n\n## See Also\n\n- `@csllc/mb-conn-noble-mac` — macOS variant using noble-mac / CoreBluetooth\n- `@csllc/noble-ble` — the `Ble` interface adapter wrapping `@abandonware/noble`\n- `@csllc/mb-conn-node-serial` — serial connection for USB dongles\n","readmeFilename":"README.md"}