pub struct DeviceConfig {
pub role: i32,
pub serial_enabled: bool,
pub button_gpio: u32,
pub buzzer_gpio: u32,
pub rebroadcast_mode: i32,
pub node_info_broadcast_secs: u32,
pub double_tap_as_button_press: bool,
pub is_managed: bool,
pub disable_triple_click: bool,
pub tzdef: String,
pub led_heartbeat_disabled: bool,
pub buzzer_mode: i32,
}Expand description
Configuration
Fields§
§role: i32Sets the role of node
serial_enabled: boolDisabling this will disable the SerialConsole by not initilizing the StreamAPI Moved to SecurityConfig
For boards without a hard wired button, this is the pin number that will be used Boards that have more than one button can swap the function with this one. defaults to BUTTON_PIN if defined.
buzzer_gpio: u32For boards without a PWM buzzer, this is the pin number that will be used Defaults to PIN_BUZZER if defined.
rebroadcast_mode: i32Sets the role of node
node_info_broadcast_secs: u32Send our nodeinfo this often Defaults to 900 Seconds (15 minutes)
Treat double tap interrupt on supported accelerometers as a button press if set to true
is_managed: boolIf true, device is considered to be “managed” by a mesh administrator Clients should then limit available configuration and administrative options inside the user interface Moved to SecurityConfig
disable_triple_click: boolDisables the triple-press of user button to enable or disable GPS
tzdef: StringPOSIX Timezone definition string from https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv.
led_heartbeat_disabled: boolIf true, disable the default blinking LED (LED_PIN) behavior on the device
buzzer_mode: i32Controls buzzer behavior for audio feedback Defaults to ENABLED
Implementations§
Source§impl DeviceConfig
impl DeviceConfig
Sourcepub fn role(&self) -> Role
pub fn role(&self) -> Role
Returns the enum value of role, or the default if the field is set to an invalid enum value.
Sourcepub fn rebroadcast_mode(&self) -> RebroadcastMode
pub fn rebroadcast_mode(&self) -> RebroadcastMode
Returns the enum value of rebroadcast_mode, or the default if the field is set to an invalid enum value.
Sourcepub fn set_rebroadcast_mode(&mut self, value: RebroadcastMode)
pub fn set_rebroadcast_mode(&mut self, value: RebroadcastMode)
Sets rebroadcast_mode to the provided enum value.
Sourcepub fn buzzer_mode(&self) -> BuzzerMode
pub fn buzzer_mode(&self) -> BuzzerMode
Returns the enum value of buzzer_mode, or the default if the field is set to an invalid enum value.
Sourcepub fn set_buzzer_mode(&mut self, value: BuzzerMode)
pub fn set_buzzer_mode(&mut self, value: BuzzerMode)
Sets buzzer_mode to the provided enum value.
Trait Implementations§
Source§impl Clone for DeviceConfig
impl Clone for DeviceConfig
Source§fn clone(&self) -> DeviceConfig
fn clone(&self) -> DeviceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeviceConfig
impl Debug for DeviceConfig
Source§impl Default for DeviceConfig
impl Default for DeviceConfig
Source§impl<'de> Deserialize<'de> for DeviceConfig
impl<'de> Deserialize<'de> for DeviceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for DeviceConfig
impl Hash for DeviceConfig
Source§impl Message for DeviceConfig
impl Message for DeviceConfig
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for DeviceConfig
impl PartialEq for DeviceConfig
Source§fn eq(&self, other: &DeviceConfig) -> bool
fn eq(&self, other: &DeviceConfig) -> bool
self and other values to be equal, and is used by ==.