headless-server: LED update for client 80/207180/1
authorlsj119 <lsj119@samsung.com>
Fri, 3 May 2019 07:20:06 +0000 (16:20 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 30 May 2019 08:34:06 +0000 (17:34 +0900)
Change-Id: I7d5c52bd9ea22e285cbf76710e41b9c35547f30f

src/bin/headless/output/output_led.c

index 1a2198d..50116e1 100644 (file)
@@ -186,6 +186,21 @@ struct pepper_output_backend led_output_backend = {
 static void
 led_output_update_led(led_output_t *output, unsigned char *data)
 {
+       int i;
+       uint8_t *ptr = (uint8_t *)data;
+
+       if (data == NULL) {
+               PEPPER_TRACE("[OUTPUT] update LED to empty\n");
+               HL_UI_LED_Clear_All(output->ui_led);
+               return;
+       }
+
+       for(i=0; i<output->num_led; i++) {
+               HL_UI_LED_Set_Pixel_RGB(output->ui_led, i, ptr[R_OFF_SET], ptr[G_OFF_SET], ptr[B_OFF_SET]);
+               ptr += 4;
+       }
+
+       HL_UI_LED_Refresh(output->ui_led);
 }
 
 static void