All Projects → EngstromJimmy → Blazm.Bluetooth

EngstromJimmy / Blazm.Bluetooth

Licence: other
No description or website provided.

Programming Languages

C#
18002 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to Blazm.Bluetooth

fast-blazor
Blazor component library for FluentUI. Microsoft's official lightweight wrapper around the FluentUI Web Components for use with .NET 6.0 Blazor applications
Stars: ✭ 928 (+1500%)
Mutual labels:  blazor
BlazorLazyLoad
BlazorLazyLoad is a concept of assembly lazy load in Blazor WASM application.
Stars: ✭ 16 (-72.41%)
Mutual labels:  blazor
BOSCH-GLM-rangefinder
Python script to remote control a BOSCH GLM 100C rangefinder via its Bluetooth serial interface
Stars: ✭ 41 (-29.31%)
Mutual labels:  bluetooth
pycalima
Python interface for Pax Calima Fan via Bluetooth LE
Stars: ✭ 34 (-41.38%)
Mutual labels:  bluetooth
NeewerLite
NeewerLite is an un-official Neewer LED light control app for macOS.
Stars: ✭ 54 (-6.9%)
Mutual labels:  bluetooth
Bluetooth-ble-beamer-and-scanner-for-tracing-corona-virus-infected-individual
Bluetooth ble beacon beamer and scanner for tracing corona virus infected person similar to Trace Together app
Stars: ✭ 26 (-55.17%)
Mutual labels:  bluetooth
Blazor-Dashboard
Admin Dashboard Template Theme for Blazor
Stars: ✭ 94 (+62.07%)
Mutual labels:  blazor
mijia-homie
A Homie MQTT bridge for the Xiaomi Mijia 2 hygrometer-thermometer. This repo also serves as the monorepo for a handful of helper crates related to Homie and Bluetooth.
Stars: ✭ 40 (-31.03%)
Mutual labels:  bluetooth
nrf52832-pac
Peripheral Access Crate for the nRF52832 microcontroller
Stars: ✭ 21 (-63.79%)
Mutual labels:  bluetooth
alfred-wf-bluetooth-manager
Connect and disconnect a bluetooth device easily
Stars: ✭ 58 (+0%)
Mutual labels:  bluetooth
hcitool
Bluetooth Host Controller Interface Command Line Tool for for sending HCI commands on macOS and Linux
Stars: ✭ 72 (+24.14%)
Mutual labels:  bluetooth
EmbeddedBlazorContent
Library to load embedded content files (js and css) from Blazor libraries in server-side Blazor mode.
Stars: ✭ 39 (-32.76%)
Mutual labels:  blazor
pyrinas-ble-client
nRF52 SDK(v16) based OS for use with Particle Xenon and other nRF52840 boards.
Stars: ✭ 15 (-74.14%)
Mutual labels:  bluetooth
open-watch
An open-source handmade smartwatch. All of the codes, PCBs and schematics are available. ⌚
Stars: ✭ 35 (-39.66%)
Mutual labels:  bluetooth
serilog-sinks-browserhttp
Serilog sink for client-side Blazor, with matching ASP.NET Core server relay
Stars: ✭ 36 (-37.93%)
Mutual labels:  blazor
bluetooth-serial-port
multi-platform bluetooth serial port library for C++
Stars: ✭ 59 (+1.72%)
Mutual labels:  bluetooth
BluetoothOperator
实现Android手机蓝牙设备的扫描、过滤、连接,通过蓝牙串口功能向设备发送指定的信息。
Stars: ✭ 14 (-75.86%)
Mutual labels:  bluetooth
blue-pair
Simple Bluetooth Android app for handling device discovery and pairing.
Stars: ✭ 52 (-10.34%)
Mutual labels:  bluetooth
IoT-Developer-Boot-Camp
Quickly get started with Silicon Labs IoT product.
Stars: ✭ 104 (+79.31%)
Mutual labels:  bluetooth
vditor-blazor
📝 A markdown web editor based on Vditor and Blazor.
Stars: ✭ 51 (-12.07%)
Mutual labels:  blazor

How to use Blazm.Bluetooth

Blazm.Bluetooth makes it easy to connect Blazor to your Bluetooth devices using Web Bluetooth.

Works both Client-side and Server-side.

Sponsors

Thanks you to much to my sponsors!

Telerik UI for Blazor – Increase productivity and cut cost in half! Use the Telerik truly native Blazor UI components and high-performing grid to cover any app scenario. Give it a try for free.

Getting Started

  1. Add Nuget package Blazm.Bluetooth
  2. In Program.cs add builder.Services.AddBlazmBluetooth();
  3. In the component you want to connect to a device add the Blazm.Bluetooth Namespace @using Blazm.Bluetooth
  4. Inject the IBluetoothNavigator (the instance that will communicate with your device) @inject IBluetoothNavigator navigator

Now you are all setup now it is time to connect to a device.

Connecting to a device

You need to create a query or a filter to filter devices, you could also specify AcceptAllDevices but that is only recommended while testing. To take a look at available devices you can use (for Microsoft Edge) edge://bluetooth-internals. You can query devices using a ServiceId or by name, you also have to specify all the services that you want to access in OptionalServices

To connect to an Andersson (SenSun) scale you need to do the following (check Pages/AnderssonScaleDemo for more info) Specify the ServiceId and CharacteristicId you want to communicate with.

var serviceId = "0000ffb0-0000-1000-8000-00805f9b34fb";
var characteristicId = "0000ffb2-0000-1000-8000-00805f9b34fb";

Create a filter

var q = new RequestDeviceQuery();
q.Filters.Add(new Filter() { Services = { serviceId } });

Request a device

var device = await navigator.RequestDeviceAsync(q);

This will return a device and it contains an id that you can use to read, write, or set up notifications. Call the SetupNotifyAsync to get notifications when the value changes.

await navigator.SetupNotifyAsync(device, serviceId, characteristicId);
navigator.Notification += Value_Notification;

and add an event listener that parses the data from the notification.

private void Value_Notification(object sender, CharacteristicEventArgs e)
{
    var data = e.Value.ToArray();
    
    // Do something with the data

    StateHasChanged();
}

The same thing goes for read and write

//Write
await navigator.WriteValueAsync(device.Id, serviceId, characteristicId, bytearray);

//Read
var value = await navigator.ReadValueAsync(device.Id, serviceId, characteristicId);

There is still many scenarios to implement but this should cover the basics.

Please feel free to add ideas /problems/needs you might have or make a PR.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].