Skip to content

Commit

Permalink
Update after review
Browse files Browse the repository at this point in the history
  • Loading branch information
lulf committed Dec 19, 2024
1 parent 4ad2a2e commit 10dec82
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions host/src/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ impl<'d, M: RawMutex, const MAX: usize> AttributeTable<'d, M, MAX> {
}
}

pub(crate) fn set_raw(&self, characteristic: u16, input: &[u8]) -> Result<(), Error> {
pub(crate) fn set_raw(&self, attribute: u16, input: &[u8]) -> Result<(), Error> {
self.iterate(|mut it| {
while let Some(att) = it.next() {
if att.handle == characteristic {
if let AttributeData::Data { props, value } = &mut att.data {
if att.handle == attribute {
if let AttributeData::Data { props: _, value } = &mut att.data {
if value.len() == input.len() {
value.copy_from_slice(input);
return Ok(());
Expand Down Expand Up @@ -586,7 +586,7 @@ impl<T: GattValue> Characteristic<T> {
///
/// If the provided connection has not subscribed for this characteristic, it will not be notified.
///
/// If the characteristic for the handle cannot be found, an error is returned.
/// If the characteristic does not support notifications, an error is returned.
pub async fn notify(
&self,
server: &dyn DynamicAttributeServer,
Expand All @@ -596,7 +596,7 @@ impl<T: GattValue> Characteristic<T> {
let value = value.to_gatt();
server.set(self.handle, value)?;

let cccd_handle = self.cccd_handle.ok_or(Error::Other)?;
let cccd_handle = self.cccd_handle.ok_or(Error::NotFound)?;

if !server.should_notify(connection, cccd_handle) {
// No reason to fail?
Expand Down

0 comments on commit 10dec82

Please sign in to comment.