BootstrapBlazor.Bluetooth 7.1.0

Blazor Bluetooth & Printer 蓝牙和打印 组件

1. 蓝牙打印机 Printer

2. 蓝牙心率带 Heart Rate

3. 蓝牙设备电量 Battery Level

4. 蓝牙特征通知 Notification

示例

https://www.blazor.zone/bluetooth

https://blazor.app1.es/bluetooth

image

使用方法:

  1. nuget包

    BootstrapBlazor.Bluetooth

  2. _Imports.razor 文件 或者页面添加 添加组件库引用

    @using BootstrapBlazor.Components

  3. Razor页面

    蓝牙打印机 BT Printer
    https://github.com/densen2014/Densen.Extensions/blob/master/Demo/DemoShared/Pages/BtPrinterPage.razor

    @using BootstrapBlazor.Components
    
    <Printer OnResult="OnResult" ShowUI="true" Debug="true" />
    
    

    蓝牙心率带
    https://github.com/densen2014/Densen.Extensions/blob/master/Demo/DemoShared/Pages/BtHeartratePage.razor

    @using BootstrapBlazor.Components
    
    <button class="btn btn-outline-secondary" @onclick="GetHeartrate ">查询心率</button>
    <button class="btn btn-outline-secondary" @onclick="StopHeartrate ">停止读取</button>
    <Heartrate @ref="heartrate" OnUpdateValue="OnUpdateValue" />
    <h2 style="color:red" data-action="heartrate"/>
    
    @code{
        Heartrate heartrate { get; set; } = new Heartrate();
        private int? value;
    
        private Task OnUpdateValue(int value)
        {
            this.value = value;
            StateHasChanged();
            return Task.CompletedTask;
        }
    }
    

    蓝牙设备电量
    https://github.com/densen2014/Densen.Extensions/blob/master/Demo/DemoShared/Pages/BtBatteryLevelPage.razor

    @using BootstrapBlazor.Components
    
    <button class="btn btn-outline-secondary" @onclick="GetBatteryLevel ">查询电量</button>
    <BatteryLevel @ref="batteryLevel" OnUpdateValue="OnUpdateValue" />
    <pre>@message</pre>
    
    @code{
        Heartrate heartrate { get; set; } = new Heartrate();
        private int? value;
    
        private Task OnUpdateValue(decimal value)
        {
            this.value = value;
            this.statusmessage = $"设备电量{value}%";
            StateHasChanged();
            return Task.CompletedTask;
        }
    }
    
    
  4. 更多信息请参考

    Bootstrap 风格的 Blazor UI 组件库 基于 Bootstrap 样式库精心打造,并且额外增加了 100 多种常用的组件,为您快速开发项目带来非一般的感觉

    https://www.blazor.zone

    https://www.blazor.zone/bluetooth

    https://blazor.app1.es/Bluetooth


Blazor Printer component

1. Printer

2. Heart Rate

3. Battery Level

4. Notification

Demo

https://www.blazor.zone/bluetooth

https://blazor.app1.es/bluetooth

Instructions:

  1. NuGet install pack

    BootstrapBlazor.Bluetooth

  2. _Imports.razor or Razor page

    @using BootstrapBlazor.Components
    
  3. Razor page

    BT Printer
    https://github.com/densen2014/Densen.Extensions/blob/master/Demo/DemoShared/Pages/BtPrinterPage.razor

    @using BootstrapBlazor.Components
    
    <Printer OnResult="OnResult" ShowUI="true" Debug="true" />
    
    

    Heart rate

    https://github.com/densen2014/Densen.Extensions/blob/master/Demo/DemoShared/Pages/BtHeartratePage.razor

    @using BootstrapBlazor.Components
    
    <button class="btn btn-outline-secondary" @onclick="GetHeartrate ">查询心率</button>
    <button class="btn btn-outline-secondary" @onclick="StopHeartrate ">停止读取</button>
    <Heartrate @ref="heartrate" OnUpdateValue="OnUpdateValue" />
    <h2 style="color:red" data-action="heartrate"/>
    
    @code{
        Heartrate heartrate { get; set; } = new Heartrate();
        private int? value;
    
        private Task OnUpdateValue(int value)
        {
            this.value = value;
            StateHasChanged();
            return Task.CompletedTask;
        }
    }
    

    Battery Level
    https://github.com/densen2014/Densen.Extensions/blob/master/Demo/DemoShared/Pages/BtBatteryLevelPage.razor

    @using BootstrapBlazor.Components
    
    <button class="btn btn-outline-secondary" @onclick="GetBatteryLevel ">查询电量</button>
    <BatteryLevel @ref="batteryLevel" OnUpdateValue="OnUpdateValue" />
    <pre>@message</pre>
    
    @code{
        Heartrate heartrate { get; set; } = new Heartrate();
        private int? value;
    
        private Task OnUpdateValue(decimal value)
        {
            this.value = value;
            this.statusmessage = $"设备电量{value}%";
            StateHasChanged();
            return Task.CompletedTask;
        }
    }
    
    
  4. More informations

    Bootstrap style Blazor UI component library Based on the Bootstrap style library, it is carefully built, and 100 a variety of commonly used components have been added to bring you an extraordinary feeling for rapid development projects

    https://www.blazor.zone

    https://www.blazor.zone/bluetooth

    https://blazor.app1.es/Bluetooth


Blazor 组件

条码扫描 ZXingBlazor nuget stats

图片浏览器 Viewer

条码扫描 BarcodeScanner

手写签名 Handwritten

手写签名 SignaturePad

定位/持续定位 Geolocation

屏幕键盘 OnScreenKeyboard

百度地图 BaiduMap

谷歌地图 GoogleMap

蓝牙和打印 Bluetooth

PDF阅读器 PdfReader

文件系统访问 FileSystem

光学字符识别 OCR

电池信息/网络信息 WebAPI

AlexChow

今日头条 | 博客园 | 知乎 | Gitee | GitHub

ChuanglinZhou

No packages depend on BootstrapBlazor.Bluetooth.

Version Downloads Last updated
9.0.0 0 2025/1/21
8.0.2 0 2024/4/26
8.0.1 0 2023/12/9
8.0.0 0 2023/11/15
7.1.0 1 2025/5/28
7.0.1 0 2022/12/7
7.0.0 0 2022/11/9
6.2.1 0 2022/10/12
6.2.0 0 2022/10/12
6.1.0 0 2022/10/12
6.0.7 0 2022/10/12
6.0.6 0 2022/10/3
6.0.5 0 2022/10/3
6.0.4 0 2022/10/2
6.0.3 0 2022/10/2
6.0.2 0 2022/10/2
6.0.1 0 2022/10/2
6.0.0 0 2022/10/2