@@ -17,6 +17,7 @@ pub struct Configuration {
17
17
pub mesh : Mesh ,
18
18
pub backend : Backend ,
19
19
pub mappings : Mappings ,
20
+ pub events : Events ,
20
21
}
21
22
22
23
impl Configuration {
@@ -56,8 +57,6 @@ impl Default for Logging {
56
57
#[ serde( default ) ]
57
58
pub struct Mesh {
58
59
pub signing_key : Aes128Key ,
59
- #[ serde( with = "humantime_serde" ) ]
60
- pub heartbeat_interval : Duration ,
61
60
pub frequencies : Vec < u32 > ,
62
61
pub data_rate : DataRate ,
63
62
pub tx_power : i32 ,
@@ -72,7 +71,6 @@ impl Default for Mesh {
72
71
fn default ( ) -> Self {
73
72
Mesh {
74
73
signing_key : Aes128Key :: null ( ) ,
75
- heartbeat_interval : Duration :: from_secs ( 300 ) ,
76
74
frequencies : vec ! [ 868100000 , 868300000 , 868500000 ] ,
77
75
data_rate : DataRate {
78
76
modulation : Modulation :: LORA ,
@@ -155,6 +153,21 @@ pub struct DataRate {
155
153
pub bitrate : u32 ,
156
154
}
157
155
156
+ #[ derive( Serialize , Deserialize , PartialEq , Eq ) ]
157
+ #[ serde( default ) ]
158
+ pub struct Events {
159
+ #[ serde( with = "humantime_serde" ) ]
160
+ pub heartbeat_interval : Duration ,
161
+ }
162
+
163
+ impl Default for Events {
164
+ fn default ( ) -> Self {
165
+ Events {
166
+ heartbeat_interval : Duration :: from_secs ( 300 ) ,
167
+ }
168
+ }
169
+ }
170
+
158
171
#[ derive( Serialize , Deserialize , Clone , Copy , PartialEq , Eq , Default ) ]
159
172
#[ allow( non_camel_case_types) ]
160
173
#[ allow( clippy:: upper_case_acronyms) ]
0 commit comments