{"id":26296292,"url":"https://github.com/somq/ble-peripheral-faker","last_synced_at":"2025-08-25T07:06:04.541Z","repository":{"id":31182367,"uuid":"117443900","full_name":"somq/ble-peripheral-faker","owner":"somq","description":"📄 ➙ 🥸📡 Feed me with a JSON file and I will mock you a BLE peripheral with fake notifies and reponses to read in no time! ","archived":false,"fork":false,"pushed_at":"2023-03-04T02:31:58.000Z","size":3052,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T04:17:30.757Z","etag":null,"topics":["ble","javascript","mock","peripheral"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/somq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-14T15:51:10.000Z","updated_at":"2021-12-09T11:20:33.000Z","dependencies_parsed_at":"2023-01-14T18:30:08.885Z","dependency_job_id":null,"html_url":"https://github.com/somq/ble-peripheral-faker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/somq/ble-peripheral-faker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somq%2Fble-peripheral-faker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somq%2Fble-peripheral-faker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somq%2Fble-peripheral-faker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somq%2Fble-peripheral-faker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/somq","download_url":"https://codeload.github.com/somq/ble-peripheral-faker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somq%2Fble-peripheral-faker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265518475,"owners_count":23780967,"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":["ble","javascript","mock","peripheral"],"created_at":"2025-03-15T04:17:32.968Z","updated_at":"2025-07-16T14:34:32.748Z","avatar_url":"https://github.com/somq.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ble-peripheral-faker\n\n\u003e 📄 ➙ 🥸📡 Feed me with a JSON file and I will mock you a BLE peripheral with fake notifies and reponses to read in no time!\n\n## Table of Contents\n\n- [ble-peripheral-faker](#ble-peripheral-faker)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Install](#install)\n  - [Usage](#usage)\n  - [Todo](#todo)\n  - [License](#license)\n    - [MIT License](#mit-license)\n\n## Features\n\n**ble-peripheral-faker is build on top of [bleno](https://github.com/sandeepmistry/bleno)**.\n\n\u003e Simply build a JSON file respecting the [described format](#usage) and the module will care of mouting a gatt server as a ble peripheral with random values to read and notifies at random times from your JSON file.\n\n- Ble peripheral\n  - Custom services and characteristics from the JSON file\n  - Automatic random values to read and notified from an array in the JSON file\n  - Notifies are triggered by a random timer using a min and a max value set in the JSON file\n\n## Install\n\n```sh\ngit clone https://github.com/somq/ble-peripheral-faker.git\ncd ble-peripheral-faker\nnpm i\nnpm start -- example-peripheral.json\n```\n\nTroubleshoot\n\n\u003e Under the hood, this tool uses a [fork](https://github.com/abandonware/bleno) of [Bleno](https://github.com/noble/bleno)  \n\u003e In case of dependency build/start issue, please refer to the [Bleno docs](https://github.com/abandonware/bleno#bleno)  \n\u003e A good starting point is to install [core dependencies](https://github.com/abandonware/bleno#prerequisites) and rebuild dependencies with `npm rebuild`\n\n## Usage\n\nJSON file must respect the following format:\n\n```json\n{\n  \"name\": \"PheripheralName\",\n  \"advertising\": [\"0x01\", \"0x02\"],\n  \"advertisementData\": [3, 25, 0, 0, 2, 1, 5, 3, 3, 10, 24, 19, 9, 79, 67, 80, 67, 99, 54, 32, 35, 49, 57, 57, 57, 56, 56, 56, 48, 48, 48],\n  \"scanData\": [30, 255, 255, 255, 26, 255, 65, 25, 0, 76, 0, 0, 67, 0, 0, 83, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0],\n  \"services\":\n  [\n    {\n        \"uuid\": \"A7561523-258B-D820-E096-7C7C2190E980\",\n        \"characteristics\": [\n          {\n              \"uuid\": \"A7561524-258B-D820-E096-7C7C2190E980\",\n              \"properties\": [\n                \"read\",\n                \"notify\"\n              ],\n              \"characteristicName\": \"BOX_STATUS\",\n              \"notifyValues\": [\"0x19\", \"0x1E\", \"0x54\", \"0x26\", \"0x2B\", \"0x16\", \"0x47\", \"0x48\", \"0x1F\", \"0x20\", \"0x21\", \"0x6F\", \"0x0E\", \"0x2E\", \"0x30\", \"0x31\", \"0x32\", \"0x33\", \"0x34\", \"0x35\", \"0x36\", \"0xB1\", \"0xB3\", \"0xB5\", \"0x90\", \"0x91\", \"0x92\", \"0xFD\", \"0xFE\"],\n              \"notifyIntervalMax\": 15,\n              \"notifyIntervalMin\": 1\n              ...\n```\n\n| property                     | value description                                                                                                                                        |\n| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| name                         | the name you wish to give to your peripheral                                                                                                             |\n| advertising                  | classic advertising values                                                                                                                               |\n| advertisementData \u0026 scanData | EIR formated advertising data                                                                                                                            |\n| services                     | an array of objects each containing service data                                                                                                         |\n| uuid                         | uuid of your service                                                                                                                                     |\n| characteristics              | an array of objects each containing characteristic data                                                                                                  |\n| properties                   | an array of strings containing characteristics properties (refer to [bleno doc.](https://github.com/sandeepmistry/bleno#characteristic))                 |\n| characteristicName           | a string identifying a characteristic                                                                                                                    |\n| notifyValues                 | an array of strings containing hex-string. This is the values used to notify or respond to read on the characteristic                                    |\n| notifyIntervalMax            | a int used to set the max interval time \u003cbr\u003e _Notifies are triggered at a random time between one of the notifyIntervalMin and notifyIntervalMax values_ |\n| notifyIntervalMin            | a int used to set the min interval time \u003cbr\u003e _Notifies are triggered at a random time between one of the notifyIntervalMin and notifyIntervalMax values_ |\n\n## Todo\n\nImplement random automatic response on write when writeWithoutResponse is false.\n\n## License\n\n### MIT License\n\nCopyright (c) 2018 somq\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomq%2Fble-peripheral-faker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomq%2Fble-peripheral-faker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomq%2Fble-peripheral-faker/lists"}