{"id":37072852,"url":"https://github.com/labapart/gattlib","last_synced_at":"2026-01-14T08:33:06.940Z","repository":{"id":8215726,"uuid":"57294155","full_name":"labapart/gattlib","owner":"labapart","description":"Library to access GATT information from BLE (Bluetooth Low Energy) devices","archived":false,"fork":false,"pushed_at":"2024-07-17T12:40:07.000Z","size":940,"stargazers_count":496,"open_issues_count":86,"forks_count":166,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-09-25T14:17:12.293Z","etag":null,"topics":["ble","bluetooth-low-energy","bluez","gattlib"],"latest_commit_sha":null,"homepage":"http://labapart.com/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labapart.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-28T10:43:22.000Z","updated_at":"2025-09-19T02:36:18.000Z","dependencies_parsed_at":"2024-02-21T00:58:47.075Z","dependency_job_id":"040ac642-8de1-4a90-980a-b12be0cdf2ce","html_url":"https://github.com/labapart/gattlib","commit_stats":{"total_commits":276,"total_committers":33,"mean_commits":8.363636363636363,"dds":"0.22101449275362317","last_synced_commit":"33a8a275928b186381bb0aea0f9778e330e57ec3"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/labapart/gattlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labapart%2Fgattlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labapart%2Fgattlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labapart%2Fgattlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labapart%2Fgattlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labapart","download_url":"https://codeload.github.com/labapart/gattlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labapart%2Fgattlib/sbom","scorecard":{"id":576345,"data":{"date":"2025-08-11","repo":{"name":"github.com/labapart/gattlib","commit":"1580056bce260f0d8ad7ccc8b105c34057cd1fbd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/github-actions.yml:1","Info: no jobLevel write permissions found"],"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":"Code-Review","score":1,"reason":"Found 3/26 approved changesets -- score normalized to 1","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":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions.yml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions.yml:111: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/github-actions.yml:118: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/github-actions.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/labapart/gattlib/github-actions.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/github-actions.yml:58","Warn: pipCommand not pinned by hash: .github/workflows/github-actions.yml:59","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 0.7.2 not signed: https://api.github.com/repos/labapart/gattlib/releases/152598271","Warn: release artifact 0.7.1 not signed: https://api.github.com/repos/labapart/gattlib/releases/150823266","Warn: release artifact 0.7.0 not signed: https://api.github.com/repos/labapart/gattlib/releases/150661734","Warn: release artifact 0.6.0 not signed: https://api.github.com/repos/labapart/gattlib/releases/150125668","Warn: release artifact 0.5.2 not signed: https://api.github.com/repos/labapart/gattlib/releases/149853658","Warn: release artifact 0.7.2 does not have provenance: https://api.github.com/repos/labapart/gattlib/releases/152598271","Warn: release artifact 0.7.1 does not have provenance: https://api.github.com/repos/labapart/gattlib/releases/150823266","Warn: release artifact 0.7.0 does not have provenance: https://api.github.com/repos/labapart/gattlib/releases/150661734","Warn: release artifact 0.6.0 does not have provenance: https://api.github.com/repos/labapart/gattlib/releases/150125668","Warn: release artifact 0.5.2 does not have provenance: https://api.github.com/repos/labapart/gattlib/releases/149853658"],"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 10 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-20T17:53:54.984Z","repository_id":8215726,"created_at":"2025-08-20T17:53:54.984Z","updated_at":"2025-08-20T17:53:54.984Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:31:27.429Z","status":"ssl_error","status_checked_at":"2026-01-14T08:31:19.098Z","response_time":107,"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","bluetooth-low-energy","bluez","gattlib"],"created_at":"2026-01-14T08:33:06.397Z","updated_at":"2026-01-14T08:33:06.921Z","avatar_url":"https://github.com/labapart.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"GattLib is a library used to access Generic Attribute Profile (GATT) protocol of BLE (Bluetooth Low Energy) devices.\nIt has been introduced to allow to build applications that could easily communicate with BLE devices.\n\nIt supports Bluez v4 and v5.\n\nLatest GattLib Release packages\n===============================\n\n* The latest release can be found [here](https://github.com/labapart/gattlib/releases/latest). It contains:\n\n- Prebuilt Debian, RPM and ZIP packages for x86_64 and Bluez v5.x\n- Packages for ARM 32bit and 64bit would have to be built by the developer - see section [Package GattLib](#package-gattlib).\n\n- Prebuilt Python packages are available on [Pypi repository](https://pypi.org/project/gattlib-py/).\n\nBuild GattLib\n=============\n\n* Gattlib requires the following packages: `libbluetooth-dev`, `libreadline-dev`.  \nOn Debian based system (such as Ubuntu), you can installed these packages with the\nfollowing command: `sudo apt install libbluetooth-dev libreadline-dev`\n\n```\ncd \u003cgattlib-src-root\u003e\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n* Gattlib can also be built for a specific version of Bluez by specifying its version at build time:\n\n```\nmkdir build \u0026\u0026 cd build\ncmake -DBLUEZ_VERSION=5.50 ..\nmake\n```\n\n\n* **On Bluez versions prior to v5.42**, gattlib used Bluez source code while it uses D-Bus API \nfrom v5.42. D-Bus API can be used on version prior to Bluez v5.42 by using the CMake flag `-DGATTLIB_FORCE_DBUS=TRUE`:\n\n```\nmkdir build \u0026\u0026 cd build\ncmake -DGATTLIB_FORCE_DBUS=TRUE ..\nmake\n```\n\n### Cross-Compilation\n\nTo cross-compile GattLib, you must provide the following environment variables:\n\n- `CROSS_COMPILE`: prefix of your cross-compile toolchain\n- `SYSROOT`: an existing system root that contains the libraries and include files required by your application\n\nExample:\n\n```\ncd \u003cgattlib-src-root\u003e\nmkdir build \u0026\u0026 cd build\nexport CROSS_COMPILE=~/Toolchains/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-\nexport SYSROOT=~/Distributions/debian-wheezy\ncmake ..\nmake\n```\n\nPackage GattLib\n===============\n\nFrom the build directory: `cpack ..`\n\n**Note:** It generates DEB, RPM and ZIP packages. Ensure you have the expected dependencies\n installed on your system (eg: to generate RPM package on Debian-based Linux distribution\n  you must have `rpm` package installed).\n\nDefault install directory is defined as /usr by CPack variable `CPACK_PACKAGE_INSTALL_DIRECTORY`.  \nTo change the install directory to `/usr/local` run: `cpack -DCPACK_PACKAGE_INSTALL_DIRECTORY=/usr/local ..`\n\nExamples\n========\n\n* [Demonstrate discovering of primary services and characteristics](/examples/discover/discover.c):\n\n        ./examples/discover/discover 78:A5:04:22:45:4F\n\n* [Demonstrate characteristic read/write](/examples/read_write/read_write.c):\n\n        ./examples/read_write/read_write 78:A5:04:22:45:4F read 00002a29-0000-1000-8000-00805f9b34fb\n        ./examples/read_write/read_write 78:A5:04:22:45:4F write 00002a6b-0000-1000-8000-00805f9b34fb 0x1234\n\n* [Demonstrate BLE scanning and connection](/examples/ble_scan/ble_scan.c):\n\n        ./examples/ble_scan/ble_scan\n\n* [Demonstrate GATT notification using GATT Battery service](/examples/notification/notification.c):\n\n        ./examples/notification/notification\n\n* [Demonstrate GATT Write Without Response](/examples/nordic_uart/nordic_uart.c):\n\n        ./examples/nordic_uart/nordic_uart\n\n**Note 1:** [The example 'read/write mem'](/examples/read_write_mem/read_write.c) is similar to\n[the example 'read/write'](/examples/read_write/read_write.c) except a GLib loop is used to allows\nthe memory to be freed by Glib. Without this loop, some memory could be locked.\n\n**Note 2:** `examples/gatttool` has been partially ported to gattlib. There are two reasons: the laziness\n (some of the GATT functions could be replaced by their gattlib equivalent) and the completeness (there\n are still some missing functions in gattlib).\n\n* Notification is also supported. Example:\n\n```\nvoid notification_cb(uint16_t handle, const uint8_t* data, size_t data_length, void* user_data) {\n\tprintf(\"Notification on handle 0x%02x\\n\", handle);\n}\n\nmain() {\n\tuint16_t status_handle; // Handle of the 'status' characteristic\n\tuint16_t enable_notification = 0x0001;\n\n\t// Enable Status Notification\n\tgattlib_write_char_by_handle(connection, status_handle + 1, \u0026enable_notification, sizeof(enable_notification));\n\t// Register notification handler\n\tgattlib_register_notification(connection, notification_cb, NULL);\n}\n```\n\nKnown limitations\n-----------------\n\n* **gattlib and BLE**: gattlib requires at least Bluez v4.100 to work with Bluetooth Low Energy (BLE) devices. Bluez does not allow to connect to BLE device prior to this version. But gattlib can still work with Bluetooth Classic (BR/EDR) prior to Bluez v4.100.  \nDebian 7 \"Wheezy\" (supported until 31st of May 2018) relies on Bluez v4.99 while Debian 8 \"Jessie\" (supported until April/May 2020) uses Bluez v5.23.\n\nTODO List\n=========\n\n- Complete `examples/gatttool` port to GattLib to demonstrate the completeness of GattLib.\n- Remove GLib dependencies to GattLib (mainly replacing GLib IO Channels by Unix Domain Socket).\n\nLicense\n=======\n\nGattlib with Bluez Legacy support (for Bluez v4) has a GPL v2.0 or later license.  \nWhile Gattlib for recent version of Bluez (v5.40+) has a BSD-3-Clause license - except `dbus/bluez5/lib/uuid.c`\nand `dbus/bluez5/lib/uuid.h` that have a GPL v2.0 or later license.\n\nSupport\n=======\n\nCommercial Support can be obtained through [Lab A Part](https://labapart.com). Please contact us: [https://labapart.com/about/](https://labapart.com/about/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabapart%2Fgattlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabapart%2Fgattlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabapart%2Fgattlib/lists"}