jonas-schievink / rubble

(going to be a) BLE stack for embedded Rust
BSD Zero Clause License
397 stars 56 forks source link

Allow to mutate AttributeProvider #151

Closed daschl closed 3 years ago

daschl commented 3 years ago

This changeset makes it possible to mutate the AttributeProvider, making it possible to change attribute values during the runtime of the application.

This should at least basically cover the needs for #150

daschl commented 3 years ago

Here is a usage example:

let mapper:&mut BleChannelMap<ControllerServiceAttrs, NoSecurity> = ble_r.l2cap().channel_mapper();
let provider: &mut ControllerServiceAttrs = mapper.attribute_provider();
provider.set_boiler_temp(&[0x1A]); // needs some work ;-)
daschl commented 3 years ago

@jonas-schievink thanks for the review, updated based on your comments.

jonas-schievink commented 3 years ago

Thanks, looks good!