1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//! Matter TLV encoders and decoders for RVC Operational State Cluster
//! Cluster ID: 0x0061
//!
//! This file is automatically generated from OperationalState_RVC.xml
// Enum definitions
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
#[repr(u8)]
pub enum ErrorState {
/// The device is not in an error state
Noerror = 0,
/// The device is unable to start or resume operation
Unabletostartorresume = 1,
/// The device was unable to complete the current operation
Unabletocompleteoperation = 2,
/// The device cannot process the command in its current state
Commandinvalidinstate = 3,
/// The device has failed to find or reach the charging dock
Failedtofindchargingdock = 64,
/// The device is stuck and requires manual intervention
Stuck = 65,
/// The device has detected that its dust bin is missing
Dustbinmissing = 66,
/// The device has detected that its dust bin is full
Dustbinfull = 67,
/// The device has detected that its clean water tank is empty
Watertankempty = 68,
/// The device has detected that its clean water tank is missing
Watertankmissing = 69,
/// The device has detected that its water tank lid is open
Watertanklidopen = 70,
/// The device has detected that its cleaning pad is missing
Mopcleaningpadmissing = 71,
/// The device is unable to start or to continue operating due to a low battery
Lowbattery = 72,
/// The device is unable to move to an area where it was asked to operate, such as by setting the ServiceArea cluster's SelectedAreas attribute, due to an obstruction. For example, the obstruction might be a closed door or objects blocking the mapped path.
Cannotreachtargetarea = 73,
/// The device has detected that its dirty water tank is full
Dirtywatertankfull = 74,
/// The device has detected that its dirty water tank is missing
Dirtywatertankmissing = 75,
/// The device has detected that one or more wheels are jammed by an object
Wheelsjammed = 76,
/// The device has detected that its brush is jammed by an object
Brushjammed = 77,
/// The device has detected that one of its sensors, such as LiDAR, infrared, or camera is obscured and needs to be cleaned
Navigationsensorobscured = 78,
}
impl ErrorState {
/// Convert from u8 value
pub fn from_u8(value: u8) -> Option<Self> {
match value {
0 => Some(ErrorState::Noerror),
1 => Some(ErrorState::Unabletostartorresume),
2 => Some(ErrorState::Unabletocompleteoperation),
3 => Some(ErrorState::Commandinvalidinstate),
64 => Some(ErrorState::Failedtofindchargingdock),
65 => Some(ErrorState::Stuck),
66 => Some(ErrorState::Dustbinmissing),
67 => Some(ErrorState::Dustbinfull),
68 => Some(ErrorState::Watertankempty),
69 => Some(ErrorState::Watertankmissing),
70 => Some(ErrorState::Watertanklidopen),
71 => Some(ErrorState::Mopcleaningpadmissing),
72 => Some(ErrorState::Lowbattery),
73 => Some(ErrorState::Cannotreachtargetarea),
74 => Some(ErrorState::Dirtywatertankfull),
75 => Some(ErrorState::Dirtywatertankmissing),
76 => Some(ErrorState::Wheelsjammed),
77 => Some(ErrorState::Brushjammed),
78 => Some(ErrorState::Navigationsensorobscured),
_ => None,
}
}
/// Convert to u8 value
pub fn to_u8(self) -> u8 {
self as u8
}
}
impl From<ErrorState> for u8 {
fn from(val: ErrorState) -> Self {
val as u8
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
#[repr(u8)]
pub enum OperationalState {
/// The device is stopped
Stopped = 0,
/// The device is operating
Running = 1,
/// The device is paused during an operation
Paused = 2,
/// The device is in an error state
Error = 3,
/// The device is en route to the charging dock
Seekingcharger = 64,
/// The device is charging
Charging = 65,
/// The device is on the dock, not charging
Docked = 66,
/// The device is automatically emptying its own dust bin, such as to a dock
Emptyingdustbin = 67,
/// The device is automatically cleaning its own mopping device, such as on a dock
Cleaningmop = 68,
/// The device is automatically filling its own clean water tank for use when mopping, such as from a dock
Fillingwatertank = 69,
/// The device is processing acquired data to update its maps
Updatingmaps = 70,
}
impl OperationalState {
/// Convert from u8 value
pub fn from_u8(value: u8) -> Option<Self> {
match value {
0 => Some(OperationalState::Stopped),
1 => Some(OperationalState::Running),
2 => Some(OperationalState::Paused),
3 => Some(OperationalState::Error),
64 => Some(OperationalState::Seekingcharger),
65 => Some(OperationalState::Charging),
66 => Some(OperationalState::Docked),
67 => Some(OperationalState::Emptyingdustbin),
68 => Some(OperationalState::Cleaningmop),
69 => Some(OperationalState::Fillingwatertank),
70 => Some(OperationalState::Updatingmaps),
_ => None,
}
}
/// Convert to u8 value
pub fn to_u8(self) -> u8 {
self as u8
}
}
impl From<OperationalState> for u8 {
fn from(val: OperationalState) -> Self {
val as u8
}
}
// Command encoders