{"id":50816027,"url":"https://github.com/ydah/blueruvia","last_synced_at":"2026-06-13T09:33:45.911Z","repository":{"id":344432965,"uuid":"1181727966","full_name":"ydah/blueruvia","owner":"ydah","description":"Web Bluetooth API-style BLE interface for Ruby.","archived":false,"fork":false,"pushed_at":"2026-03-14T16:51:55.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-15T03:05:58.128Z","etag":null,"topics":["api","ble","interface","ruby","web-bluetooth","web-bluetooth-api"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/ydah.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-14T14:45:02.000Z","updated_at":"2026-03-14T16:51:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ydah/blueruvia","commit_stats":null,"previous_names":["ydah/blueruvia"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ydah/blueruvia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ydah%2Fblueruvia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ydah%2Fblueruvia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ydah%2Fblueruvia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ydah%2Fblueruvia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ydah","download_url":"https://codeload.github.com/ydah/blueruvia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ydah%2Fblueruvia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34279898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","ble","interface","ruby","web-bluetooth","web-bluetooth-api"],"created_at":"2026-06-13T09:33:40.433Z","updated_at":"2026-06-13T09:33:40.927Z","avatar_url":"https://github.com/ydah.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlueRuvia\n\n[![CI](https://github.com/ydah/blueruvia/actions/workflows/ci.yml/badge.svg)](https://github.com/ydah/blueruvia/actions/workflows/ci.yml)\n[![Gem Version](https://badge.fury.io/rb/blueruvia.svg)](https://badge.fury.io/rb/blueruvia)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nWeb Bluetooth API-style BLE interface for Ruby.\n\nBlueRuvia provides a Web Bluetooth API-inspired interface for interacting with Bluetooth Low Energy (BLE) devices from Ruby. It supports GATT operations including device scanning, connection management, service discovery, and characteristic read/write/notify via platform-native adapters.\n\n## Installation\n\nInstall the gem and add the platform adapter dependency your runtime needs:\n\n```bash\nbundle add blueruvia\nbundle add ruby-dbus --require dbus # Linux / BlueZ\nbundle add ffi      # macOS / CoreBluetooth\n```\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n```bash\ngem install blueruvia\ngem install ruby-dbus # Linux / BlueZ\ngem install ffi      # macOS / CoreBluetooth\n```\n\nPlatform-specific runtime dependencies:\n\n- Linux: `ruby-dbus` (loaded with `require 'dbus'`)\n- macOS: `ffi`, Xcode Command Line Tools / Swift toolchain\n\n### System Requirements\n\n- **Ruby** \u003e= 3.2\n- **Linux**: BlueZ 5.50+ and D-Bus (`sudo apt-get install libdbus-1-dev`)\n- **macOS**: CoreBluetooth.framework and Xcode Command Line Tools\n\n## Quick Start\n\n```ruby\nrequire 'blueruvia'\n\n# Scan for a heart rate monitor\ndevice = BlueRuvia::Bluetooth.request_device(\n  filters: [{ services: ['heart_rate'] }]\n)\n\nputs \"Found: #{device.name} (#{device.address})\"\n\n# Connect to the GATT server\ndevice.gatt.connect\n\n# Get the Heart Rate service\nservice = device.gatt.get_primary_service('heart_rate')\n\n# Read the Heart Rate Measurement characteristic\nchar = service.get_characteristic('heart_rate_measurement')\n\n# Subscribe to notifications\nchar.on(:value_changed) do |value|\n  heart_rate = value.unpack1('xC')\n  puts \"Heart Rate: #{heart_rate} bpm\"\nend\n\nchar.start_notifications\nsleep(30)\n\n# Clean up\nchar.stop_notifications\ndevice.gatt.disconnect\n```\n\n## Usage\n\n### Device Scanning\n\n```ruby\n# Filter by service UUID\ndevice = BlueRuvia::Bluetooth.request_device(\n  filters: [{ services: ['heart_rate'] }]\n)\n\n# Filter by device name prefix\ndevice = BlueRuvia::Bluetooth.request_device(\n  filters: [{ name_prefix: 'Arduino' }],\n  optional_services: ['battery_service']\n)\n\n# Accept all devices\ndevice = BlueRuvia::Bluetooth.request_device(\n  accept_all_devices: true,\n  optional_services: ['generic_access']\n)\n\n# Filter by manufacturer data prefix\ndevice = BlueRuvia::Bluetooth.request_device(\n  filters: [\n    {\n      manufacturer_data: [\n        { company_identifier: 76, data_prefix: [0x01, 0x02] }\n      ]\n    }\n  ]\n)\n```\n\n### GATT Server Connection\n\n```ruby\ndevice.gatt.connect\nputs \"Connected: #{device.connected?}\"\n\n# Discover services\nservices = device.gatt.get_primary_services\nservices.each { |s| puts \"Service: #{s.uuid}\" }\n\ndevice.gatt.disconnect\n```\n\n### Reading and Writing Characteristics\n\n```ruby\n# Read a value\nvalue = char.read_value\nbattery_level = value.unpack1('C')\nputs \"Battery: #{battery_level}%\"\n\n# Write with response\nchar.write_value([0x01, 0x02, 0x03].pack('C*'))\n\n# Write without response\nchar.write_value_without_response([0xFF].pack('C'))\n```\n\n### Notifications\n\n```ruby\nchar.on(:value_changed) do |value|\n  puts \"New value: #{value.unpack1('C')}\"\nend\n\nchar.start_notifications\n\n# ... later\nchar.stop_notifications\n```\n\n### Configuration\n\n```ruby\nBlueRuvia.configure do |config|\n  config.adapter = :bluez           # :auto, :bluez, :core_bluetooth\n  config.scan_timeout = 15          # Scan timeout in seconds\n  config.connection_timeout = 10    # Connection timeout in seconds\n  config.device_selector = :first   # :first, :strongest, or a custom lambda\n  config.log_level = :info          # :debug, :info, :warn, :error\n  config.logger = Logger.new($stdout)\nend\n```\n\n## Supported Platforms\n\n| Platform | Adapter | Status |\n|----------|---------|--------|\n| Linux | BlueZ (D-Bus) | ✅ Supported |\n| macOS | CoreBluetooth | ✅ Supported |\n\nOn macOS, `device.address` is `CBPeripheral.identifier.uuidString` because CoreBluetooth does not expose BLE MAC addresses.\n\n## Development\n\nAfter checking out the repo, install dependencies and run the standard checks:\n\n```bash\nbundle install\nbundle exec rake\nbundle exec rspec\nbundle exec rubocop\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ydah/blueruvia.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fydah%2Fblueruvia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fydah%2Fblueruvia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fydah%2Fblueruvia/lists"}