jonas-schievink / rubble

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

Constructing Attribute requires costructing private HexSlice type #134

Closed daboross closed 4 years ago

daboross commented 4 years ago

Hi!

It looks like rubble::att::Attribute, https://jonas-schievink.github.io/rubble/rubble/att/struct.Attribute.html, has the value data wrapped in a rubble::utils::HexSlice. But as the docs indicate, HexSlice isn't public - utils isn't public, and HexSlice isn't re-exported. Thus, as far as I can tell, it isn't possible to construct an Attribute from outside the crate?

If this is a problem, do you it'd be reasonable to just re-export HexSlice from the crate root, or would it be better to add a constructor and accessors to Attribute which allow interacting with value as an &[u8]?

jonas-schievink commented 4 years ago

I'd rather not expose HexSlice, so adding a constructor sounds good. Ideally the user wouldn't even have to deal with raw Attributes (instead only with Characteristics and Services), but we aren't there yet.

daboross commented 4 years ago

Sounds good to me! Submitted #139. And again, my apologies for communicating in short bursts with periods of radio silence.