Skip to content

Commit

Permalink
Home Accessory Architect v12.13.0 Merlin
Browse files Browse the repository at this point in the history
  • Loading branch information
RavenSystem committed Aug 10, 2024
1 parent 5f5440e commit fb0c91e
Show file tree
Hide file tree
Showing 11 changed files with 189 additions and 128 deletions.
2 changes: 1 addition & 1 deletion HAA/HAA_Installer/main/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
#include "../../common/common_headers.h"

#define INSTALLER_BETA_REVISION "" // Format: "b01"
#define INSTALLER_VERSION "7.11.0"INSTALLER_BETA_REVISION
#define INSTALLER_VERSION "7.12.0"INSTALLER_BETA_REVISION

#endif // __HAA_OTA_HEADER_H__
2 changes: 1 addition & 1 deletion HAA/HAA_Installer/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void init_task() {
//free(running);
#endif

wifi_config_init("HAA", xHandle);
wifi_config_init(xHandle);

vTaskDelete(NULL);
}
Expand Down
38 changes: 22 additions & 16 deletions HAA/HAA_Installer/main/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,12 @@ typedef struct _wifi_network_info {
uint8_t bssid[6];
char rssi[4];
char channel[3];
bool secure;
bool secure; // 1 bit

struct _wifi_network_info *next;
} wifi_network_info_t;

typedef struct {
char* ssid_prefix;
uint32_t max_body_size;

TimerHandle_t auto_reboot_timer;
Expand All @@ -122,7 +121,7 @@ typedef struct {

uint8_t check_counter;

bool end_setup: 1;
bool end_setup; // 1 bit
} wifi_config_context_t;

static wifi_config_context_t* context;
Expand Down Expand Up @@ -760,10 +759,6 @@ static void wifi_config_server_on_settings(client_t *client) {
}

static void wifi_config_context_free(wifi_config_context_t *context) {
if (context->ssid_prefix) {
free(context->ssid_prefix);
}

wifi_networks_free();

free(context);
Expand Down Expand Up @@ -1155,7 +1150,7 @@ static void wifi_config_softap_start() {

softap_config.ap.ssid_len = snprintf(
(char*) softap_config.ap.ssid, sizeof(softap_config.ap.ssid),
"%s-%02X%02X%02X", context->ssid_prefix, macaddr[3], macaddr[4], macaddr[5]
"HAA-%02X%02X%02X", macaddr[3], macaddr[4], macaddr[5]
);

INFO("Wifi AP %s Ch%i", softap_config.ap.ssid, softap_config.ap.channel);
Expand All @@ -1180,7 +1175,7 @@ static void wifi_config_softap_start() {

softap_config.ssid_len = snprintf(
(char*) softap_config.ssid, sizeof(softap_config.ssid),
"%s-%02X%02X%02X", context->ssid_prefix, macaddr[3], macaddr[4], macaddr[5]
"HAA-%02X%02X%02X", macaddr[3], macaddr[4], macaddr[5]
);

INFO("Wifi AP %s Ch%i", softap_config.ssid, softap_config.channel);
Expand Down Expand Up @@ -1226,8 +1221,14 @@ static void wifi_config_sta_connect_timeout_task() {

uint8_t macaddr[6];
sdk_wifi_get_macaddr(STATION_IF, macaddr);
char* setup_hostname = malloc(21);
snprintf(setup_hostname, 21, "HAA-%02X%02X%02X-Installer", macaddr[3], macaddr[4], macaddr[5]);
char* setup_hostname = malloc(22);

#ifdef HAABOOT
snprintf(setup_hostname, 22, "HAA-%02X%02X%02X-InstallerB", macaddr[3], macaddr[4], macaddr[5]);
#else
snprintf(setup_hostname, 22, "HAA-%02X%02X%02X-InstallerM", macaddr[3], macaddr[4], macaddr[5]);
#endif

netif->hostname = setup_hostname;
#endif

Expand Down Expand Up @@ -1456,7 +1457,7 @@ static void wifi_config_station_connect() {
vTaskDelete(NULL);
}

void wifi_config_init(const char *ssid_prefix, TaskHandle_t xHandle) {
void wifi_config_init(TaskHandle_t xHandle) {
INFO("Wifi init");

context = malloc(sizeof(wifi_config_context_t));
Expand All @@ -1465,12 +1466,17 @@ void wifi_config_init(const char *ssid_prefix, TaskHandle_t xHandle) {
#ifdef ESP_PLATFORM
uint8_t macaddr[6];
sdk_wifi_get_macaddr(STATION_IF, macaddr);
char* setup_hostname = malloc(21);
snprintf(setup_hostname, 21, "HAA-%02X%02X%02X-Installer", macaddr[3], macaddr[4], macaddr[5]);
char* setup_hostname = malloc(22);

#ifdef HAABOOT
snprintf(setup_hostname, 22, "HAA-%02X%02X%02X-InstallerB", macaddr[3], macaddr[4], macaddr[5]);
#else
snprintf(setup_hostname, 22, "HAA-%02X%02X%02X-InstallerM", macaddr[3], macaddr[4], macaddr[5]);
#endif

esp_netif_set_hostname(setup_esp_netif, setup_hostname);
free(setup_hostname);
#endif

context->ssid_prefix = strndup(ssid_prefix, 33 - 7);

context->ota_task = xHandle;

Expand Down
2 changes: 1 addition & 1 deletion HAA/HAA_Installer/main/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
void setup_set_esp_netif(esp_netif_t* esp_net_if);
#endif

void wifi_config_init(const char *ssid_prefix, TaskHandle_t xHandle);
void wifi_config_init(TaskHandle_t xHandle);
void setup_mode_reset_sysparam();
2 changes: 1 addition & 1 deletion HAA/HAA_Main/main/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "../../common/common_headers.h"

// Version
#define HAA_FIRMWARE_VERSION "12.12.8"
#define HAA_FIRMWARE_VERSION "12.13.0"
#define HAA_FIRMWARE_BETA_REVISION "" // Format: "b01"
#define HAA_FIRMWARE_CODENAME "Merlin"

Expand Down
Loading

0 comments on commit fb0c91e

Please sign in to comment.