/* * IdeasX UART Interface * Author: Tyler Berezowsky * Date: 20170518 */ #include "interface/uart_interface.h" #include "interface/light_interface.h" #include "hal/io.h" #include "hal/lsm6ds3.h" static const char* TAG = "uart_interface.c"; static void show_WiFi_current(void) { struct station_config stationConfig; wifi_station_get_config(&stationConfig); os_printf("SSID: %s\nBSSID: "MACSTR"\n", stationConfig.ssid, MAC2STR(stationConfig.bssid)); // fix MAX2STR error } static void show_WiFi(void) { struct station_config stationConfig[5]; uint8_t num = wifi_station_get_ap_info(stationConfig); os_printf("\n--------Stored Access Points---------\n"); uint32_t i; for (i=0;i> 16) & 0xff))); os_printf("--------Network Status------------\n"); show_IP(); show_WiFi_current(); LSM6DS3_Get_Interrupts(); //os_printf("GPIO Interrupt Mask: %x", ) // print broker information } void process_command(uint8_t *str) { if (!strcmp(str, "AT+RST")) // reset { ESP_LOGI(TAG, "Manual Restarting...\n"); system_restart(); } else if (!strcmp(str, "AT+SD")) // shutdown { ESP_LOGI(TAG, "Manual Shutdown...\n"); Light_Shutdown(); IO_Shutdown(); } else if (!strcmp(str, "AT+INFO")) // print system information { show_info(); } else if (!strcmp(str, "AT+WL")) // list all stored APs { show_WiFi(); } else if (!strncmp(str, "AT+WA", 5)) // add ap { add_ap(str); } else if (!strncmp(str, "AT+WS", 5)) // manually select ap { select_ap(str); } else if (!strcmp(str, "AT+WD")) // delete stored AP { ESP_LOGI(TAG, "N/A\n"); } else if (!strcmp(str, "AT+OTA")) // manually force OTA update { ESP_LOGI(TAG, "N/A\n"); } else if (!strcmp(str, "AT+BS")) // store MQTT broker { ESP_LOGI(TAG, "N/A\n"); } }