{"id":13536824,"url":"https://github.com/Reedyuk/blue-falcon","last_synced_at":"2025-04-02T03:31:11.670Z","repository":{"id":35531054,"uuid":"202539590","full_name":"Reedyuk/blue-falcon","owner":"Reedyuk","description":"A Bluetooth kotlin multiplatform \"Cross-Platform\" library for iOS and Android","archived":false,"fork":false,"pushed_at":"2025-03-23T18:04:10.000Z","size":1294,"stargazers_count":381,"open_issues_count":8,"forks_count":46,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T22:15:52.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bluefalcon.dev","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Reedyuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["Reedyuk"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2019-08-15T12:45:24.000Z","updated_at":"2025-03-21T02:46:29.000Z","dependencies_parsed_at":"2024-02-18T08:33:12.006Z","dependency_job_id":"961b02ea-fb1f-46d5-8392-61f4b51b6db7","html_url":"https://github.com/Reedyuk/blue-falcon","commit_stats":{"total_commits":287,"total_committers":24,"mean_commits":"11.958333333333334","dds":0.181184668989547,"last_synced_commit":"f154a1f76f0c06e89eb1caafa4bbd38408398e88"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reedyuk%2Fblue-falcon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reedyuk%2Fblue-falcon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reedyuk%2Fblue-falcon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reedyuk%2Fblue-falcon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Reedyuk","download_url":"https://codeload.github.com/Reedyuk/blue-falcon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246547372,"owners_count":20794971,"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-08-01T09:00:50.058Z","updated_at":"2025-04-02T03:31:11.664Z","avatar_url":"https://github.com/Reedyuk.png","language":"Kotlin","funding_links":["https://github.com/sponsors/Reedyuk"],"categories":["Hardware","Libraries","KMM"],"sub_categories":["Bluetooth","📱 Device"],"readme":"# ![Blue Falcon](bluefalcon.png) Blue-Falcon ![CI](https://github.com/Reedyuk/blue-falcon/actions/workflows/release.yml/badge.svg) [![Kotlin](https://img.shields.io/badge/kotlin-2.0.0-blue.svg)](http://kotlinlang.org) ![badge][badge-android] ![badge][badge-native] ![badge][badge-mac] ![badge][badge-rpi] ![badge][badge-js] \u003ca href=\"https://git.live\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fteamhub-dev.web.app%2Fbadge%3Forg%3DReedyuk%26repo%3Dblue-falcon\"\u003e\u003c/a\u003e\n\nA Bluetooth BLE \"Cross Platform\" Kotlin Multiplatform library for iOS, Android, MacOS, Raspberry Pi and Javascript.\n\nBLE in general has the same functionality for all platforms, e.g. connect to device, fetch services, fetch characteristics.\n\nThis library is the glue that brings those together so that mobile developers can use one common api to perform the BLE actions.\n\nThe idea is to have a common api for BLE devices as the principle of BLE is the same but each platform ios and android has different apis which means you have to duplicate the logic for each platform.\n\nWhat this library isn't? It is not a cross platform library, this is a multiplatform library. The difference? each platform is compiled down to the native code, so when you use the library in iOS, you are consuming an obj-c library and same principle for Android and so on.\n\n## Basic Usage\n\nInclude the library in your own KMP project as a dependency on your common target.\n\n```\ncommonMain.dependencies {\n    implementation(\"dev.bluefalcon:blue-falcon:2.0.0\")\n}\n```\n\nOnce you have included it then you will need to create an instance of BlueFalcon and pass in an application context.\n\nThe Android sdk requires an Application context, we do this by passing in on the BlueFalcon constructor, in this example we are calling the code from an activity(this).\n\nBy passing in a string uuid of the service uuid, you can filter to scan for only devices that have that service.\n\n```kotlin\ntry {\n    val blueFalcon = BlueFalcon(log = null, ApplicationContext())\n    blueFalcon.scan()\n} catch (exception: PermissionException) {\n    //request the ACCESS_COARSE_LOCATION permission\n}\n```\n\n### Javascript \n\n#### Install\n\nSimply copy the compiled javascript file (blue-falcon.js) to your web directory.\n\nSee the JS-Example for details on how to use.\n\n### BlueFalcon API\n\nThe basic functionality of the api is listed below, this should be a simplistic as possible and is the same in any platform.\n\n```kotlin\n    fun connect(bluetoothPeripheral: BluetoothPeripheral, autoConnect: Boolean)\n    fun disconnect(bluetoothPeripheral: BluetoothPeripheral)\n    fun scan()\n    fun stopScanning()\n    fun readCharacteristic(\n        bluetoothPeripheral: BluetoothPeripheral,\n        bluetoothCharacteristic: BluetoothCharacteristic\n    )\n    fun notifyCharacteristic(\n        bluetoothPeripheral: BluetoothPeripheral,\n        bluetoothCharacteristic: BluetoothCharacteristic,\n        notify: Boolean\n    )\n    fun writeCharacteristic(\n        bluetoothPeripheral: BluetoothPeripheral,\n        bluetoothCharacteristic: BluetoothCharacteristic,\n        value: String\n    )\n    fun readDescriptor(\n        bluetoothPeripheral: BluetoothPeripheral,\n        bluetoothCharacteristic: BluetoothCharacteristic,\n        bluetoothCharacteristicDescriptor: BluetoothCharacteristicDescriptor\n    )\n    fun changeMTU(bluetoothPeripheral: BluetoothPeripheral, mtuSize: Int)\n```\n\n## Examples\n\nThis repo contains examples for kotlin MP, ios and android in the examples folder, install their dependencies, and run it locally:\n\n### Compose Multiplatform\n\nThis example demonstrates using Kotlin Multiplatform Compose and Blue Falcon to scan for bluetooth devices and rendering using Multiplatform Compose\n\n### Kotlin MP\n\nThis example demonstrates how to integrate Blue Falcon in your own project as a dependency on your library/project.\n\n### Raspberry Pi\n\nThis example can only be ran on a Raspberry pi, it will crash otherwise.\n\n### Javascript\n\nOpen the index.html file in a web browser.\n\n## Logger\n\nBlueFalcon has a constructor that takes a Logger, you can implement your own logger, to handle and reduce or add to the noise generated.\n\nLook at the PrintLnLogger object of an example of how to do this.\n\n## Support\n\nFor a **bug, feature request, or cool idea**, please [file a Github issue](https://github.com/Reedyuk/blue-falcon/issues/new).\n\n### Two big little things\n\nKeep in mind that Blue-Falcon is maintained by volunteers. Please be patient if you don’t immediately get an answer to your question; we all have jobs, families, obligations, and lives beyond this project.\n\nMany thanks to everyone so far who has contributed to the project, it really means alot.\n\n\n[badge-android]: http://img.shields.io/badge/platform-android-brightgreen.svg?style=flat\n[badge-native]: http://img.shields.io/badge/platform-native-lightgrey.svg?style=flat\n[badge-js]: http://img.shields.io/badge/platform-js-yellow.svg?style=flat\n[badge-mac]: http://img.shields.io/badge/platform-macos-lightgrey.svg?style=flat\n[badge-rpi]: http://img.shields.io/badge/platform-rpi-lightgrey.svg?style=flat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FReedyuk%2Fblue-falcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FReedyuk%2Fblue-falcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FReedyuk%2Fblue-falcon/lists"}