@@ -141,20 +141,25 @@ static void send_location_search_done(void)
141
141
TEST_ASSERT_EQUAL (0 , err );
142
142
}
143
143
144
- /*
145
- static void send_config(uint64_t interval)
144
+ static void twelve_hour_interval_set (void )
146
145
{
146
+ // MISSING: set interval for 12 hours, or even different intervals.
147
+
147
148
const struct cloud_msg msg = {
148
149
.type = CLOUD_SHADOW_RESPONSE ,
149
- .response.buffer = "{\"update_interval\": 60}",
150
- .response.buffer_data_len = strlen("{\"update_interval\": 60}"),
150
+ /* JSON equivalent string: "{"config":{"update_interval": 60 }}" */
151
+ .response .buffer = {
152
+ 0xA1 , 0x66 , 0x63 , 0x6F , 0x6E , 0x66 , 0x69 , 0x67 , 0xA1 ,
153
+ 0x6F , 0x75 , 0x70 , 0x64 , 0x61 , 0x74 , 0x65 , 0x5F , 0x69 ,
154
+ 0x6E , 0x74 , 0x65 , 0x72 , 0x76 , 0x61 , 0x6C , 0x18 , 0x3C
155
+ },
156
+ .response .buffer_data_len = 27 ,
151
157
};
152
158
153
- int err = zbus_chan_pub(&CLOUD_CHAN, &shadow_response , K_SECONDS(1));
159
+ int err = zbus_chan_pub (& CLOUD_CHAN , & msg , K_SECONDS (1 ));
154
160
155
161
TEST_ASSERT_EQUAL (0 , err );
156
162
}
157
- */
158
163
159
164
static void send_cloud_disconnected (void )
160
165
{
@@ -215,11 +220,10 @@ void test_button_press_on_disconnected(void)
215
220
check_no_events (7200 );
216
221
}
217
222
218
- /*
219
223
void test_trigger_interval_change_in_connected (void )
220
224
{
221
225
send_cloud_connected_ready_to_send ();
222
- send_config(HOUR_IN_SECONDS * 12 );
226
+ twelve_hour_interval_set ( );
223
227
224
228
for (int i = 0 ; i < 10 ; i ++ ) {
225
229
send_location_search_done ();
@@ -231,13 +235,11 @@ void test_trigger_interval_change_in_connected(void)
231
235
send_cloud_disconnected ();
232
236
check_no_events (WEEK_IN_SECONDS );
233
237
}
234
- */
235
238
236
- /*
237
239
void test_trigger_disconnect_and_connect_when_triggering (void )
238
240
{
239
241
send_cloud_connected_ready_to_send ();
240
- send_config(HOUR_IN_SECONDS * 12 );
242
+ twelve_hour_interval_set ( );
241
243
242
244
for (int i = 0 ; i < 10 ; i ++ ) {
243
245
@@ -256,7 +258,6 @@ void test_trigger_disconnect_and_connect_when_triggering(void)
256
258
send_cloud_disconnected ();
257
259
check_no_events (WEEK_IN_SECONDS );
258
260
}
259
- */
260
261
261
262
/* This is required to be added to each test. That is because unity's
262
263
* main may return nonzero, while zephyr's main currently must
0 commit comments