Files
bluetooth_low_energy/bluetooth_low_energy
Mr剑侠客 0f4fb7f553 2.0.2 (#11)
* fix: 重构

* fix: 1

* fix: 重构

* fix: 修复 iOS 和 macOS 代码错误

* fix: 优化项目

* fix: 构建项目

* fix: 修复权限问题

* fix: 解决 macOS 沙盒权限问题

* fix: 修复代码问题

* fix: 更新依赖

* fix: 更新依赖项

* fix: 添加缺失的位置权限
2023-08-21 01:06:57 +08:00
..
2023-08-21 01:06:57 +08:00
2023-08-17 17:49:26 +08:00
2023-08-17 17:49:26 +08:00
2023-08-21 01:06:57 +08:00
2023-08-21 01:06:57 +08:00
2023-08-21 01:06:57 +08:00
2023-08-21 01:06:57 +08:00
2023-08-21 01:06:57 +08:00

bluetooth_low_energy

A Flutter plugin for controlling the bluetooth low energy.

Features

CentralController

  • SetUp/TearDown central controller.
  • Get/Listen central state.
  • Start/Stop discovery.
  • Connect/Disconnect peripherals.
  • Discover GATT.
  • Get GATT services.
  • Get GATT characteristics.
  • Get GATT descriptors.
  • Read/Write/Notify GATT characteristics.
  • Read/Write GATT descriptors.

Getting Started

Add bluetooth_low_energy as a dependency in your pubspec.yaml file.

dependencies:
  bluetooth_low_energy: ^<latest-version>

Remember to call await CentralController.setUp() before use any apis of this plugin.

Note: Bluetooth Low Energy doesn't work on emulators, so use physical devices which has bluetooth features for development.

Android

Make sure you have a miniSdkVersion with 21 or higher in your android/app/build.gradle file.

iOS and macOS

According to Apple's documents, you must include the NSBluetoothAlwaysUsageDescription on or after iOS 13, and include the NSBluetoothPeripheralUsageDescription key before iOS 13.

Linux

Not tested enough, if you occured any problems, file an issue to let me know about it, i will fix it as soon as possible.

Windows

Not implemented yet but maybe someday or someone can use the win32 api to implement this plugin_interface or someday the flutter team support C# on windows platform or someday I am familiar with C++ language...