Enum bluenrg::event::BlueNRGError[][src]

pub enum BlueNRGError {
    UnknownEvent(u16),
    UnknownResetReason(u8),
    BadEventFlags(u64),
    UnknownCrashReason(u8),
    BadGapPairingStatus(u8),
    BadGapDeviceFoundEvent(u8),
    BadGapBdAddrType(u8),
    BadGapProcedure(u8),
    BadGapProcedureStatus(u8),
    BadL2CapDataLength(u8, u8),
    BadL2CapLength(u16, u16),
    BadL2CapRejectionReason(u16),
    BadL2CapConnectionResponseCode(u8),
    BadL2CapConnectionResponseResult(u16),
    BadConnectionInterval(ConnectionIntervalError),
    BadL2CapConnectionUpdateRequestInterval(DurationDuration),
    BadL2CapConnectionUpdateRequestLatency(u16, u16),
    BadL2CapConnectionUpdateRequestTimeout(Duration),
    BadAttFindInformationResponseFormat(u8),
    AttFindInformationResponsePartialPair16,
    AttFindInformationResponsePartialPair128,
    AttFindByTypeValuePartial,
    AttReadByTypeResponsePartial,
    AttReadByGroupTypeResponsePartial,
    BadGattProcedureStatus(u8),
    BadAttRequestOpcode(u8),
    BadAttError(u8),
    AttReadMultiplePermitRequestPartial,
    BadConfigParameterLength(usize),
    UnknownLinkState(u8),
    BadBooleanValue(u8),
    BadPassKeyRequirement(u8),
    PartialBondedDeviceAddress,
    BadBdAddrType(u8),
}

Enumeration of potential errors when sending commands or deserializing events.

Variants

The event is not recoginized. Includes the unknown opcode.

For the HalInitialized event: the reset reason was not recognized. Includes the unrecognized byte.

For the EventsLost event: The event included unrecognized event flags. Includes the entire bitfield.

For the CrashReport event: The crash reason was not recognized. Includes the unrecognized byte.

For the GAP Pairing Complete event: The status was not recognized. Includes the unrecognized byte.

For the GAP Device Found event: the type of event was not recognized. Includes the unrecognized byte.

For the GAP Device Found event: the type of BDADDR was not recognized. Includes the unrecognized byte.

For the GAP Procedure Complete event: The procedure code was not recognized. Includes the unrecognized byte.

For the GAP Procedure Complete event: The procedure status was not recognized. Includes the unrecognized byte.

For any L2CAP event: The event data length did not match the expected length. The first field is the required length, and the second is the actual length.

For any L2CAP event: The L2CAP length did not match the expected length. The first field is the required length, and the second is the actual length.

For any L2CAP response event: The L2CAP command was rejected, but the rejection reason was not recognized. Includes the unknown value.

For the L2CAP Connection Update Response event: The code byte did not indicate either Rejected or Updated. Includes the invalid byte.

For the L2CAP Connection Update Response event: The command was accepted, but the result was not recognized. It did not indicate the parameters were either updated or rejected. Includes the unknown value.

For the L2CAP Connection Update Request event: The provided connection interval is invalid. Includes the underlying error.

For the L2CAP Connection Update Request event: The provided interval is invalid. Potential errors:

  • Either the minimum or maximum is out of range. The minimum value for either is 7.5 ms, and the maximum is 4 s.
  • The min is greater than the max

See the Bluetooth specification, Vol 3, Part A, Section 4.20. Versions 4.1, 4.2 and 5.0.

Inclues the provided minimum and maximum, respectively.

For the L2CAP Connection Update Request event: The provided connection latency is invalid. The maximum value for connection latency is defined in terms of the timeout and maximum connection interval.

  • connIntervalMax = Interval Max
  • connSupervisionTimeout = Timeout
  • maxConnLatency = min(500, ((connSupervisionTimeout / (2 * connIntervalMax)) - 1))

See the Bluetooth specification, Vol 3, Part A, Section 4.20. Versions 4.1, 4.2 and 5.0.

Inclues the provided value and maximum allowed value, respectively.

For the L2CAP Connection Update Request event: The provided timeout is invalid. The timeout field shall have a value in the range of 100 ms to 32 seconds (inclusive).

See the Bluetooth specification, Vol 3, Part A, Section 4.20. Versions 4.1, 4.2 and 5.0.

Inclues the provided value.

For the ATT Find Information Response event: The format code is invalid. Includes the unrecognized byte.

For the ATT Find Information Response event: The format code indicated 16-bit UUIDs, but the packet ends with a partial pair.

For the ATT Find Information Response event: The format code indicated 128-bit UUIDs, but the packet ends with a partial pair.

For the ATT Find by Type Value Response event: The packet ends with a partial attribute pair.

For the ATT Read by Type Response event: The packet ends with a partial attribute handle-value pair.

For the ATT Read by Group Type Response event: The packet ends with a partial attribute data group.

For the GATT Procedure Complete event: The status code was not recognized. Includes the unrecognized byte.

For the ATT Error Response event: The request opcode was not recognized. Includes the unrecognized byte.

For the ATT Error Response event: The error code was not recognized. Includes the unrecognized byte.

For the ATT Read Multiple Permit Request event: The packet ends with a partial attribute handle.

For the HAL Read Config Data command complete event: The returned value has a length that does not correspond to a requested parameter. Known lengths are 1, 2, 6, or 16. Includes the number of bytes returned.

For the HAL Get Link Status command complete event: One of the bytes representing a link state does not represent a known link state. Returns the unknown value.

For the GAP Get Security Level command complete event: One of the boolean values (mitm_protection_required, bonding_required, or out_of_band_data_present) was neither 0 nor 1. The unknown value is provided.

For the GAP Get Security Level command complete event: the pass key requirement field was an invalid value. The unknown byte is provided.

For the GAP Get Bonded Devices command complete event: the packat was not long enough to contain the number of addresses it claimed to contain.

For the GAP Get Bonded Devices command complete event: one of the address type bytes was invalid. Includes the invalid byte.

Trait Implementations

impl Clone for BlueNRGError
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for BlueNRGError
[src]

impl Debug for BlueNRGError
[src]

Formats the value using the given formatter. Read more

impl PartialEq for BlueNRGError
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations