Skip to content

Commit

Permalink
Use strong typing for roles in the events
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Sep 19, 2024
1 parent c29b98f commit e8fb2ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1332,8 +1332,8 @@ pub enum ThreadEvent {
/// Thread role changed
#[cfg(not(esp_idf_version_major = "4"))]
RoleChanged {
current_role: otDeviceRole,
previous_role: otDeviceRole,
current_role: Role,
previous_role: Role,
},
/// Thread network interface up
IfUp,
Expand Down Expand Up @@ -1425,8 +1425,8 @@ impl EspEventDeserializer for ThreadEvent {
.unwrap();

ThreadEvent::RoleChanged {
current_role: payload.current_role,
previous_role: payload.previous_role,
current_role: payload.current_role.into(),
previous_role: payload.previous_role.into(),
}
}
esp_openthread_event_t_OPENTHREAD_EVENT_IF_UP => ThreadEvent::IfUp,
Expand Down

0 comments on commit e8fb2ec

Please sign in to comment.