|
|
@ -22,21 +22,23 @@ void key_schedule() |
|
|
|
if (gpio_get_level(KEY_REC) == 0) |
|
|
|
{ |
|
|
|
/* code */ |
|
|
|
char *send_string = "{ \"order\": \"setPosition\", \"index\": 0, \"speedLevel\": 0, \"position\": 360, \"direction\": 1 }"; |
|
|
|
ESP_LOGI("Finny", "KEY_REC level 0"); |
|
|
|
while (gpio_get_level(KEY_REC) == 0) |
|
|
|
{ |
|
|
|
} |
|
|
|
s_ble_gattc_write_char_cb("{ \"order\": \"setPosition\", \"index\": 0, \"speedLevel\": 0, \"position\": 180, \"direction\": 1 }"); |
|
|
|
s_ble_gattc_write_char_cb(send_string, strlen(send_string)); |
|
|
|
ESP_LOGI("Finny", "stop"); |
|
|
|
} |
|
|
|
if (gpio_get_level(KEY_MODE) == 0) |
|
|
|
{ |
|
|
|
char *send_string = "{ \"order\": \"setPosition\", \"index\": 0, \"speedLevel\": 0, \"position\": 360, \"direction\": 1 }"; |
|
|
|
/* code */ |
|
|
|
ESP_LOGI("Finny", "KEY_MODE level 0"); |
|
|
|
while (gpio_get_level(KEY_MODE) == 0) |
|
|
|
{ |
|
|
|
} |
|
|
|
s_ble_gattc_write_char_cb("{ \"order\": \"setPosition\", \"index\": 0, \"speedLevel\": 0, \"position\": 360, \"direction\": 1 }"); |
|
|
|
s_ble_gattc_write_char_cb(send_string, strlen(send_string)); |
|
|
|
ESP_LOGI("Finny", "stop"); |
|
|
|
} |
|
|
|
} |
|
|
|