jacdac_rs/brain/brain_error.rs
1use crate::service::serivce_error::ServiceError;
2
3#[derive(Debug)]
4pub enum BrainError {
5 /// The service index is not valid (e.g. there no ith service), the first parameter is the index_service, the second is the number of services
6 InvalidServiceIndex(u8, usize),
7
8 /// The service index is not supported the `str` help to contextualize the error.
9 UnsupportedSericeIndex(&'static str),
10
11 /// The service class is invalid (e.g. Control class, is not allow)
12 InvalidServiceClass,
13
14 /// The service class is not supported
15 NotSupportedServiceClass,
16
17 /// The command packet is not supported. (e.g A brain, or brain device, should not received a command packet.)
18 WrongPacketType,
19
20 /// A service return an error. The parameter is the service error.
21 ServiceError(ServiceError),
22}