{"_id":"@bun-win32/bluetoothapis","_rev":"5-3ea7250ee71cf75509c0cc6c2500ba9d","name":"@bun-win32/bluetoothapis","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/bluetoothapis","version":"1.0.0","keywords":["bun","ffi","win32","windows","bluetoothapis","bluetooth","ble","gatt","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/bluetoothapis@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"d1a5a1d6b46b571db00218aca9ea9b62ace7dda0","tarball":"https://registry.npmjs.org/@bun-win32/bluetoothapis/-/bluetoothapis-1.0.0.tgz","fileCount":6,"integrity":"sha512-qUI6JCCERnW+NoDlLDU6lI770iycABMPByoBkF26kUgmu/3PbDeZl+QoijFyHRYY5TpzCC1GHKGfURTcMO/h8g==","signatures":[{"sig":"MEUCIEjd3oeEgDfNzBZ0cz/cyvBOjMme+gqRijgzijqaxHjiAiEA6RRuuqGXjNwJT1dWqywnnn6puGpquceLL32+nzi3Hjk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31523},"main":"./index.ts","type":"module","module":"index.ts","shasum":"d1a5a1d6b46b571db00218aca9ea9b62ace7dda0","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example":"bun ./example/bluetoothapis.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-qUI6JCCERnW+NoDlLDU6lI770iycABMPByoBkF26kUgmu/3PbDeZl+QoijFyHRYY5TpzCC1GHKGfURTcMO/h8g==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/bluetoothapis"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 BLUETOOTHAPIS bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/bluetoothapis_1.0.0_1775657298630_0.9873755719719712","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/bluetoothapis","version":"1.0.1","keywords":["bun","ffi","win32","windows","bluetoothapis","bluetooth","ble","gatt","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/bluetoothapis@1.0.1","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"0f09ba794620a6607c5cdfb881e491c272c2e5ee","tarball":"https://registry.npmjs.org/@bun-win32/bluetoothapis/-/bluetoothapis-1.0.1.tgz","fileCount":6,"integrity":"sha512-P3Fs84qKYyZh7fjkrQdMOhAjjqbVK8TVNsYfAQvG5JAK1sJnHIllGz5I+b9gA8Q3GXU0848lmZQ6Qmy8L0bVsw==","signatures":[{"sig":"MEUCIQCdOVLVflYFhbjC6H+ObvtWX5NV2CFBW9QfteX0WM/uJAIgAL/f8gcfeERKWWfgP8BUShw7uzhjN5z7SASaiL36Ew0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31630},"main":"./index.ts","type":"module","module":"index.ts","shasum":"0f09ba794620a6607c5cdfb881e491c272c2e5ee","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:device-scanner":"bun ./example/device-scanner.ts","example:radio-inspector":"bun ./example/radio-inspector.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-P3Fs84qKYyZh7fjkrQdMOhAjjqbVK8TVNsYfAQvG5JAK1sJnHIllGz5I+b9gA8Q3GXU0848lmZQ6Qmy8L0bVsw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/bluetoothapis"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 BLUETOOTHAPIS bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/bluetoothapis_1.0.1_1775687638712_0.7620809791442926","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bun-win32/bluetoothapis","version":"1.0.2","keywords":["bun","ffi","win32","windows","bluetoothapis","bluetooth","ble","gatt","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/bluetoothapis@1.0.2","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"baafb63c45dd9940ec2becf2573d9cb2d6dfbf9f","tarball":"https://registry.npmjs.org/@bun-win32/bluetoothapis/-/bluetoothapis-1.0.2.tgz","fileCount":6,"integrity":"sha512-b/9aKSE5al7alTs50FEmXgmafZ1HtZW3YlT6T30DDP1EA44gXELRgLxtaVtuVyevz+3+Fr+qlRvarrhFRxliIg==","signatures":[{"sig":"MEUCIQDTPrdw77QM6fr9npVRDaqxvZiGXJ9vVM4bc7I3bchRQAIgQworkIJtuLQQczHZekteKPSOu9zuyF1EtqGrM0R6nKs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31635},"main":"./index.ts","type":"module","module":"index.ts","shasum":"baafb63c45dd9940ec2becf2573d9cb2d6dfbf9f","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:device-scanner":"bun ./example/device-scanner.ts","example:radio-inspector":"bun ./example/radio-inspector.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-b/9aKSE5al7alTs50FEmXgmafZ1HtZW3YlT6T30DDP1EA44gXELRgLxtaVtuVyevz+3+Fr+qlRvarrhFRxliIg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/bluetoothapis"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 BLUETOOTHAPIS bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/bluetoothapis_1.0.2_1781130786706_0.31405640065907314","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/bluetoothapis","version":"2.0.0","keywords":["bun","ffi","win32","windows","bluetoothapis","bluetooth","ble","gatt","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/bluetoothapis@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"c4c6ced2b4073777853a35f767cf3c4d97910c83","tarball":"https://registry.npmjs.org/@bun-win32/bluetoothapis/-/bluetoothapis-2.0.0.tgz","fileCount":6,"integrity":"sha512-zKVbJZdy/niHfc2KEGV4ELramH2VTDN/XbrwBSneZH9eOhSiD/9EHar86D9wPFzqv63XDxcqJkHyQyi+akfR6g==","signatures":[{"sig":"MEYCIQD/p7PSp9h+fnFF5IEB+cV8eaKUGqSPaQZ6YF6StdSqrgIhAOvbYaWpXEceYq0zwKLuK0l0FQvWfRUv+MUaUV+iGgex","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33322},"main":"./index.ts","type":"module","module":"index.ts","shasum":"c4c6ced2b4073777853a35f767cf3c4d97910c83","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:device-scanner":"bun ./example/device-scanner.ts","example:radio-inspector":"bun ./example/radio-inspector.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-zKVbJZdy/niHfc2KEGV4ELramH2VTDN/XbrwBSneZH9eOhSiD/9EHar86D9wPFzqv63XDxcqJkHyQyi+akfR6g==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/bluetoothapis"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 BLUETOOTHAPIS bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/bluetoothapis_2.0.0_1782435271376_0.9545175539524031","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 BLUETOOTHAPIS bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/bluetoothapis","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/bluetoothapis"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","bluetoothapis","bluetooth","ble","gatt","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:device-scanner":"bun ./example/device-scanner.ts","example:radio-inspector":"bun ./example/radio-inspector.ts"},"_id":"@bun-win32/bluetoothapis@2.0.1","_integrity":"sha512-E5wTEXGOiZPgRhG42jKFAawUjnzGgCfT1Z1HmdThGcaL5qn6IiW/obLeYKWb6KzdV/OWFC6EwChB1EO6kGB0sw==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"096b7f15c599ae01bbee3bdc96b276eb375a2229","dist":{"integrity":"sha512-E5wTEXGOiZPgRhG42jKFAawUjnzGgCfT1Z1HmdThGcaL5qn6IiW/obLeYKWb6KzdV/OWFC6EwChB1EO6kGB0sw==","shasum":"096b7f15c599ae01bbee3bdc96b276eb375a2229","tarball":"https://registry.npmjs.org/@bun-win32/bluetoothapis/-/bluetoothapis-2.0.1.tgz","fileCount":6,"unpackedSize":33322,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDg+VgGpD+YPBVKRAGaXpzAv6um0cr+c19rXwfH36551AiEAqMuY9XSu+GemWJBKzwffnW/DQJjVhXYqS5xmAOUfsnY="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bluetoothapis_2.0.1_1782437727106_0.33807315203594657"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-08T14:08:18.440Z","modified":"2026-06-26T01:35:27.401Z","1.0.0":"2026-04-08T14:08:18.787Z","1.0.1":"2026-04-08T22:33:58.907Z","1.0.2":"2026-06-10T22:33:06.871Z","2.0.0":"2026-06-26T00:54:31.525Z","2.0.1":"2026-06-26T01:35:27.268Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","bluetoothapis","bluetooth","ble","gatt","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/bluetoothapis"},"description":"Zero-dependency, zero-overhead Win32 BLUETOOTHAPIS bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/bluetoothapis\n\nZero-dependency, zero-overhead Win32 BluetoothApis bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/bluetoothapis` exposes the `bluetoothapis.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `BluetoothApis`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `bluetoothapis.dll` (Bluetooth Classic radio/device discovery, BLE GATT, SDP, authentication).\n- In-source docs in `structs/BluetoothApis.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`BluetoothApis.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/BluetoothApis.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/bluetoothapis\n```\n\n## Quick Start\n\n```ts\nimport BluetoothApis from '@bun-win32/bluetoothapis';\nimport Kernel32 from '@bun-win32/kernel32';\n\n// BLUETOOTH_FIND_RADIO_PARAMS: { dwSize: DWORD }\nconst params = Buffer.alloc(4);\nparams.writeUInt32LE(4, 0);\n\nconst hRadio = Buffer.alloc(8);\nconst hFind = BluetoothApis.BluetoothFindFirstRadio(params.ptr, hRadio.ptr);\n\nif (hFind !== 0n) {\n  const radioHandle = hRadio.readBigUInt64LE(0);\n  console.log('Found radio handle:', radioHandle);\n\n  // Get radio info\n  const radioInfo = Buffer.alloc(520); // BLUETOOTH_RADIO_INFO size\n  radioInfo.writeUInt32LE(520, 0);     // dwSize\n  const err = BluetoothApis.BluetoothGetRadioInfo(radioHandle, radioInfo.ptr);\n  if (err === 0) {\n    const name = new TextDecoder('utf-16le').decode(radioInfo.subarray(264, 264 + 496)).replace(/\\0.*$/, '');\n    console.log('Radio name:', name);\n  }\n\n  Kernel32.CloseHandle(radioHandle);\n  BluetoothApis.BluetoothFindRadioClose(hFind);\n}\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\ncd packages/bluetoothapis && bun run example/bluetoothapis.ts\n```\n\n## Notes\n\n- Either rely on lazy binding or call `BluetoothApis.Preload()`.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}