TBluetoothLE
delphi 蓝牙技术
D:\Users\Public\Documents\Embarcadero\Studio\17.0\Samples\Object Pascal\Multi-Device Samples\Device Sensors and Services\Bluetooth\Classic Bluetooth Basic app
System.Bluetooth
Bluetooth Low Energy (BLE)
小米手环就是BLE4.0,在android手机上用HMBLEComAssistant.apk可以搜到小米手环。
https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx
update,2015-09-25 12:08:41用delphi的BLE例子搜到小米手环了!!
Samples\Object Pascal\Multi-Device Samples\Device Sensors and Services\Bluetooth\BLEScanner
蓝牙GAP、GATT(Generic Attribute Profile)
蓝牙音箱,通过android、iPhone都可以搜索到。
小米蓝牙音箱和小米手环的蓝牙版本完全相同吗?
蓝牙耳机:蓝牙协议:HFP/A2DP/HSP/AVRCP
手环里使用了蓝牙4.0 BLE技术
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Using_Bluetooth
http://docwiki.embarcadero.com/RADStudio/XE8/en/Using_Bluetooth_Low_Energy
http://docwiki.embarcadero.com/CodeExamples/Seattle/en/Heart_Rate_Monitor_Sample
https://developer.apple.com/bluetooth/
蓝牙各种UUID
Discovering Devices
BluetoothLE does not work as the Classic Bluetooth, you do not need to pair the devices. BluetoothLE clients need to discover BluetoothLE servers.
蓝牙版本 V4.0 BLE
一节钮扣电池在静态工作状态可以支持一年。
蓝牙低功耗,也就是早前的Wibree,是蓝牙4.0版本的一个子集,它有着全新的协议栈,可快速建立简单的链接。作为蓝牙1.0 – 3.0版本中蓝牙标准协议的替代方案,它主要面向对功耗需求极低、用纽扣电池供电的应用。芯片设计可有两种:双模、单模和增强的早期版本。早期的Wibree和蓝牙ULP(超低功耗)的名称被废除,取而代之的是后来用于一时的BLE。
delphi 获取小米手环数据
手环在android上看到的
- Discovering services -->
- GAP - {----00805F9B34FB}
- Device Name - {00002A00----00805F9B34FB}
- Appearance - {00002A01----00805F9B34FB}
- Peripheral Privacy Flag - {00002A02----00805F9B34FB}
- Peripheral Preferred Connection Parameters - {00002A04----00805F9B34FB}
- GATT - {----00805F9B34FB}
- Service Changed - {00002A05----00805F9B34FB}
- - {0000FEE0----00805F9B34FB}
- - {0000FF01----00805F9B34FB}
- - {0000FF02----00805F9B34FB}
- - {0000FF03----00805F9B34FB}
- - {0000FF04----00805F9B34FB}
- - {0000FF05----00805F9B34FB}
- - {0000FF06----00805F9B34FB}
- - {0000FF07----00805F9B34FB}
- - {0000FF08----00805F9B34FB}
- - {0000FF09----00805F9B34FB}
- - {0000FF0A----00805F9B34FB}
- - {0000FF0B----00805F9B34FB}
- - {0000FF0C----00805F9B34FB}
- - {0000FF0D----00805F9B34FB}
- - {0000FF0E----00805F9B34FB}
- - {0000FF0F----00805F9B34FB}
- - {0000FEE1----00805F9B34FB}
- - {0000FEDD----00805F9B34FB}
- - {0000FEDE----00805F9B34FB}
- - {0000FEDF----00805F9B34FB}
- - {0000FED0----00805F9B34FB}
- - {0000FED1----00805F9B34FB}
- - {0000FED2----00805F9B34FB}
- - {0000FED3----00805F9B34FB}
- - {0000FEE7----00805F9B34FB}
- - {0000FEC7----00805F9B34FB}
- - {0000FEC8----00805F9B34FB}
- - {0000FEC9----00805F9B34FB}
- IMMEDIATE ALERT - {----00805F9B34FB}
- Alert Level - {00002A06----00805F9B34FB}
View UUID
手环在苹果上看到的,少了前2行GAP和GATT。
- - {0000FEE0----00805F9B34FB}
- - {0000FF01----00805F9B34FB}
- - {0000FF02----00805F9B34FB}
- - {0000FF03----00805F9B34FB}
- - {0000FF04----00805F9B34FB}
- - {0000FF05----00805F9B34FB}
- - {0000FF06----00805F9B34FB}
- - {0000FF07----00805F9B34FB}
- - {0000FF08----00805F9B34FB}
- - {0000FF09----00805F9B34FB}
- - {0000FF0A----00805F9B34FB}
- - {0000FF0B----00805F9B34FB}
- - {0000FF0C----00805F9B34FB}
- - {0000FF0D----00805F9B34FB}
- - {0000FF0E----00805F9B34FB}
- - {0000FF0F----00805F9B34FB}
- - {0000FEE1----00805F9B34FB}
- - {0000FEDD----00805F9B34FB}
- - {0000FEDE----00805F9B34FB}
- - {0000FEDF----00805F9B34FB}
- - {0000FED0----00805F9B34FB}
- - {0000FED1----00805F9B34FB}
- - {0000FED2----00805F9B34FB}
- - {0000FED3----00805F9B34FB}
- - {0000FEE7----00805F9B34FB}
- - {0000FEC7----00805F9B34FB}
- - {0000FEC8----00805F9B34FB}
- - {0000FEC9----00805F9B34FB}
- IMMEDIATE ALERT - {----00805F9B34FB}
- Alert Level - {00002A06----00805F9B34FB}
View Apple UUID
Android BLE
BTX-110003 - 20:C3:8F:EA:1B:AF
- BTX- - :C3:8F:EA:1B:AF - Discovering services -->
- GAP - {----00805F9B34FB}
- Device Name - {00002A00----00805F9B34FB}
- Appearance - {00002A01----00805F9B34FB}
- Peripheral Privacy Flag - {00002A02----00805F9B34FB}
- Reconnection Address - {00002A03----00805F9B34FB}
- Peripheral Preferred Connection Parameters - {00002A04----00805F9B34FB}
- GATT - {----00805F9B34FB}
- Service Changed - {00002A05----00805F9B34FB}
- Key Service - {0000FFE0----00805F9B34FB}
- Key Service Characteristic - {0000FFE1----00805F9B34FB}
Delphi XE8 Bluetooth 蓝牙
搜索蓝牙设备
FBluetoothManager.StartDiscovery(1000);
or
BluetoothLE1.DiscoverDevices(ScanningTime);
本机蓝牙设备名称
FBluetoothManager.CurrentAdapter.AdapterName;
配对
FAdapter.Pair(FDiscoverDevices[ComboboxDevices.ItemIndex])
取消配对
FAdapter.UnPair(FPairedDevices[ComboboxPaired.ItemIndex])
蓝牙通讯
FServerSocket:TBluetoothServerSocket;
FScocket:TBluetoothSocket;
TBluetoothService = record
Name: string;
UUID: TBluetoothUUID;
end;
FSocket := ldevice.CreateClientSocket(StringToGUID(ServiceGUI), False);
TBluetoothManager.CurrentAdapter
FSocket: TBluetoothSocket;
ToSend: TBytes;
FSocket.Connect;
ToSend := TEncoding.UTF8.GetBytes(Edit1.Text);
FSocket.SendData(ToSend);
BLE 发送数据
ADevice: TBluetoothLEDevice;
AChar: TBluetoothGattCharacteristic;
ADevice.WriteCharacteristic(AChar);
procedure TfrmHeartMonitor.BluetoothLE1EndDiscoverDevices(const Sender: TObject;
const ADeviceList: TBluetoothLEDeviceList);
var
I: Integer;
begin
// log
Memo1.Lines.Add(ADeviceList.Count.ToString + ' devices discovered:');
for I := to ADeviceList.Count - do Memo1.Lines.Add(ADeviceList[I].DeviceName); if BluetoothLE1.DiscoveredDevices.Count > then
begin
FBLEDevice := BluetoothLE1.DiscoveredDevices.First;
lblDevice.Text := HRDeviceName;
if BluetoothLE1.GetServices(FBLEDevice).Count = then
begin
Memo1.Lines.Add('No services found!');
lblBPM.Font.Size := ;
lblBPM.Text := 'No services found!';
end
else
GetServiceAndCharacteristics;
end
else
lblDevice.Text := 'Device not found';
end;
LServices: TBluetoothServiceList;
LDevice: TBluetoothDevice;
LServices := LDevice.GetServices;
LServices[I].Name;
GUIDToString(LServices[I].UUID);
蓝牙功能列表
LAN Access Using PPP
DialupNetworking
OBEXObjectPush
OBEXFileTransfer
Cordless Telephony
Audio Source
Audio Sink
AV Remote Control Target
Advanced Audio Distribution
AV Remote Control
Headset Audio Gateway
WAP
WAP Client
Personal Area Network User (PANU)
Network Access Point (NAP)
Group Ad-hoc Network (GN)
Handsfree
Handsfree Audio Gateway
SIM Access
Phonebook Access - PCE
Phonebook Access - PSE
Phonebook Access
Headset headset
Message Access Server
Message Notification Server
Message Access Profile
Generic Networking
Generic Audio

TBluetoothLE的更多相关文章
- TBluetoothLE.OnDisconnectDevice
自己作为广播方,连接我的设备断开收到的事件. TBluetoothLE.OnDisconnectDevice TBluetoothLEDevice BluetoothLE1->Discovere ...
- delphi 蓝牙 TBluetoothLE
delphi 蓝牙 TBluetoothLE.TBluetoothLEManager BLE http://docwiki.embarcadero.com/RADStudio/Seattle/en/U ...
- RAD Studio 10 自带Demo代码汇总说明
大家好,好多朋友来信咨询Delphi和C++Builder的移动开发.DataSnap架构等问题,希望能有Demo代码学习.其实Delphi和C++Builder本身自带有很多示例代码,已经覆盖了大部 ...
- delphi 演示数据路径
链接里默认的--------------------------- Error --------------------------- I/O error for file "C:\Prog ...
- delphi BLE 学习
TBluetoothLE 控件 TBluetoothLE.FManager: TBluetoothLEManager; class constructor TBluetoothLEManager.Cr ...
- Delphi IOS 蓝牙锁屏后台运行
Delphi IOS 后台运行 同样的程序,编译成android,锁屏后继续运行正常,蓝牙通讯正常,但在IOS下锁屏后程序的蓝牙就中断通讯了? IOS的机制就是这样,锁屏就关闭了. 音乐播放器是怎么做 ...
- RAD 10 蓝牙
http://docwiki.embarcadero.com/Libraries/Seattle/en/System.Bluetooth.TBluetoothLEManager.StartDiscov ...
随机推荐
- arranging-coins
https://leetcode.com/problems/arranging-coins/ public class Solution { public int arrangeCoins(int n ...
- malloc/free和new/delete的异同
一.基本概念 malloc/free: 1.函数原型及说明: void *malloc(long NumBytes):该函数分配了NumBytes个字节,并返回了指向这块内存的指针.如果分配失败,则返 ...
- Qt之自定义搜索框
简述 关于搜索框,大家都经常接触.例如:浏览器搜索.Windows资源管理器搜索等. 当然,这些对于Qt实现来说毫无压力,只要思路清晰,分分钟搞定. 方案一:调用QLineEdit现有接口 void ...
- 四、Emmet:快速编写HTML,CSS代码的有力工具
介绍 Emmet是一个插件,在IDE中安装该插件后即可使用该功能. HTML代码写起来虽简单,但是重复代码很多,Emmet能够存在一种HTML代码简写法(比较类似CSS的选择器写法),比如 div.c ...
- POJ 1201 Intervals (差分约束系统)
题意 在区间[0,50000]上有一些整点,并且满足n个约束条件:在区间[ui, vi]上至少有ci个整点,问区间[0, 50000]上至少要有几个整点. 思路 差分约束求最小值.把不等式都转换为&g ...
- Java 中方法的重载
问: 什么是方法的重载呢? 答: 如果同一个类中包含了两个或两个以上方法名相同.方法参数的个数.顺序或类型不同的方法,则称为方法的重载,也可称该方法被重载了.如下所示 4 个方法名称都为 show , ...
- linux shell中的 #!/bin/bash
#!/bin/bash是指此脚本使用/bin/bash来解释执行. 其中,#!是一个特殊的表示符,其后,跟着解释此脚本的shell路径. bash只是shell的一种,还有很多其它shell,如:sh ...
- 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境:2.搭建环境-2.5. 配置网络
2.5. 配置网络 2.5.1. 配置网络 Oracle Rac数据库涉及到公用网络和私有网络,因此要做网络划分和IP地址规划,下表列出了要安装的RAC数据库对应的IP地址.主机名以及网络连接类型: ...
- Oracle数据库备份手册
1 故障类型 l 实例故障 由ORACLE内部异常.操作系统故障或其它相关软件引起,导致ORACLE实例中的进程或内存区出现故障或数据库无法正常关闭,这种故障称为实例故障.实例故障没 ...
- windows 自动关机命令
Windows 的关机是由Shutdown.exe程序来控制的,位于Windows\System32文件夹中.如果想让Windows 2000也实现同样的效果,可以把Shutdown.exe复制到系统 ...