{"_id":"@badsaarow/capacitor-bluetooth-serial","_rev":"3-122ebcdfbd033e6027d0a71e94291fc6","name":"@badsaarow/capacitor-bluetooth-serial","description":"Capacitor Bluetooth Serial Plugin","dist-tags":{"latest":"0.7.2"},"versions":{"0.6.3":{"name":"@badsaarow/capacitor-bluetooth-serial","version":"0.6.3","keywords":["capacitor","plugin","native"],"author":{"name":"Sungyong"},"license":"MIT","_id":"@badsaarow/capacitor-bluetooth-serial@0.6.3","maintainers":[{"name":"badsaarow","email":"sungyong@gmail.com"}],"homepage":"https://github.com/badsaarow/capacitor-bluetooth-serial#readme","bugs":{"url":"https://github.com/badsaarow/capacitor-bluetooth-serial/issues"},"dist":{"shasum":"ee508407e3e5bfa82f529cbdfb99441b3e2448df","tarball":"https://registry.npmjs.org/@badsaarow/capacitor-bluetooth-serial/-/capacitor-bluetooth-serial-0.6.3.tgz","fileCount":34,"integrity":"sha512-TZAPkcGBhmJYdl+Vo5xuuQ74MJABR8K2jt7j/0IxlhBo0IQhhsbiyc0RCi6gfgDoouI32jQ/Rma6EFL1UaEZvQ==","signatures":[{"sig":"MEUCIQCWOIyO/8477jjmWSgNq49H/JGXk0yrLxPHLsijvXo7QQIgY0O4u4g3equhK64uFWITnbL1zp8cvcpcFI1RPXP9Wvo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":102132},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"fe66338bea5e9857b25d151e7722fe9719c42a0f","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.js","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api BluetoothSerialPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","publish:cocoapod":"pod trunk push ./CapacitorBluetoothSerial.podspec --allow-warnings"},"_npmUser":{"name":"badsaarow","email":"sungyong@gmail.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/badsaarow/capacitor-bluetooth-serial.git","type":"git"},"_npmVersion":"10.5.0","description":"Capacitor Bluetooth Serial Plugin","directories":{},"_nodeVersion":"20.12.2","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^7.11.0","rimraf":"^3.0.2","rollup":"^2.29.0","prettier":"~2.3.0","swiftlint":"^1.0.1","typescript":"~4.8.4","@capacitor/ios":"^4.8.1","@capacitor/core":"^4.8.1","@capacitor/docgen":"^0.2.1","@capacitor/android":"^4.8.1","@ionic/eslint-config":"^0.3.0","prettier-plugin-java":"~1.0.2","@ionic/prettier-config":"^1.0.1","@ionic/swiftlint-config":"^1.1.2"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-bluetooth-serial_0.6.3_1717742680636_0.3757147355209405","host":"s3://npm-registry-packages"}},"0.7.0":{"name":"@badsaarow/capacitor-bluetooth-serial","version":"0.7.0","keywords":["capacitor","plugin","native"],"author":{"name":"Sungyong"},"license":"MIT","_id":"@badsaarow/capacitor-bluetooth-serial@0.7.0","maintainers":[{"name":"badsaarow","email":"sungyong@gmail.com"}],"homepage":"https://github.com/badsaarow/capacitor-bluetooth-serial#readme","bugs":{"url":"https://github.com/badsaarow/capacitor-bluetooth-serial/issues"},"dist":{"shasum":"86e1f43c6bfe6fa9eff20ccc7047bfc7d7e89850","tarball":"https://registry.npmjs.org/@badsaarow/capacitor-bluetooth-serial/-/capacitor-bluetooth-serial-0.7.0.tgz","fileCount":34,"integrity":"sha512-offwB2qxumcM5FrEUMjyZQ7mQxmq6cmNdih0w7wtd//U0Xhr2K5lZxkjHbkVCSdv2+fUKup1YgdFqybwZ5ey7Q==","signatures":[{"sig":"MEYCIQDT7EqvQJv3gRuNH+wj6Y1su4sa/gKQ1iOqqIfKMBSWMwIhAIKTYd3WS2EfstCJ5Yd0Lw++cEwN7kCk4vgBL2ycqDg/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106552},"main":"dist/plugin.cjs.js","type":"module","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"6eeb6e802a0a12c6427cef1414537677e27f8dc1","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write","lint":"npm run eslint && npm run prettier -- --check","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api BluetoothSerialPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint --config eslint.config.cjs .","verify":"npm run verify:android:win && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,mjs}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","publish:cocoapod":"pod trunk push ./CapacitorBluetoothSerial.podspec --allow-warnings","verify:android:win":"cd android && ./gradlew.bat clean build test && cd .."},"_npmUser":{"name":"badsaarow","email":"sungyong@gmail.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/badsaarow/capacitor-bluetooth-serial.git","type":"git"},"_npmVersion":"10.5.0","description":"Capacitor Bluetooth Serial Plugin","directories":{},"_nodeVersion":"20.12.2","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.4.0","rimraf":"^5.0.7","rollup":"^4.18.0","prettier":"^3.3.1","swiftlint":"^1.0.2","typescript":"^5.4.5","@capacitor/ios":"^6.0.0","@capacitor/core":"^6.0.0","@capacitor/docgen":"^0.2.2","@capacitor/android":"^6.0.0","@ionic/eslint-config":"^0.4.0","prettier-plugin-java":"^2.6.0","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^1.1.2","@typescript-eslint/parser":"^7.12.0","@typescript-eslint/eslint-plugin":"^7.12.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-bluetooth-serial_0.7.0_1718007675036_0.9686273043058682","host":"s3://npm-registry-packages"}},"0.7.1":{"name":"@badsaarow/capacitor-bluetooth-serial","version":"0.7.1","keywords":["capacitor","plugin","native"],"author":{"name":"Sungyong"},"license":"MIT","_id":"@badsaarow/capacitor-bluetooth-serial@0.7.1","maintainers":[{"name":"badsaarow","email":"sungyong@gmail.com"}],"homepage":"https://github.com/badsaarow/capacitor-bluetooth-serial#readme","bugs":{"url":"https://github.com/badsaarow/capacitor-bluetooth-serial/issues"},"dist":{"shasum":"d1e6ae9bf9f4df1eac87097588a12f855e362f18","tarball":"https://registry.npmjs.org/@badsaarow/capacitor-bluetooth-serial/-/capacitor-bluetooth-serial-0.7.1.tgz","fileCount":34,"integrity":"sha512-c+Pk08/GUJ/rdKggk/ccL4scrxIBF1iKH1rZcAWVxOuNy/TOv9WTLIM1LAdZS52YfW4vadGZIFuGI/mLlkN4mA==","signatures":[{"sig":"MEUCIFkQoycKkvFFeucPLxKV0zu+WjWoKg0cjrgZuY3Azf/lAiEAnVvLNpBJ/S/BBrNacdRnNpIjgHNLooPsgVUZ9JY96QI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103570},"main":"dist/plugin.cjs.js","type":"module","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"0e8b458272f4203695172f28a6d9b4bae9c72098","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write","lint":"npm run eslint && npm run prettier -- --check","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api BluetoothSerialPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint --config eslint.config.cjs .","verify":"npm run verify:android:win && npm run verify:web","prettier":"prettier \"**/*.{css,html,ts,js,mjs}\"","swiftlint":"node-swiftlint","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd ..","publish:cocoapod":"pod trunk push ./CapacitorBluetoothSerial.podspec --allow-warnings","verify:android:win":"cd android && ./gradlew.bat clean build test && cd .."},"_npmUser":{"name":"badsaarow","email":"sungyong@gmail.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/badsaarow/capacitor-bluetooth-serial.git","type":"git"},"_npmVersion":"10.5.0","description":"Capacitor Bluetooth Serial Plugin","directories":{},"_nodeVersion":"20.12.2","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.4.0","rimraf":"^5.0.7","rollup":"^4.18.0","prettier":"^3.3.1","swiftlint":"^1.0.2","typescript":"^5.4.5","@capacitor/ios":"^6.0.0","@capacitor/core":"^6.0.0","@capacitor/docgen":"^0.2.2","@capacitor/android":"^6.0.0","@ionic/eslint-config":"^0.4.0","prettier-plugin-java":"^2.6.0","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^1.1.2","@typescript-eslint/parser":"^7.12.0","@typescript-eslint/eslint-plugin":"^7.12.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-bluetooth-serial_0.7.1_1718067975989_0.546413831345425","host":"s3://npm-registry-packages"}},"0.7.2":{"name":"@badsaarow/capacitor-bluetooth-serial","version":"0.7.2","description":"Capacitor Bluetooth Serial Plugin","type":"module","main":"dist/plugin.cjs.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","scripts":{"verify":"npm run verify:android:win && npm run verify:web","verify:ios":"cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..","verify:android":"cd android && ./gradlew clean build test && cd ..","verify:android:win":"cd android && ./gradlew.bat clean build test && cd ..","verify:web":"npm run build","lint":"npm run eslint && npm run prettier -- --check","fmt":"npm run eslint -- --fix && npm run prettier -- --write","eslint":"eslint --config eslint.config.cjs .","prettier":"prettier \"**/*.{css,html,ts,js,mjs}\"","swiftlint":"node-swiftlint","docgen":"docgen --api BluetoothSerialPlugin --output-readme README.md --output-json dist/docs.json","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","prepublishOnly":"npm run build","publish:cocoapod":"pod trunk push ./CapacitorBluetoothSerial.podspec --allow-warnings"},"author":{"name":"Sungyong"},"license":"MIT","devDependencies":{"@capacitor/android":"^6.0.0","@capacitor/core":"^6.0.0","@capacitor/docgen":"^0.2.2","@capacitor/ios":"^6.0.0","@ionic/eslint-config":"^0.4.0","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^1.1.2","@typescript-eslint/eslint-plugin":"^7.12.0","@typescript-eslint/parser":"^7.12.0","eslint":"^9.4.0","prettier":"^3.3.1","prettier-plugin-java":"^2.6.0","rimraf":"^5.0.7","rollup":"^4.18.0","swiftlint":"^1.0.2","typescript":"^5.4.5"},"prettier":"@ionic/prettier-config","swiftlint":"@ionic/swiftlint-config","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"publishConfig":{"access":"public"},"keywords":["capacitor","plugin","native"],"repository":{"type":"git","url":"git+https://github.com/badsaarow/capacitor-bluetooth-serial.git"},"bugs":{"url":"https://github.com/badsaarow/capacitor-bluetooth-serial/issues"},"_id":"@badsaarow/capacitor-bluetooth-serial@0.7.2","gitHead":"8bb92436737c1a5d79a7a4d5851de7a6e789f435","homepage":"https://github.com/badsaarow/capacitor-bluetooth-serial#readme","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-Zdsq4URvXvtZBDGan2OkYScbf4oa/QmqUG14kz7oXkc6iEGqcWs/zkZGNY1XwWwA/9w/a1xy98UjA+bNoCpYEg==","shasum":"65c756c111b92a03dbb442346d27ec986545b970","tarball":"https://registry.npmjs.org/@badsaarow/capacitor-bluetooth-serial/-/capacitor-bluetooth-serial-0.7.2.tgz","fileCount":34,"unpackedSize":104257,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+Lf8hJb3VmFGGzmji9yVvWDJ+cgFqXRctIG6QlxFMuAIgTqYPAkzqbDxS9vCQA47T+Ljuyw8yoXRFFwoXcuBVjak="}]},"_npmUser":{"name":"badsaarow","email":"sungyong@gmail.com"},"directories":{},"maintainers":[{"name":"badsaarow","email":"sungyong@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/capacitor-bluetooth-serial_0.7.2_1718331108806_0.35257467465298786"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-07T06:44:40.507Z","modified":"2024-06-14T02:11:49.192Z","0.6.3":"2024-06-07T06:44:40.863Z","0.7.0":"2024-06-10T08:21:15.156Z","0.7.1":"2024-06-11T01:06:16.151Z","0.7.2":"2024-06-14T02:11:49.025Z"},"maintainers":[{"name":"badsaarow","email":"sungyong@gmail.com"}],"author":{"name":"Sungyong"},"repository":{"type":"git","url":"git+https://github.com/badsaarow/capacitor-bluetooth-serial.git"},"keywords":["capacitor","plugin","native"],"license":"MIT","homepage":"https://github.com/badsaarow/capacitor-bluetooth-serial#readme","bugs":{"url":"https://github.com/badsaarow/capacitor-bluetooth-serial/issues"},"readme":"# Capacitor Bluetooth Serial Plugin\r\n\r\nForked from [capacitor-bluetooth-serial](https://github.com/agro1desenvolvimento/capacitor-bluetooth-serial) (archived)\r\n\r\nA client implementation for interacting with Bluetooth (serial), using Capacitor.\r\n\r\nSupported platforms\r\n\r\n- [ ] Web\r\n- [x] Android\r\n- [ ] iOS\r\n\r\n\r\n## Usage\r\n\r\nInstall the plugin via npm\r\n```\r\nnpm install --save @badsaarow/capacitor-bluetooth-serial\r\n```\r\n\r\n\r\n```typescript\r\nimport {BluetoothSerial} from \"@badsaarow/capacitor-bluetooth-serial\";\r\n\r\n//...do something with plugin\r\n\r\n```\r\n\r\n## API Documentation\r\n\r\nInterface and type definitions can be found [here](./src/definitions.ts).\r\n\r\n# API\r\n\r\n## Methods\r\n\r\n- [BluetoothSerial.isEnabled](#isEnabled)\r\n- [BluetoothSerial.enable](#enable)\r\n- [BluetoothSerial.disable](#disable)\r\n- [BluetoothSerial.startEnabledNotifications](#startEnabledNotifications)\r\n- [BluetoothSerial.stopEnabledNotifications](#stopEnabledNotifications)\r\n- [BluetoothSerial.scan](#scan)\r\n- [BluetoothSerial.connect](#connect)\r\n- [BluetoothSerial.connectInsecure](#connectInsecure)\r\n- [BluetoothSerial.disconnect](#disconnect)\r\n- [BluetoothSerial.isConnected](#isConnected)\r\n- [BluetoothSerial.startNotifications](#startNotifications)\r\n- [BluetoothSerial.stopNotifications](#stopNotifications)\r\n- [BluetoothSerial.write](#write)\r\n\r\n## isEnabled\r\n\r\nReports if bluetooth is enabled.\r\n\r\n  `isEnabled(): Promise<BluetoothState>;`\r\n\r\n### Description\r\n\r\nFunction `isEnabled` calls the success whatever bluetooth is enabled or not. The promise will contain an attribute `enabled` indicating if bluetooth is enabled or *not* enabled. The failure callback will be called only if an error occurs.\r\n\r\nIf you want to enable bluetooth afterwards, you can use #enable directly, once #enable also check if the bluetooth is conected or not.\r\n\r\n### Parameters\r\n\r\nNone.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .isEnabled()\r\n  .then((response: BluetoothState) => {\r\n    const status = response.enabled ? 'enabled' : 'disabled';\r\n    console.log(`Bluetooth is ${status}`);\r\n  })\r\n  .catch(() => {\r\n    console.log('Error checking bluetooth status');\r\n  });\r\n```\r\n\r\n## enable\r\n\r\n  Enable bluetooth if it is not enabled. Also request permissions for bluetooth access if it is necessary.\r\n\r\n  `enable(): Promise<BluetoothState>;`\r\n\r\n### Description\r\n\r\nFunction `enable` calls the success whatever bluetooth is successfully enabled or not. The promise will contain an attribute `enabled` indicating if bluetooth is enabled or *not* enabled after the process. The failure callback will be called only if an error occurs.\r\n\r\nIf the app does not have permission to use bluetooth, it will request it.\r\n\r\n### Parameters\r\n\r\nNone.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .enable()\r\n  .then((response: BluetoothState) => {\r\n    const status = response.enabled ? 'enabled' : 'disabled';\r\n    console.log(`Bluetooth is ${status}`);\r\n  })\r\n  .catch(() => {\r\n    console.log('Error enabling bluetooth');\r\n  });\r\n```\r\n\r\n\r\n## disable\r\n\r\nDisable bluetooth if enabled. Also request permissions for bluetooth access if it is necessary.\r\n\r\n`disable(): Promise<BluetoothState>;`\r\n\r\n### Description\r\n\r\nFunction `disable` calls the success whatever bluetooth is successfully disabled or not. \r\nThe promise will contain an attribute `enabled` indicating if bluetooth is enabled or *not* enabled after the process.\r\nThe failure callback will be called only if an error occurs.\r\n\r\nIf the app does not have permission to use bluetooth, it will request it.\r\n\r\n### Parameters\r\n\r\nNone.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .disable()\r\n  .then((response: BluetoothState) => {\r\n    const status = response.enabled ? 'enabled' : 'disabled';\r\n    console.log(`Bluetooth is ${status}`);\r\n  })\r\n  .catch(() => {\r\n    console.log('Error disabling bluetooth');\r\n  });\r\n```\r\n\r\n\r\n## startEnabledNotifications\r\n\r\nBe notified when bluetooth status changed.\r\n\r\n`startEnabledNotifications(): Promise<void>`;\r\n\r\n### Description\r\n\r\nFunction `startEnabledNotifications` enable status notifications. In order to retrieve the values, use an Event Listener with 'onEnabledChanged' as event name.\r\n\r\n``` typescript\r\nconst eventListener = BluetoothSerial.addListener('onEnabledChanged' , (response: BluetoothState) => {\r\n\r\n    const { enabled } = response;\r\n    //Do something with enabled variable\r\n});\r\n```\r\n\r\n### Parameters\r\n\r\nNone.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .startEnabledNotifications()\r\n  .then(() => {\r\n      eventListener = BluetoothSerial.addListener('onEnabledChanged', (data: BluetoothState) => {\r\n        console.log('Bluetooth state changed to ' + (data.enabled ? 'Enabled' : 'Disabled'));\r\n      });\r\n  })\r\n  .catch(() => {\r\n    console.log('Error starting enabled listener');\r\n  });\r\n```\r\n\r\n\r\n## stopEnabledNotifications\r\n\r\nStops the propagation of value changes.\r\n\r\n`stopEnabledNotifications(): Promise<void>`;\r\n\r\n### Description\r\n\r\nFunction `stopEnabledNotifications` disable bluetooth state notifications. Additionally, the event listener has to be removed.\r\n\r\n```typescript\r\neventListener.remove();\r\n```\r\n\r\n### Parameters\r\n\r\nNone.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .stopEnabledNotifications()\r\n  .then(() => {\r\n      eventListener.remove();\r\n  })\r\n  .catch(() => {\r\n    console.log('Error disabling listener for device');\r\n  });\r\n```\r\n\r\n\r\n## scan\r\n\r\nDiscover devices visible and close to the device\r\n\r\n  `scan(): Promise<BluetoothScanResult>;`\r\n\r\n### Description\r\n\r\n#### Android\r\n\r\nFunction `scan` discovers Bluetooth devices close to the device and visible. The success callback is called with a list of objects similar to `list`, or an empty list if no devices are found.\r\n\r\nExample list passed to success callback.\r\n\r\n```json\r\n[{\r\n    \"class\": 0,\r\n    \"id\": \"00:11:22:33:44:55\",\r\n    \"address\": \"00:11:22:33:44:55\",\r\n    \"name\": \"Device 1\"\r\n}, {\r\n    \"class\": 7936,\r\n    \"id\": \"01:23:6645:4D67:89:00\",\r\n    \"address\": \"01:23:6645:4D67:89:00\",\r\n    \"name\": \"Device 2\"\r\n}]\r\n```\r\n\r\nThe discovery process takes a while to happen.\r\nYou may want to show a progress indicator while waiting for the discover proces to finish, and the sucess callback to be invoked.\r\n\r\nCalling `connect` on an unpaired Bluetooth device should begin the Android pairing process.\r\n\r\n### Parameters\r\n\r\nNone.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .scan()\r\n  .then((result: BluetoothScanResult) => {\r\n    result.devices.forEach((device: BluetoothDevice) {\r\n        console.log(device.id);\r\n    });\r\n  })\r\n  .catch(() => {\r\n    console.log('Error scanning devices');\r\n  });\r\n```\r\n\r\n## connect\r\n\r\nConnect to a Bluetooth device.\r\n\r\n  `connect(options: BluetoothConnectOptions): Promise<void>`;\r\n\r\n### Description\r\n\r\nFunction `connect` connects to a Bluetooth device.  The callback Success will be called when the connection is successful.  Failure is called if the connection fails.\r\n\r\n#### Android\r\nFor Android, `connect` takes a MAC address of the remote device.\r\n\r\n### Parameters\r\n\r\n- { __address__ }: Identifier of the remote device.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .connect({\r\n    address: '00:11:22:33:44:55',\r\n  })\r\n  .then(() => {\r\n    console.log('Successfully connected')\r\n  })\r\n  .catch(() => {\r\n    console.log('Error connecting...');\r\n  });\r\n```\r\n\r\n## connectInsecure\r\n\r\nConnect insecurely to a Bluetooth device.\r\n\r\n  `connectInsecure(options: BluetoothConnectOptions): Promise<void>`;\r\n\r\n### Description\r\n\r\nFunction `connectInsecure` connects to a Bluetooth device.  The callback Success will be called when the connection is successful.  Failure is called if the connection fails.\r\nFunction `connectInsecure` works like [BluetoothSerial.connect](#connect), but creates an insecure connection to a Bluetooth device. See the [Android docs](https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#createInsecureRfcommSocketToServiceRecord(java.util.UUID)) for more information.\r\n\r\n#### Android\r\nFor Android, `connectInsecure` takes a MAC address of the remote device.\r\n\r\n### Parameters\r\n\r\n- { __address__ }: Identifier of the remote device.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .connectInsecure({\r\n    address: '00:11:22:33:44:55',\r\n  })\r\n  .then(() => {\r\n    console.log('Successfully connected')\r\n  })\r\n  .catch(() => {\r\n    console.log('Error connecting...');\r\n  });\r\n```\r\n\r\n## disconnect\r\n\r\nDisconnect a Bluetooth device.\r\n\r\n  `disconnect(options: BluetoothConnectOptions): Promise<void>`;\r\n\r\n### Description\r\n\r\nFunction `disconnect` disconnects a Bluetooth device.  The callback Success will be called when the disconnection is successful.  Failure is called if the disconnection fails.\r\n\r\n#### Android\r\nFor Android, `disconnect` takes a MAC address of the remote device.\r\n\r\n**Warning**: If no address is passed, all devices will be disconnected.\r\n\r\n### Parameters\r\n\r\n- { __address__ }: Identifier of the remote device.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .disconnect({\r\n    address: '00:11:22:33:44:55',\r\n  })\r\n  .then(() => {\r\n    console.log('Successfully disconnected')\r\n  })\r\n  .catch(() => {\r\n    console.log('Error disconnecting...');\r\n  });\r\n```\r\n\r\n## isConnected\r\n\r\nReports the connection status.\r\n\r\n  `isConnected(options: BluetoothConnectOptions): Promise<BluetoothConnectResult>`;\r\n\r\n### Description\r\n\r\nFunction `isConnected` calls the success callback with the connection status (connected or not connected). Failure will be called only if an error occurs.\r\n\r\n#### Android\r\nFor Android, `isConnected` takes a MAC address of the remote device.\r\n\r\n### Parameters\r\n\r\n- { __address__ }: Identifier of the remote device.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .isConnected({\r\n    address: '00:11:22:33:44:55',\r\n  })\r\n  .then((result: BluetoothConnectResult) => {\r\n    const status = result.connected ? 'connected' : 'disconnected';\r\n    console.log(`Device is ${status}`);\r\n  })\r\n  .catch(() => {\r\n    console.log('Error checking connection status');\r\n  });\r\n```\r\n\r\n## startNotifications\r\n\r\nEnable and be notified when any data is received.\r\n\r\n  `startNotifications(options: BluetoothEnableNotificationsOptions): Promise<void>`;\r\n\r\n### Description\r\n\r\nFunction `startNotifications` enable notifications. In order to retrieve the values, use an Event Listener with 'onRead' as event name.\r\n\r\n``` typescript\r\nconst eventListener = BluetoothSerial.addListener('onRead' , (response: BluetoothReadResult) => {\r\n\r\n    const { value } = response;\r\n    //Do something with the value\r\n});\r\n```\r\n\r\n### Parameters\r\n\r\n- { __address__ }: Identifier of the remote device.\r\n- { __delimiter__ }: Delimiter for notification.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .startNotifications({\r\n    address: '00:11:22:33:44:55',\r\n    delimiter: '\\n',\r\n  })\r\n  .then((result: BluetoothEnableNotificationsResult) => {\r\n      eventListener = BluetoothSerial.addListener('onRead', (data: BluetoothReadResult) => {\r\n      console.log(\"Received value: \" + data.value);\r\n    });\r\n  })\r\n  .catch(() => {\r\n    console.log('Error enabling listener for device');\r\n  });\r\n```\r\n\r\n## stopNotifications\r\n\r\nStops the propagation of value changes.\r\n\r\n  `stopNotifications(options: BluetoothDisableNotificationsOptions): Promise<void>`;\r\n\r\n### Description\r\n\r\nFunction `stopNotifications` disable notifications. Additionally, the event listener has to be removed.\r\n\r\n```typescript\r\neventListener.remove();\r\n```\r\n\r\n### Parameters\r\n\r\n- { __address__ }: Identifier of the remote device.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .stopNotifications({\r\n    address: '00:11:22:33:44:55',\r\n  })\r\n  .then(() => {\r\n    eventListener.remove();\r\n  })\r\n  .catch(() => {\r\n    console.log('Error disabling listener for device');\r\n  });\r\n```\r\n\r\n## write\r\n\r\nWrite data to the buffer.\r\n\r\n  `write(options: BluetoothWriteOptions): Promise<void>`;\r\n\r\n### Description\r\n\r\nFunction `write` writes data to the buffer.\r\n\r\n### Parameters\r\n\r\n- { __address__ }: Identifier of the remote device.\r\n- { __value__ }: String to send.\r\n\r\n### Quick Example\r\n\r\n```typescript\r\nBluetoothSerial\r\n  .write({\r\n    address: '00:11:22:33:44:55',\r\n    value: 'Hello world',\r\n  })\r\n  .then(() => {\r\n    console.log('Value sent to device');\r\n  })\r\n  .catch(() => {\r\n    console.log('Error writing data to device');\r\n  });\r\n```\r\n","readmeFilename":"README.md"}