pub struct CharacteristicExtendedProperties {
pub properties: u16,
}
Expand description
Characteristic Extended Properties.
Fields§
§properties: u16
Characteristic Extended Properties Bit Field
Implementations§
Source§impl CharacteristicExtendedProperties
impl CharacteristicExtendedProperties
Sourcepub fn new(properties: u16) -> Self
pub fn new(properties: u16) -> Self
Create CharacteristicExtendedProperties
from Characteristic Extended Properties Bit Field
.
§Examples
use ble_data_struct::descriptors::client_characteristic_configuration::{
ClientCharacteristicConfiguration, INDICATION, NOTIFICATION,
};
let result = ClientCharacteristicConfiguration::new(NOTIFICATION);
assert_eq!(NOTIFICATION, result.configuration);
Sourcepub fn is_reliable_write(&self) -> bool
pub fn is_reliable_write(&self) -> bool
check Reliable Write.
§Examples
use ble_data_struct::descriptors::client_characteristic_configuration::{
ClientCharacteristicConfiguration, INDICATION, NOTIFICATION,
};
let result = ClientCharacteristicConfiguration::new(NOTIFICATION);
assert!(result.is_notification());
assert!(!result.is_indication());
Sourcepub fn is_writable_auxiliaries(&self) -> bool
pub fn is_writable_auxiliaries(&self) -> bool
check Writable Auxiliaries.
§Examples
use ble_data_struct::descriptors::client_characteristic_configuration::{
ClientCharacteristicConfiguration, INDICATION, NOTIFICATION,
};
let result = ClientCharacteristicConfiguration::new(INDICATION);
assert!(!result.is_notification());
assert!(result.is_indication());
Trait Implementations§
Source§impl Clone for CharacteristicExtendedProperties
impl Clone for CharacteristicExtendedProperties
Source§fn clone(&self) -> CharacteristicExtendedProperties
fn clone(&self) -> CharacteristicExtendedProperties
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Into<Vec<u8>> for CharacteristicExtendedProperties
impl Into<Vec<u8>> for CharacteristicExtendedProperties
Source§fn into(self) -> Vec<u8> ⓘ
fn into(self) -> Vec<u8> ⓘ
Create Vec<u8>
from CharacteristicExtendedProperties
.
§Examples
use ble_data_struct::descriptors::client_characteristic_configuration::{
ClientCharacteristicConfiguration, INDICATION, NOTIFICATION,
};
let configuration = NOTIFICATION.to_le_bytes().to_vec();
let result = ClientCharacteristicConfiguration::new(NOTIFICATION);
let into_data: Vec<u8> = result.into();
assert_eq!(configuration, into_data);
let configuration = INDICATION.to_le_bytes().to_vec();
let result = ClientCharacteristicConfiguration::new(INDICATION);
let into_data: Vec<u8> = result.into();
assert_eq!(configuration, into_data);
Source§impl PartialEq for CharacteristicExtendedProperties
impl PartialEq for CharacteristicExtendedProperties
Source§fn eq(&self, other: &CharacteristicExtendedProperties) -> bool
fn eq(&self, other: &CharacteristicExtendedProperties) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl TryFrom<&Vec<u8>> for CharacteristicExtendedProperties
impl TryFrom<&Vec<u8>> for CharacteristicExtendedProperties
Source§fn try_from(value: &Vec<u8>) -> Result<Self, String>
fn try_from(value: &Vec<u8>) -> Result<Self, String>
Create CharacteristicExtendedProperties
from Vec<u8>
.
§Examples
use ble_data_struct::descriptors::client_characteristic_configuration::{
ClientCharacteristicConfiguration, INDICATION, NOTIFICATION,
};
let configuration = NOTIFICATION.to_le_bytes().to_vec();
let result = ClientCharacteristicConfiguration::try_from(&configuration);
assert!(result.is_ok());
assert_eq!(NOTIFICATION, result.unwrap().configuration);
let configuration = INDICATION.to_le_bytes().to_vec();
let result = ClientCharacteristicConfiguration::try_from(&configuration);
assert!(result.is_ok());
assert_eq!(INDICATION, result.unwrap().configuration);
let configuration = Vec::new();
let result = ClientCharacteristicConfiguration::try_from(&configuration);
assert!(!result.is_ok());
Source§impl Uuid16bit for CharacteristicExtendedProperties
impl Uuid16bit for CharacteristicExtendedProperties
Source§fn uuid_16bit() -> u16
fn uuid_16bit() -> u16
return 0x2900
.
§Examples
use ble_data_struct::Uuid16bit;
use ble_data_struct::descriptors::characteristic_extended_properties::CharacteristicExtendedProperties;
assert_eq!(0x2900, CharacteristicExtendedProperties::uuid_16bit());
impl StructuralPartialEq for CharacteristicExtendedProperties
Auto Trait Implementations§
impl Freeze for CharacteristicExtendedProperties
impl RefUnwindSafe for CharacteristicExtendedProperties
impl Send for CharacteristicExtendedProperties
impl Sync for CharacteristicExtendedProperties
impl Unpin for CharacteristicExtendedProperties
impl UnwindSafe for CharacteristicExtendedProperties
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more