Browse code

adding vibration

louis.jonget authored on24/03/2023 10:18:31
Showing2 changed files
1 1
Binary files a/build/synocam_home_switch.pbw and b/build/synocam_home_switch.pbw differ
... ...
@@ -265,6 +265,9 @@ static void inbox_received_callback(DictionaryIterator *iter, void *context) {
265 265
     strncpy(s_auth, auth_tuple->value->cstring, 60);
266 266
     // Display in the TextLayer
267 267
     text_layer_set_text(s_text_layer, s_auth);
268
+    if(strcmp(s_auth, "Authentication failed")==0){
269
+      vibes_long_pulse();
270
+    }
268 271
     APP_LOG(APP_LOG_LEVEL_DEBUG, "Auth message received ... ");
269 272
   }else{
270 273
     APP_LOG(APP_LOG_LEVEL_DEBUG, "not auth message... ");
... ...
@@ -277,6 +280,13 @@ static void inbox_received_callback(DictionaryIterator *iter, void *context) {
277 280
     strncpy(s_api, api_tuple->value->cstring, 40);
278 281
     // Display in the TextLayer
279 282
     text_layer_set_text(s_text_layer, s_api);
283
+    if(strcmp(s_api, "Home mode is ON (camera is off)")==0){
284
+      vibes_short_pulse();
285
+    }else if(strcmp(s_api, "Home mode is OFF (camera is on)")==0){
286
+      vibes_double_pulse();
287
+    }else if(strcmp(s_api,"Time out too many times, verify settings")==0){
288
+      vibes_long_pulse();
289
+    }
280 290
     APP_LOG(APP_LOG_LEVEL_DEBUG, "status message received ... ");
281 291
   }else{
282 292
     APP_LOG(APP_LOG_LEVEL_DEBUG, "not status message... ");