【问题标题】:Local Name change for peripheral on Raspberry Pi not reflected on iOS Central appRaspberry Pi 上外围设备的本地名称更改未反映在 iOS Central 应用程序上
【发布时间】:2019-06-12 04:12:36
【问题描述】:

我使用 Python3 在我的 Raspberry pi 上开发了 BLE 外设,一切正常,但是当我从我的 iOS Central 应用程序扫描这个外设时,标题总是显示为空。

我已经尝试用self.local_name更改本地名称如下:

self.service_uuids = DBusStringArray([
            SERVICE_UUID])

self.local_name = 'Build by akhzar'
self.include_tx_power = True

【问题讨论】:

标签: python raspberry-pi bluez bluetooth-peripheral


【解决方案1】:

您需要将 AD Type 设置为 0x09,用于完整的本地名称,但对于短本地名称,您可以使用 0x08。

检查此代码可能对您有帮助


    def get_properties(self):
        return {
            'org.bluez.LEAdvertisement1': {
                'Type': 'peripheral',
                'LocalName': 'CC',
                'ServiceUUIDs': DBusStringArray([
                SERVICE_UUID
                ]),
                'IncludeTxPower': True,
            },
        }

【讨论】:

    猜你喜欢
    • 2019-10-16
    • 1970-01-01
    • 2018-04-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多