diff --git a/src/server/ble_characteristic.rs b/src/server/ble_characteristic.rs index 7d30a67..f7f6c82 100644 --- a/src/server/ble_characteristic.rs +++ b/src/server/ble_characteristic.rs @@ -251,7 +251,7 @@ impl BLECharacteristic { pub fn notify(&self) { for it in &self.subscribed_list { - if let Err(err) = self.send_value(self.value.value(), it.0, it.1) { + if let Err(err) = self.send_value(self.value.as_slice(), it.0, it.1) { ::log::warn!("notify error({}): {:?}", it.0, err); } } @@ -330,7 +330,7 @@ impl BLECharacteristic { } ble_npl_hw_enter_critical(); - let value = characteristic.value.value(); + let value = characteristic.value.as_slice(); let rc = os_mbuf_append(ctxt.om, value); ble_npl_hw_exit_critical(); if rc == 0 { @@ -355,7 +355,7 @@ impl BLECharacteristic { if let Some(callback) = &mut (*characteristic.get()).on_write { let desc = crate::utilities::ble_gap_conn_find(conn_handle).unwrap(); let mut arg = OnWriteArgs { - current_data: (*characteristic.get()).value.value(), + current_data: (*characteristic.get()).value.as_slice(), recv_data: &buf, desc: &desc, reject: false, diff --git a/src/server/ble_descriptor.rs b/src/server/ble_descriptor.rs index 926b304..b2674c2 100644 --- a/src/server/ble_descriptor.rs +++ b/src/server/ble_descriptor.rs @@ -108,7 +108,7 @@ impl BLEDescriptor { } ble_npl_hw_enter_critical(); - let value = descriptor.value.value(); + let value = descriptor.value.as_slice(); let rc = os_mbuf_append(ctxt.om, value); ble_npl_hw_exit_critical(); if rc == 0 { @@ -131,7 +131,7 @@ impl BLEDescriptor { if let Some(callback) = &mut (*descriptor.get()).on_write { let desc = crate::utilities::ble_gap_conn_find(conn_handle).unwrap(); let mut arg = OnWriteDescriptorArgs { - current_data: (*descriptor.get()).value.value(), + current_data: (*descriptor.get()).value.as_slice(), recv_data: &buf, desc: &desc, reject: false,