【问题标题】:Set bluetooth to discoverable mode将蓝牙设置为可发现模式
【发布时间】:2015-05-04 15:33:24
【问题描述】:

我想将蓝牙设备设置为可发现模式。我使用 pybluez 编写了以下代码,但它只是宣传该服务。如何设置可发现模式以便 Android 设备可以找到它?

uuid = "94f39d29-7d6d-437d-973b-fba39e49d4ee"
advertise_service(
    server_sock, "SampleServer",
    service_id = uuid,
    service_classes = [uuid, SERIAL_PORT_CLASS],
    profiles = [SERIAL_PORT_PROFILE], 
    # protocols = [OBEX_UUID] 
)

【问题讨论】:

  • 这是蓝牙 LE?

标签: python bluetooth


【解决方案1】:

类型:

$ bluetoothctl

然后:

$ 可在

上发现

您的设备现在可以被发现一分钟。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-19
    • 2016-07-16
    • 1970-01-01
    • 2015-01-28
    • 2017-03-17
    • 2011-05-12
    • 1970-01-01
    相关资源
    最近更新 更多