Skip to main content

BleGattCharFlag

Enum BleGattCharFlag 

Source
pub enum BleGattCharFlag {
Show 18 variants Broadcast, Read, WriteNoRsp, Write, Notify, Indicate, AuthSignWrite, ReliableWrite, AuxWrite, ReadEnc, ReadAuthen, ReadAuthor, WriteEnc, WriteAuthen, WriteAuthor, NotifyIndicateEnc, NotifyIndicateAuthen, NotifyIndicateAuthor,
}
Expand description

A GATT characteristic operation / permission flag (BLE_GATT_CHR_F_*).

The operation flags become the property bits of the characteristic declaration (and gate what the ATT server lets a peer do); the *Enc / *Authen / *Author flags additionally demand a security level before the access is dispatched to the gatts_subscribe hook.

Variants§

§

Broadcast

The value may be broadcast (sets the Broadcast property bit).

§

Read

The peer may read the value.

§

WriteNoRsp

The peer may write the value without a response (ATT Write Command). Independent of Write — a peer cannot use write-without-response unless this flag is set — but both kinds of write arrive as the same GattsEvent::Write, as NimBLE does not report which ATT opcode carried them.

§

Write

The peer may write the value with a response (ATT Write Request).

§

Notify

The value may be notified (unacknowledged). NimBLE adds the CCCD for you.

§

Indicate

The value may be indicated (acknowledged). NimBLE adds the CCCD for you.

§

AuthSignWrite

The peer may write the value with a signature (ATT Signed Write Command).

§

ReliableWrite

Sets the “Reliable Write” extended property (prepare/execute writes). The queued writes are coalesced by NimBLE and delivered as a single Write.

§

AuxWrite

Sets the “Writable Auxiliaries” extended property (the Characteristic User Description descriptor is writable).

§

ReadEnc

Reads require an encrypted link.

§

ReadAuthen

Reads require an encrypted link from an authenticated (MITM-protected) pairing.

§

ReadAuthor

Reads require authorization.

Not usable yet: NimBLE asks the application to authorize the access through the BLE_GAP_EVENT_AUTHORIZE GAP event, which this crate does not surface (it arrives as GapEvent::Other, whose response cannot be set), and NimBLE rejects an unanswered request — so setting this flag currently fails every read with “insufficient authorization”.

§

WriteEnc

Writes require an encrypted link.

§

WriteAuthen

Writes require an encrypted link from an authenticated (MITM-protected) pairing.

§

WriteAuthor

Writes require authorization. Carries the same caveat as ReadAuthor.

§

NotifyIndicateEnc

Subscribing (writing the CCCD) requires an encrypted link.

§

NotifyIndicateAuthen

Subscribing (writing the CCCD) requires an encrypted link from an authenticated (MITM-protected) pairing.

§

NotifyIndicateAuthor

Subscribing (writing the CCCD) requires authorization. Carries the same caveat as ReadAuthor.

Implementations§

Source§

impl BleGattCharFlag

Source

pub const fn repr(self) -> ble_gatt_chr_flags

The raw NimBLE flag bit (BLE_GATT_CHR_F_*). const, so it can be used to build a static service table (see the gatt_services! macro).

Trait Implementations§

Source§

impl<O: Into<EnumSet<BleGattCharFlag>>> BitAnd<O> for BleGattCharFlag

Source§

type Output = EnumSet<BleGattCharFlag>

The resulting type after applying the & operator.
Source§

fn bitand(self, other: O) -> Self::Output

Performs the & operation. Read more
Source§

impl<O: Into<EnumSet<BleGattCharFlag>>> BitOr<O> for BleGattCharFlag

Source§

type Output = EnumSet<BleGattCharFlag>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: O) -> Self::Output

Performs the | operation. Read more
Source§

impl<O: Into<EnumSet<BleGattCharFlag>>> BitXor<O> for BleGattCharFlag

Source§

type Output = EnumSet<BleGattCharFlag>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, other: O) -> Self::Output

Performs the ^ operation. Read more
Source§

impl Clone for BleGattCharFlag

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BleGattCharFlag

Source§

impl Debug for BleGattCharFlag

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl EnumSetConstHelper for BleGattCharFlag

Source§

const CONST_INIT_HELPER: __EnumSetInitHelper = __EnumSetInitHelper

The instance of the ConstInitHelper.
Source§

const CONST_OP_HELPER: __EnumSetOpHelper = __EnumSetOpHelper

The instance of the ConstOpHelper.
Source§

type ConstInitHelper = __EnumSetInitHelper

A helper type used to convert values to EnumSets at compile-time.
Source§

type ConstOpHelper = __EnumSetOpHelper

A helper type used to implement compile-time operations on enums.
Source§

impl EnumSetType for BleGattCharFlag

Source§

impl EnumSetTypePrivate for BleGattCharFlag

Source§

const ALL_BITS: Self::Repr = 262143

A mask of bits that are valid in the bitset.
Source§

const BIT_WIDTH: u32 = 18u32

The largest bit used in the bitset.
Source§

const VARIANT_COUNT: u32 = 18u32

The number of variants in the bitset.
Source§

type Repr = u32

The underlying type used to store the bitset.
Source§

fn enum_into_u32(self) -> u32

Converts an enum of this type into its bit position.
Source§

unsafe fn enum_from_u32(val: u32) -> Self

Converts a bit position into an enum value.
Source§

unsafe fn enum_from_u32_checked(val: u32) -> Self

Converts a bit position into an enum value, with a debug_assert.
Source§

impl Eq for BleGattCharFlag

Source§

impl From<BleGattCharFlag> for ble_gatt_chr_flags

Available on esp_idf_bt_nimble_gatt_server only.
Source§

fn from(flag: BleGattCharFlag) -> Self

Converts to this type from the input type.
Source§

impl Not for BleGattCharFlag

Source§

type Output = EnumSet<BleGattCharFlag>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq for BleGattCharFlag

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable)§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<EnumSet<BleGattCharFlag>> for BleGattCharFlag

Source§

fn eq(&self, other: &EnumSet<BleGattCharFlag>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable)§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<O: Into<EnumSet<BleGattCharFlag>>> Sub<O> for BleGattCharFlag

Source§

type Output = EnumSet<BleGattCharFlag>

The resulting type after applying the - operator.
Source§

fn sub(self, other: O) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

§

impl Freeze for BleGattCharFlag

§

impl RefUnwindSafe for BleGattCharFlag

§

impl Send for BleGattCharFlag

§

impl Sync for BleGattCharFlag

§

impl Unpin for BleGattCharFlag

§

impl UnsafeUnpin for BleGattCharFlag

§

impl UnwindSafe for BleGattCharFlag

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = !

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.