{"id":19449618,"url":"https://github.com/techplexengineer/bionic-bt-serial","last_synced_at":"2026-06-17T16:04:49.095Z","repository":{"id":144896676,"uuid":"437633017","full_name":"TechplexEngineer/bionic-bt-serial","owner":"TechplexEngineer","description":"capacitorjs bluetooth serial plugin","archived":false,"fork":false,"pushed_at":"2022-01-01T17:40:27.000Z","size":166,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-07T23:36:29.162Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TechplexEngineer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-12T19:08:02.000Z","updated_at":"2022-01-01T17:34:06.000Z","dependencies_parsed_at":"2023-04-26T01:17:27.841Z","dependency_job_id":null,"html_url":"https://github.com/TechplexEngineer/bionic-bt-serial","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechplexEngineer%2Fbionic-bt-serial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechplexEngineer%2Fbionic-bt-serial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechplexEngineer%2Fbionic-bt-serial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechplexEngineer%2Fbionic-bt-serial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechplexEngineer","download_url":"https://codeload.github.com/TechplexEngineer/bionic-bt-serial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240636817,"owners_count":19832947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T16:33:09.341Z","updated_at":"2025-10-26T18:34:04.667Z","avatar_url":"https://github.com/TechplexEngineer.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bionic-bt-serial\n\nSend data between bluetooth devices using a serial like interface\n\n## Install\n\n```bash\nnpm install bionic-bt-serial\nnpx cap sync\n```\n\n## API\n\n\u003cdocgen-index\u003e\n\n* [`addListener(PluginEvents, ...)`](#addlistenerpluginevents)\n* [`addListener('discoveryState', ...)`](#addlistenerdiscoverystate)\n* [`addListener('discovered', ...)`](#addlistenerdiscovered)\n* [`addListener('rawData', ...)`](#addlistenerrawdata)\n* [`addListener('connected', ...)`](#addlistenerconnected)\n* [`addListener('connectionFailed', ...)`](#addlistenerconnectionfailed)\n* [`addListener('connectionLost', ...)`](#addlistenerconnectionlost)\n* [`getBondedDevices()`](#getbondeddevices)\n* [`startListening(...)`](#startlistening)\n* [`stopListening()`](#stoplistening)\n* [`isListening()`](#islistening)\n* [`connect(...)`](#connect)\n* [`isConnected(...)`](#isconnected)\n* [`getConnectedDevices()`](#getconnecteddevices)\n* [`disconnect(...)`](#disconnect)\n* [`disconnectAll()`](#disconnectall)\n* [`write(...)`](#write)\n* [`isEnabled()`](#isenabled)\n* [`enableAdapter()`](#enableadapter)\n* [`disableAdapter()`](#disableadapter)\n* [`showBluetoothSettings()`](#showbluetoothsettings)\n* [`startDiscovery(...)`](#startdiscovery)\n* [`cancelDiscovery()`](#canceldiscovery)\n* [`setName(...)`](#setname)\n* [`getName()`](#getname)\n* [`setDiscoverable(...)`](#setdiscoverable)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n* [Enums](#enums)\n\n\u003c/docgen-index\u003e\n\n\u003cdocgen-api\u003e\n\u003c!--Update the source file JSDoc comments and rerun docgen to update the docs below--\u003e\n\n### addListener(PluginEvents, ...)\n\n```typescript\naddListener(eventName: PluginEvents, callback: EventCallback) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\n| Param           | Type                                                    |\n| --------------- | ------------------------------------------------------- |\n| **`eventName`** | \u003ccode\u003e\u003ca href=\"#pluginevents\"\u003ePluginEvents\u003c/a\u003e\u003c/code\u003e   |\n| **`callback`**  | \u003ccode\u003e\u003ca href=\"#eventcallback\"\u003eEventCallback\u003c/a\u003e\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pluginlistenerhandle\"\u003ePluginListenerHandle\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('discoveryState', ...)\n\n```typescript\naddListener(eventName: 'discoveryState', callback: (result: { starting?: boolean; completed?: boolean; }) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\n| Param           | Type                                                                           |\n| --------------- | ------------------------------------------------------------------------------ |\n| **`eventName`** | \u003ccode\u003e'discoveryState'\u003c/code\u003e                                                  |\n| **`callback`**  | \u003ccode\u003e(result: { starting?: boolean; completed?: boolean; }) =\u0026gt; void\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pluginlistenerhandle\"\u003ePluginListenerHandle\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('discovered', ...)\n\n```typescript\naddListener(eventName: 'discovered', callback: (result: BTDevice) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\n| Param           | Type                                                               |\n| --------------- | ------------------------------------------------------------------ |\n| **`eventName`** | \u003ccode\u003e'discovered'\u003c/code\u003e                                          |\n| **`callback`**  | \u003ccode\u003e(result: \u003ca href=\"#btdevice\"\u003eBTDevice\u003c/a\u003e) =\u0026gt; void\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pluginlistenerhandle\"\u003ePluginListenerHandle\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('rawData', ...)\n\n```typescript\naddListener(eventName: 'rawData', callback: (result: RawDataResult) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\n| Param           | Type                                                                         |\n| --------------- | ---------------------------------------------------------------------------- |\n| **`eventName`** | \u003ccode\u003e'rawData'\u003c/code\u003e                                                       |\n| **`callback`**  | \u003ccode\u003e(result: \u003ca href=\"#rawdataresult\"\u003eRawDataResult\u003c/a\u003e) =\u0026gt; void\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pluginlistenerhandle\"\u003ePluginListenerHandle\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('connected', ...)\n\n```typescript\naddListener(eventName: 'connected', callback: (result: BTDevice) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\n| Param           | Type                                                               |\n| --------------- | ------------------------------------------------------------------ |\n| **`eventName`** | \u003ccode\u003e'connected'\u003c/code\u003e                                           |\n| **`callback`**  | \u003ccode\u003e(result: \u003ca href=\"#btdevice\"\u003eBTDevice\u003c/a\u003e) =\u0026gt; void\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pluginlistenerhandle\"\u003ePluginListenerHandle\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('connectionFailed', ...)\n\n```typescript\naddListener(eventName: 'connectionFailed', callback: (result: BTDevice) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\n| Param           | Type                                                               |\n| --------------- | ------------------------------------------------------------------ |\n| **`eventName`** | \u003ccode\u003e'connectionFailed'\u003c/code\u003e                                    |\n| **`callback`**  | \u003ccode\u003e(result: \u003ca href=\"#btdevice\"\u003eBTDevice\u003c/a\u003e) =\u0026gt; void\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pluginlistenerhandle\"\u003ePluginListenerHandle\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('connectionLost', ...)\n\n```typescript\naddListener(eventName: 'connectionLost', callback: (result: BTDevice) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\n| Param           | Type                                                               |\n| --------------- | ------------------------------------------------------------------ |\n| **`eventName`** | \u003ccode\u003e'connectionLost'\u003c/code\u003e                                      |\n| **`callback`**  | \u003ccode\u003e(result: \u003ca href=\"#btdevice\"\u003eBTDevice\u003c/a\u003e) =\u0026gt; void\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pluginlistenerhandle\"\u003ePluginListenerHandle\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getBondedDevices()\n\n```typescript\ngetBondedDevices() =\u003e Promise\u003c{ result: BTDevice[]; }\u003e\n```\n\nGets a list of the bonded (paired) devices.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ result: BTDevice[]; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### startListening(...)\n\n```typescript\nstartListening(_options: {}, callback: ListenCallback) =\u003e Promise\u003cvoid\u003e\n```\n\nStart listening for incoming connections\n\n| Param          | Type                                                      |\n| -------------- | --------------------------------------------------------- |\n| **`_options`** | \u003ccode\u003e{}\u003c/code\u003e                                           |\n| **`callback`** | \u003ccode\u003e\u003ca href=\"#listencallback\"\u003eListenCallback\u003c/a\u003e\u003c/code\u003e |\n\n--------------------\n\n\n### stopListening()\n\n```typescript\nstopListening() =\u003e Promise\u003cvoid\u003e\n```\n\nStops listening for incoming connections.\n\n--------------------\n\n\n### isListening()\n\n```typescript\nisListening() =\u003e Promise\u003c{ result: boolean; }\u003e\n```\n\nTrue if listening for an accepting incoming connections.\nA device acting as a server should be listening.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ result: boolean; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### connect(...)\n\n```typescript\nconnect(options: { macAddress: string; }) =\u003e Promise\u003cvoid\u003e\n```\n\nConnect to another device acting as a server that is in listening mode.\nShould already be paired?\n\n| Param         | Type                                 |\n| ------------- | ------------------------------------ |\n| **`options`** | \u003ccode\u003e{ macAddress: string; }\u003c/code\u003e |\n\n--------------------\n\n\n### isConnected(...)\n\n```typescript\nisConnected(options: { macAddress: string; }) =\u003e Promise\u003c{ result: boolean; }\u003e\n```\n\nTrue if there is an active connection to the provided macAddress false otherwise.\n\n| Param         | Type                                 |\n| ------------- | ------------------------------------ |\n| **`options`** | \u003ccode\u003e{ macAddress: string; }\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ result: boolean; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getConnectedDevices()\n\n```typescript\ngetConnectedDevices() =\u003e Promise\u003c{ result: BTDevice[]; }\u003e\n```\n\nGets a list of the connected devices.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ result: BTDevice[]; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### disconnect(...)\n\n```typescript\ndisconnect(options: { macAddress: string; }) =\u003e Promise\u003c{ result: boolean; }\u003e\n```\n\nDisconnects specified connection.\n\n| Param         | Type                                 |\n| ------------- | ------------------------------------ |\n| **`options`** | \u003ccode\u003e{ macAddress: string; }\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ result: boolean; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### disconnectAll()\n\n```typescript\ndisconnectAll() =\u003e Promise\u003cvoid\u003e\n```\n\nDisconnects all connections (incomming and outgoing).\n\n--------------------\n\n\n### write(...)\n\n```typescript\nwrite(options: { macAddress: string; data: number[]; }) =\u003e Promise\u003c{ result: boolean; }\u003e\n```\n\nWrite data to specified macAddress\n\n| Param         | Type                                                 |\n| ------------- | ---------------------------------------------------- |\n| **`options`** | \u003ccode\u003e{ macAddress: string; data: number[]; }\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ result: boolean; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### isEnabled()\n\n```typescript\nisEnabled() =\u003e Promise\u003c{ result: boolean; }\u003e\n```\n\nTrue if device has bluetooth enabled, false otherwise\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ result: boolean; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### enableAdapter()\n\n```typescript\nenableAdapter() =\u003e Promise\u003cvoid\u003e\n```\n\nPrompt the user to enable bluetooth.\nResolved if bluetooth is enabled, rejects otherwise.\n\n--------------------\n\n\n### disableAdapter()\n\n```typescript\ndisableAdapter() =\u003e Promise\u003cvoid\u003e\n```\n\nPrompt the user to enable bluetooth.\nResolved if bluetooth is enabled, rejects otherwise.\n\n--------------------\n\n\n### showBluetoothSettings()\n\n```typescript\nshowBluetoothSettings() =\u003e Promise\u003cvoid\u003e\n```\n\nOpen the bluetooth settings screen for the user.\n\n--------------------\n\n\n### startDiscovery(...)\n\n```typescript\nstartDiscovery(_options: {}, callback: DiscoveryCallback) =\u003e Promise\u003cvoid\u003e\n```\n\nStarts discovery process, sends info about found devices to the callback.\nScans for about 12 seconds.\n\n| Param          | Type                                                            |\n| -------------- | --------------------------------------------------------------- |\n| **`_options`** | \u003ccode\u003e{}\u003c/code\u003e                                                 |\n| **`callback`** | \u003ccode\u003e\u003ca href=\"#discoverycallback\"\u003eDiscoveryCallback\u003c/a\u003e\u003c/code\u003e |\n\n--------------------\n\n\n### cancelDiscovery()\n\n```typescript\ncancelDiscovery() =\u003e Promise\u003cvoid\u003e\n```\n\nStops any running discovery process.\n\n--------------------\n\n\n### setName(...)\n\n```typescript\nsetName(options: { name: string; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSets the name of the bluetooth adapter. Name is what paired devices will see when they connect.\n\n| Param         | Type                           |\n| ------------- | ------------------------------ |\n| **`options`** | \u003ccode\u003e{ name: string; }\u003c/code\u003e |\n\n--------------------\n\n\n### getName()\n\n```typescript\ngetName() =\u003e Promise\u003c{ result: string; }\u003e\n```\n\nGets the name of the bluetooth adapter.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ result: string; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### setDiscoverable(...)\n\n```typescript\nsetDiscoverable(options: { durationSec?: number; }) =\u003e Promise\u003cvoid\u003e\n```\n\nEnsure bluetooth is enabled and the device is discoverable to remote scanners.\nDefault durationSec is 120 is not provided. Max is 300 seconds.\n\n| Param         | Type                                   |\n| ------------- | -------------------------------------- |\n| **`options`** | \u003ccode\u003e{ durationSec?: number; }\u003c/code\u003e |\n\n--------------------\n\n\n### Interfaces\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | \u003ccode\u003e() =\u0026gt; Promise\u0026lt;void\u0026gt;\u003c/code\u003e |\n\n\n### Type Aliases\n\n\n#### EventCallback\n\n\u003ccode\u003e(info: any, err?: any): void\u003c/code\u003e\n\n\n#### BTDevice\n\n\u003ccode\u003e{name:string, macAddress:string, class:number}\u003c/code\u003e\n\n\n#### RawDataResult\n\n\u003ccode\u003e{bytes:number[], from:\u003ca href=\"#btdevice\"\u003eBTDevice\u003c/a\u003e}\u003c/code\u003e\n\n\n#### ListenCallback\n\n\u003ccode\u003e(device: \u003ca href=\"#btdevice\"\u003eBTDevice\u003c/a\u003e, err?: any): void\u003c/code\u003e\n\n\n#### DiscoveryCallback\n\n\u003ccode\u003e(device: \u003ca href=\"#btdevice\"\u003eBTDevice\u003c/a\u003e, err?: any): void\u003c/code\u003e\n\n\n### Enums\n\n\n#### PluginEvents\n\n| Members                | Value                           |\n| ---------------------- | ------------------------------- |\n| **`discovered`**       | \u003ccode\u003e\"discovered\"\u003c/code\u003e       |\n| **`discoveryState`**   | \u003ccode\u003e\"discoveryState\"\u003c/code\u003e   |\n| **`rawData`**          | \u003ccode\u003e\"rawData\"\u003c/code\u003e          |\n| **`connected`**        | \u003ccode\u003e\"connected\"\u003c/code\u003e        |\n| **`connectionFailed`** | \u003ccode\u003e\"connectionFailed\"\u003c/code\u003e |\n| **`connectionLost`**   | \u003ccode\u003e\"connectionLost\"\u003c/code\u003e   |\n\n\u003c/docgen-api\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechplexengineer%2Fbionic-bt-serial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechplexengineer%2Fbionic-bt-serial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechplexengineer%2Fbionic-bt-serial/lists"}