UWP BLE广告读取数据

时间:2017-01-02 10:44:56

标签: c# ios bluetooth uwp bluetooth-lowenergy

我使用iPhone在BLE广告中发送数据(短字符串),我想从Windows设备读取此字符串。

所以我正在尝试示例项目" BluetoothAdvertisement"来自:https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothAdvertisement

我看到我收到了包,我可以在callBack中读取本地名等...

 private async void OnAdvertisementReceived(BluetoothLEAdvertisementWatcher watcher, BluetoothLEAdvertisementReceivedEventArgs eventArgs)
    { }

但是我该怎么读字符串?

1 个答案:

答案 0 :(得分:1)

如果您使用的是公司特定的广告,我不知道您使用哪种方式向广告添加数据。我想您可以从$cover = str_replace('%20', ' ', $cover); if (!\Illuminate\Support\Facades\File::exists(base_path($cover))) : echo "file not found"; endif; 获取自定义数据部分,然后查询BluetoothLEAdvertisementReceivedEventArgs以获取eventArgs.Advertisement.ManufacturerData

BluetoothLEManufacturerData