Просмотр исходного кода

Add image to BLE peripheral scene

Eric Betts 9 месяцев назад
Родитель
Сommit
190ba1dc6e
1 измененных файлов с 11 добавлено и 7 удалено
  1. 11 7
      scenes/seos_scene_ble_peripheral.c

+ 11 - 7
scenes/seos_scene_ble_peripheral.c

@@ -9,8 +9,12 @@ void seos_scene_ble_peripheral_on_enter(void* context) {
 
     // Setup view
     Popup* popup = seos->popup;
-    popup_set_header(popup, "Starting", 68, 20, AlignLeft, AlignTop);
-    // popup_set_icon(popup, 0, 3, &I_RFIDDolphinReceive_97x61);
+    popup_set_header(popup, "Starting", 68, 30, AlignLeft, AlignTop);
+    if(seos->flow_mode == FLOW_READER) {
+        popup_set_icon(popup, 0, 3, &I_RFIDDolphinReceive_97x61);
+    } else if(seos->flow_mode == FLOW_CRED) {
+        popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61);
+    }
 
     if(seos->has_external_ble) {
         seos->seos_characteristic = seos_characteristic_alloc(seos);
@@ -39,19 +43,19 @@ bool seos_scene_ble_peripheral_on_event(void* context, SceneManagerEvent event)
             scene_manager_next_scene(seos->scene_manager, SeosSceneReadError);
             consumed = true;
         } else if(event.event == SeosCustomEventHCIInit) {
-            popup_set_header(popup, "Init", 68, 20, AlignLeft, AlignTop);
+            popup_set_header(popup, "Init", 68, 30, AlignLeft, AlignTop);
             consumed = true;
         } else if(event.event == SeosCustomEventAdvertising) {
-            popup_set_header(popup, "Advertising", 68, 20, AlignLeft, AlignTop);
+            popup_set_header(popup, "Advertising", 68, 30, AlignLeft, AlignTop);
             consumed = true;
         } else if(event.event == SeosCustomEventConnected) {
-            popup_set_header(popup, "Connected", 68, 20, AlignLeft, AlignTop);
+            popup_set_header(popup, "Connected", 68, 30, AlignLeft, AlignTop);
             consumed = true;
         } else if(event.event == SeosCustomEventAuthenticated) {
-            popup_set_header(popup, "Auth'd", 68, 20, AlignLeft, AlignTop);
+            popup_set_header(popup, "Auth'd", 68, 30, AlignLeft, AlignTop);
             consumed = true;
         } else if(event.event == SeosCustomEventSIORequested) {
-            popup_set_header(popup, "SIO\nRequested", 68, 20, AlignLeft, AlignTop);
+            popup_set_header(popup, "SIO\nRequested", 68, 30, AlignLeft, AlignTop);
             consumed = true;
         }
     } else if(event.type == SceneManagerEventTypeBack) {