laptou / bluez-rs

Control Bluetooth on Linux.
MIT License
39 stars 9 forks source link

Need examples of peripheral mode #9

Open fengyc opened 4 years ago

fengyc commented 4 years ago

Is there an example of peripheral mode, I am looking for a way to start a BLE server that offers data of CPU/memory usage, runs small shell scripts, etc.

Thanks!

schell commented 4 years ago

I would appreciate this as well. I'm trying to set up my raspberry pi zero w as a bluetooth keyboard with:

    let return_classes = client.set_device_class(
        *controller,
        DeviceClass::Peripheral {
            keyboard: true,
            pointer: false,
            class: PeripheralDeviceClass::Unknown,
        },
    ).await?;

and I keep running into:

Bluez { source: CommandError { opcode: SetDeviceClass, status: InvalidParams } }
wpd commented 3 years ago

I too would like to use this crate to implement a BLE peripheral. Is that possible?

schell commented 3 years ago

I think it's possible but difficult without already knowing a good amount about bluetooth development.