{"id":16403015,"url":"https://github.com/don/cordova-plugin-ble-peripheral","last_synced_at":"2025-03-21T02:33:20.032Z","repository":{"id":57207890,"uuid":"58242075","full_name":"don/cordova-plugin-ble-peripheral","owner":"don","description":"Apache Cordova plugin for implementing BLE (Bluetooth Low Energy) peripherals.","archived":false,"fork":false,"pushed_at":"2018-06-19T08:51:57.000Z","size":35,"stargazers_count":31,"open_issues_count":13,"forks_count":31,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T20:12:02.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/don.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-07T00:31:54.000Z","updated_at":"2024-09-11T13:46:45.000Z","dependencies_parsed_at":"2022-09-17T12:01:49.657Z","dependency_job_id":null,"html_url":"https://github.com/don/cordova-plugin-ble-peripheral","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/don%2Fcordova-plugin-ble-peripheral","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/don%2Fcordova-plugin-ble-peripheral/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/don%2Fcordova-plugin-ble-peripheral/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/don%2Fcordova-plugin-ble-peripheral/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/don","download_url":"https://codeload.github.com/don/cordova-plugin-ble-peripheral/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244725838,"owners_count":20499676,"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-10-11T05:47:58.075Z","updated_at":"2025-03-21T02:33:19.663Z","avatar_url":"https://github.com/don.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bluetooth Low Energy (BLE) Peripheral Plugin for Apache Cordova\n\nA Cordova plugin for implementing BLE (Bluetooth Low Energy) peripherals.\n\nNeed a BLE central module? See [cordova-plugin-ble-central](https://github.com/don/cordova-plugin-ble-central).\n\n## Supported Platforms\n\n* iOS\n* Android\n\n## Usage\n\n### Callbacks\n\nRegister callbacks to receive notifications from the plugin\n\n    blePeripheral.onWriteRequest(app.didReceiveWriteRequest);\n    blePeripheral.onBluetoothStateChange(app.onBluetoothStateChange);\n\n### Defining services with JSON\n\nDefine your Bluetooth Service using JSON\n\n    var uartService = {\n        uuid: SERVICE_UUID,\n        characteristics: [\n            {\n                uuid: TX_UUID,\n                properties: property.WRITE,\n                permissions: permission.WRITEABLE,\n                descriptors: [\n                    {\n                        uuid: '2901',\n                        value: 'Transmit'\n                    }\n                ]\n            },\n            {\n                uuid: RX_UUID,\n                properties: property.READ | property.NOTIFY,\n                permissions: permission.READABLE,\n                descriptors: [\n                    {\n                        uuid: '2901',\n                        value: 'Receive'\n                    }\n                ]\n            }\n        ]\n    };\n\nCreate the service and start advertising\n\n    Promise.all([\n        blePeripheral.createServiceFromJSON(uartService),\n        blePeripheral.startAdvertising(uartService.uuid, 'UART')\n    ]).then(\n        function() { console.log ('Created UART Service'); },\n        app.onError\n    );\n\n### Defining services programatically\n\nInstead of using JSON, you can create services programtically. Note that for 1.0 descriptors are only supported with the JSON format.\n\n    Promise.all([\n        blePeripheral.createService(SERVICE_UUID),\n        blePeripheral.addCharacteristic(SERVICE_UUID, TX_UUID, property.WRITE, permission.WRITEABLE),\n        blePeripheral.addCharacteristic(SERVICE_UUID, RX_UUID, property.READ | property.NOTIFY, permission.READABLE),\n        blePeripheral.publishService(SERVICE_UUID),\n        blePeripheral.startAdvertising(SERVICE_UUID, 'UART')\n    ]).then(\n        function() { console.log ('Created UART Service'); },\n        app.onError\n    );\n\n### Examples\n\nSee the [examples](https://github.com/don/cordova-plugin-ble-peripheral/tree/master/examples) for more ideas on how this plugin can be used.\n\n# Installing\n\n### Cordova\n\n    $ cordova plugin add cordova-plugin-ble-peripheral\n\n### PhoneGap\n\n    $ phonegap plugin add cordova-plugin-ble-peripheral\n\n### PhoneGap Build\n\nEdit config.xml to install the plugin for [PhoneGap Build](http://build.phonegap.com).\n\n    \u003cgap:plugin name=\"cordova-plugin-ble-peripheral\" source=\"npm\" /\u003e\n    \n# License\n\nApache 2.0\n\n# Feedback\n\nTry the code. If you find an problem or missing feature please create a github issue. When you're submitting an issue please include a sample project that recreates the problem.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdon%2Fcordova-plugin-ble-peripheral","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdon%2Fcordova-plugin-ble-peripheral","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdon%2Fcordova-plugin-ble-peripheral/lists"}