{"id":50194381,"url":"https://github.com/himelbrand/react-native-ble-peripheral","last_synced_at":"2026-05-25T16:08:31.052Z","repository":{"id":49040469,"uuid":"112573334","full_name":"himelbrand/react-native-ble-peripheral","owner":"himelbrand","description":"a simulator for a BLE peripheral, to help with testing BLE apps without an actual peripheral BLE device","archived":false,"fork":false,"pushed_at":"2024-04-29T13:40:23.000Z","size":128,"stargazers_count":56,"open_issues_count":11,"forks_count":46,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-08T22:51:32.621Z","etag":null,"topics":["ble","iot","react-native","simulation"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/himelbrand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-30T06:23:30.000Z","updated_at":"2024-07-14T00:55:30.000Z","dependencies_parsed_at":"2022-09-08T15:12:09.357Z","dependency_job_id":null,"html_url":"https://github.com/himelbrand/react-native-ble-peripheral","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/himelbrand/react-native-ble-peripheral","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himelbrand%2Freact-native-ble-peripheral","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himelbrand%2Freact-native-ble-peripheral/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himelbrand%2Freact-native-ble-peripheral/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himelbrand%2Freact-native-ble-peripheral/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/himelbrand","download_url":"https://codeload.github.com/himelbrand/react-native-ble-peripheral/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himelbrand%2Freact-native-ble-peripheral/sbom","scorecard":{"id":464917,"data":{"date":"2025-08-11","repo":{"name":"github.com/himelbrand/react-native-ble-peripheral","commit":"a8e141b8618669839f82f98c0fffbaba91e8c33a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":5,"reason":"Found 5/10 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: android/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T12:13:43.292Z","repository_id":49040469,"created_at":"2025-08-19T12:13:43.292Z","updated_at":"2025-08-19T12:13:43.292Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33482546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ble","iot","react-native","simulation"],"created_at":"2026-05-25T16:08:27.537Z","updated_at":"2026-05-25T16:08:31.028Z","avatar_url":"https://github.com/himelbrand.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native BLE Peripheral\nNative BLE Peripheral in React Native\n## Welcome\n\nThis is a simulator for a BLE peripheral, to help with testing BLE apps without an actual peripheral BLE device\nthis project is not yet complete,\nfor all ready parts see documentation below.\n(docs are not complete, feel free to improve them)\n\n## Realease notes\n- fixed issues fixed on github repo in npm package - starting from version 1.2.0\n- **IOS support was added in version 2.0.0**\n- merged PR to fix write charicaristics - version 2.0.1\n    \n### Still missing\n\nif you would like to contribute to this project or suggest more future features you're welcome to so via an issue or pull request.\n\n### IOS support\nright now this package does not support IOS, so any one that wants to help and contribute the IOS support is more than welcome\n\n\n## Installation\n\n```bash\nnpm install react-native-ble-peripheral --save\nor \nyarn add react-native-ble-peripheral\n```\nnpm page - https://www.npmjs.com/package/react-native-ble-peripheral\n## Add permissions\n* In `AndroidManifest.xml` add:\n```xml\n\n \u003cuses-permission android:name=\"android.permission.BLUETOOTH\"/\u003e\n \u003cuses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/\u003e\n```\n## Project setup and initialization auto\n```bash\nreact-native link\n```\n## Project setup and initialization manually \n\n* In `android/settings.gradle`\n\n```gradle\n...\ninclude ':react-native-ble-peripheral'\nproject(':react-native-ble-peripheral').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ble-peripheral/android')\n\n```\n\n* In `android/app/build.gradle`\n\n```gradle\n...\ndependencies {\n    /* YOUR DEPENDENCIES HERE */\n   compile project(':react-native-ble-peripheral') // \u003c--- add this\n}\n\n```\n\n* Register Module (in MainApplication.java)\n\n```java\nimport com.himelbrand.forwardcalls.RNForwardCallsPackage;  // \u003c--- import\n\npublic class MainActivity extends ReactActivity {\n  ......\n\n  @Override\n  protected List\u003cReactPackage\u003e getPackages() {\n      return Arrays.\u003cReactPackage\u003easList(\n          new MainReactPackage(),\n          new RNBLEPackage() // \u003c--- Add this\n      );\n  }\n\n  ......\n\n}\n```\n\n\n## Usage\n\n#### Import\n\n```javascript\nimport BLEPeripheral from 'react-native-ble-peripheral'\n```\n\n#### Add Service \nBLEPeripheral.addService(UUID:string, primary:boolean)\n```javascript\nBLEPeripheral.addService('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', true) //for primary service\nBLEPeripheral.addService('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', false) //for non primary service\n```\n#### Add Characteristic\nBLEPeripheral.addCharacteristicToService(ServiceUUID:string, UUID:string, permissions:number, properties:number)\n\nhttps://developer.android.com/reference/android/bluetooth/BluetoothGattCharacteristic.html\nthe link above is for permissions and properties constants info\n\nPermissions:\n* 1 - Readable\n* 2 - Readable Encrypted\n* 4 - Readable Encrypted MITM (Man-in-the-middle) Protection \n* 16 - Writable\n* 32 - Writable Encrypted\n* 64 - Writable Encrypted MITM Protection\n* 128 - Writable Signed\n* 256 - Writable Signed MITM\n\nProperties:\n* 1 - Broadcastable\n* 2 - Readable\n* 4 - Writable without response\n* 8 - Writable\n* 16 - Supports notification\n* 32 - Supports indication\n* 64 - Signed Write\n* 128 - Extended properties\n\n```javascript\nBLEPeripheral.addCharacteristicToService('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 16 | 1, 8) //this is a Characteristic with read and write permissions and notify property\n```\n#### Notify to devices\nBLEPeripheral.sendNotificationToDevices(ServiceUUID:string, CharacteristicUUID:string, data:byte[]) \n- note #1: in js it's not really a byte array, but an array of numbers\n- note #2: the CharacteristicUUID must be of a Characteristic with notify property\n```javascript\nBLEPeripheral.sendNotificationToDevices('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', [0x10,0x01,0xA1,0x80]) //sends a notification to all connected devices that, using the char uuid given\n```\n\n#### start Advertising \nnote:use this only after adding services and characteristics\n```javascript\n BLEPeripheral.start()\n  .then(res =\u003e {\n       console.log(res)\n  }).catch(error =\u003e {\n       console.log(error)\n  })\n```\n\nIn case of error, these are the error codes:\n* 1 - Failed to start advertising as the advertise data to be broadcasted is larger than 31 bytes.\n* 2 - Failed to start advertising because no advertising instance is available.\n* 3 - Failed to start advertising as the advertising is already started.\n* 4 - Operation failed due to an internal error.\n* 5 - This feature is not supported on this platform.\n\n\n#### stop Advertising \n```javascript\n BLEPeripheral.stop()\n```\n\n#### Set name (optional)\nBLEPeripheral.setName(name:string)\n\nThis method sets the name of the device broadcast, before calling `start`.\n```javascript\nBLEPeripheral.setName('RNBLETEST')\n```\n\nDOCs and project is under development \nAny help would be welcome...\nfeel free to contact me\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimelbrand%2Freact-native-ble-peripheral","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhimelbrand%2Freact-native-ble-peripheral","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimelbrand%2Freact-native-ble-peripheral/lists"}