embassy-rs / trouble

A Rust Host BLE stack with a future goal of qualification.
Apache License 2.0
121 stars 24 forks source link

Add default_value and descriptor to characteristic macro #175

Open HaoboGu opened 1 week ago

HaoboGu commented 1 week ago

Current gatt service macro fills 0s as the AttributeData:

https://github.com/embassy-rs/trouble/blob/224f37194d593cd884f736c0f168b097f9b61a5d/host-macros/src/service.rs#L149

It would be very useful if users could set the value of AttributeData.

I found the following code blocks in host-macro, it seems value and descriptor macro args are not implemented. May I ask that is there any plan to finish this?

https://github.com/embassy-rs/trouble/blob/224f37194d593cd884f736c0f168b097f9b61a5d/host-macros/src/characteristic.rs#L115-L126

jamessizeland commented 1 week ago

It is on the to-do list yes 😊, you're welcome to PR an implementation, but also good to know it's a wanted feature so we can prioritise it.

HaoboGu commented 1 week ago

yeah, this is commonly used in HID over BLE, for example, setting hid info and report map