Temporary fix to wrong response format
authorMichal Skorupinski <m.skorupinsk@samsung.com>
Fri, 30 Nov 2018 21:32:33 +0000 (22:32 +0100)
committerMichal Skorupinski <m.skorupinsk@samsung.com>
Fri, 30 Nov 2018 21:32:33 +0000 (22:32 +0100)
Change-Id: Ibaa6fd75276e1749fd0e4f1da2c4df846a1499be
Signed-off-by: Michal Skorupinski <m.skorupinsk@samsung.com>
src/cloud/cloud_request.c
src/resource/resource_led.c

index 243b78f..080edb9 100644 (file)
@@ -167,7 +167,7 @@ static void car_api_post_task_ready_cb(GObject *source_object, GAsyncResult *res
     }
     car_api_post_request_context_t *context = g_task_get_task_data(task);
 
-    request_result_e result = (response->response_code == 200 && (strcmp(response->response_msg, "Success") == 0)) ?
+    request_result_e result = (response->response_code == 200 /*&& (strcmp(response->response_msg, "Success") == 0)*/) ?
         SUCCESS :
         FAILURE;
 
index 1de1ea1..1640343 100644 (file)
@@ -67,6 +67,7 @@ typedef struct _led_s {
        int use_bi_led;
        int use_rgb_gpio;
        int use_rgb_l2c;
+       bool is_in_blink_mode;
 } led_s;
 
 static led_s s_info = {
@@ -118,6 +119,10 @@ static inline void _led_bi_set(bi_led_color_e color, bool store_current_color)
                        break;
        }
 
+       if(s_info.is_in_blink_mode) {
+               return;
+       }
+
        int ret = peripheral_gpio_write(s_info.gpio_bi_led[LED_COLOR_RED], red);
        ret_error_message(ret != PERIPHERAL_ERROR_NONE, ret);
 
@@ -148,6 +153,10 @@ static inline void _rgb_gpio_set(bool red, bool green, bool blue, bool store_cur
        }
        _D("RGB GPIO: [%d, %d, %d]", red, green, blue);
 
+       if(s_info.is_in_blink_mode) {
+               return;
+       }
+
        int ret = peripheral_gpio_write(s_info.rgb_gpio[0], red);
        ret_error_message(ret != PERIPHERAL_ERROR_NONE, ret);
 
@@ -179,6 +188,10 @@ static inline void _rgb_l2c_set(int red, int green, int blue, bool store_current
                s_info.current_rgb_l2c_color[2] = blue;
        }
 
+       if(s_info.is_in_blink_mode) {
+               return;
+       }
+
        int ret = resource_pca9685_set_value_to_channel(DEFAULT_RGB_L2C_R, 0, RGB_TO_REGISTER(red));
        ret_error_message(ret != PERIPHERAL_ERROR_NONE, ret);
 
@@ -215,7 +228,7 @@ static gboolean _restore_rgb_l2c_color_cb(gpointer data)
 static gboolean _restore_rgb_color_cb(gpointer data)
 {
        FUNCTION_START;
-
+       s_info.is_in_blink_mode = false;
        _restore_bi_color_cb(data);
        _restore_rgb_gpio_color_cb(data);
        _restore_rgb_l2c_color_cb(data);
@@ -388,6 +401,7 @@ void resource_led_blink_rgb_colors(char *key,
        FUNCTION_START;
 
        _set_rgb(key, false, def_r_3bit, def_g_3bit, def_b_3bit, def_r_24bit, def_g_24bit, def_b_24bit, bi_led);
+       s_info.is_in_blink_mode = true;
        g_timeout_add(timeout, _restore_rgb_color_cb, NULL);