1use thiserror::Error;
6
7use crate::types::SourceId;
8use bt_common::packet_encoding::Error as PacketError;
9use bt_gatt::types::Error as BTGattError;
10
11#[derive(Debug, Error)]
13pub enum Error {
14 #[error("Service is already published")]
15 AlreadyPublished,
16
17 #[error("Service should support at least one Broadcast Receive State characteristic")]
18 MissingReceiveState,
19
20 #[error("Exceeded maximum number of Broadcast Receive State characteristics (255)")]
21 ExceedsMaxReceiveStates,
22
23 #[error("An unsupported opcode ({0:#x}) used in Control Point operation")]
24 OpCodeNotSupported(u8),
25
26 #[error("Invalid source id ({0}) used in Control Point operation")]
27 InvalidSourceId(SourceId),
28
29 #[error("Packet encoding/decoding error: {0}")]
30 Packet(#[from] PacketError),
31
32 #[error("GATT operation error: {0}")]
33 Gatt(#[from] BTGattError),
34}