Skip to content

Commit

Permalink
Home Accessory Architect v12.12.7 Merlin
Browse files Browse the repository at this point in the history
  • Loading branch information
RavenSystem committed Jun 19, 2024
1 parent aaae91c commit 3a94641
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 132 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.10.5"INSTALLER_BETA_REVISION
#define INSTALLER_VERSION "7.11.0"INSTALLER_BETA_REVISION

#endif // __HAA_OTA_HEADER_H__
47 changes: 19 additions & 28 deletions HAA/HAA_Installer/main/ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ static int ota_connect(char* host, uint16_t port, int *socket, WOLFSSL** ssl, co

INFO_NNL("OK\nSSLConnect..");

vTaskDelay(50 / portTICK_PERIOD_MS);
vTaskDelay(30 / portTICK_PERIOD_MS);
ret = wolfSSL_connect(*ssl);
vTaskDelay(50 / portTICK_PERIOD_MS);
vTaskDelay(30 / portTICK_PERIOD_MS);

if (ret != SSL_SUCCESS) {
freeaddrinfo(res);
Expand Down Expand Up @@ -568,6 +568,7 @@ static int ota_get_file_ex(char* repo, char* file, int sector, uint8_t* buffer,
connection_tries = 0;
while (collected < length && connection_tries < MAX_DOWNLOAD_FILE_TRIES) {
last_collected = collected;
writespace = 0;

snprintf(recv_buf, RECV_BUF_LEN - 1, REQUESTHEAD"%s"REQUESTTAIL"%s"RANGE"%d-%d%s", last_location, last_host, collected, collected + 4095, CRLFCRLF);

Expand All @@ -587,13 +588,13 @@ static int ota_get_file_ex(char* repo, char* file, int sector, uint8_t* buffer,
//wolfSSL_Debugging_ON();
do {
if (is_ssl) {
vTaskDelay(50 / portTICK_PERIOD_MS);
vTaskDelay(30 / portTICK_PERIOD_MS);
ret = wolfSSL_read(ssl, recv_buf, RECV_BUF_LEN - 1);
vTaskDelay(50 / portTICK_PERIOD_MS);
vTaskDelay(30 / portTICK_PERIOD_MS);
} else {
ret = lwip_read(socket, recv_buf, RECV_BUF_LEN - 1);
}

if (ret > 0) {
if (header) {
//INFO("--------\n%s\n-------- %d", recv_buf, ret);
Expand Down Expand Up @@ -708,22 +709,18 @@ static int ota_get_file_ex(char* repo, char* file, int sector, uint8_t* buffer,

} else {
ERROR("Read %i", ret);

if (is_ssl) {
ret = wolfSSL_get_error(ssl, ret);
wolfSSL_free(ssl);
ERROR("SSL %d", ret);
}

if (!ret && collected < length) {
free(recv_buf);
if (is_ssl) {
wolfSSL_free(ssl);
}
lwip_close(socket);
vTaskDelay(1000 / portTICK_PERIOD_MS);
ota_conn_result = new_connection();
recv_buf = malloc(RECV_BUF_LEN);
}
lwip_close(socket);
vTaskDelay(1000 / portTICK_PERIOD_MS);
ota_conn_result = new_connection();

connection_tries++;
collected = last_collected;
break;
}
Expand All @@ -740,24 +737,18 @@ static int ota_get_file_ex(char* repo, char* file, int sector, uint8_t* buffer,

} else {
ERROR("Write %i", ret);

if (is_ssl) {
ret = wolfSSL_get_error(ssl, ret);
wolfSSL_free(ssl);
ERROR("SSL %d", ret);
}

if (ret == -308) {
free(recv_buf);
if (is_ssl) {
wolfSSL_free(ssl);
}
lwip_close(socket);
vTaskDelay(1000 / portTICK_PERIOD_MS);
ota_conn_result = new_connection();
recv_buf = malloc(RECV_BUF_LEN);
} else {
connection_tries = MAX_DOWNLOAD_FILE_TRIES;
break;
}
lwip_close(socket);
vTaskDelay(1000 / portTICK_PERIOD_MS);
ota_conn_result = new_connection();

connection_tries++;
}

if (ota_conn_result != 0) {
Expand Down
18 changes: 9 additions & 9 deletions 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.6"
#define HAA_FIRMWARE_VERSION "12.12.7"
#define HAA_FIRMWARE_BETA_REVISION "" // Format: "b01"
#define HAA_FIRMWARE_CODENAME "Merlin"

Expand Down Expand Up @@ -433,21 +433,21 @@
#define WINDOW_COVER_TIME_DEFAULT (15)
#define WINDOW_COVER_CORRECTION_SET "f"
#define WINDOW_COVER_CORRECTION_DEFAULT (0)
#define WINDOW_COVER_TIMER_WORKER_PERIOD_MS (250)
#define WINDOW_COVER_TIMER_WORKER_PERIOD_MS (200)
#define WINDOW_COVER_MARGIN_SYNC_SET "m"
#define WINDOW_COVER_MARGIN_SYNC_DEFAULT (10)
#define WINDOW_COVER_TIME_OPEN ch_group->num_f[0]
#define WINDOW_COVER_TIME_CLOSE ch_group->num_f[1]
#define WINDOW_COVER_MARGIN_SYNC_DEFAULT (5)
#define WINDOW_COVER_TIME_OPEN_STEP ch_group->num_f[0]
#define WINDOW_COVER_TIME_CLOSE_STEP ch_group->num_f[1]
#define WINDOW_COVER_MOTOR_POSITION ch_group->num_f[2]
#define WINDOW_COVER_LAST_TIME ch_group->num_f[3]
#define WINDOW_COVER_HOMEKIT_POSITION ch_group->num_f[4]
#define WINDOW_COVER_HOMEKIT_POSITION ch_group->num_f[3]
#define WINDOW_COVER_MARGIN_SYNC ch_group->num_i[0]
#define WINDOW_COVER_CORRECTION ch_group->num_i[1]
#define WINDOW_COVER_STOP_ENABLE ch_group->num_i[2]
#define WINDOW_COVER_STOP_ENABLE_DELAY_MS (80)
#define WINDOW_COVER_VIRTUAL_STOP ch_group->num_i[3]
#define WINDOW_COVER_SEND_CUR_POS_COUNTER ch_group->num_i[4]
#define WINDOW_COVER_SEND_CUR_POS_MAX (1000 / WINDOW_COVER_TIMER_WORKER_PERIOD_MS) // Send every 1000ms
#define WINDOW_COVER_MUST_STOP ch_group->num_i[5]
#define WINDOW_COVER_SEND_CUR_POS_MAX (2200 / WINDOW_COVER_TIMER_WORKER_PERIOD_MS) // Send every 2200ms
#define WINDOW_COVER_CH_CURRENT_POSITION ch_group->ch[0]
#define WINDOW_COVER_CH_TARGET_POSITION ch_group->ch[1]
#define WINDOW_COVER_CH_STATE ch_group->ch[2]
Expand Down Expand Up @@ -809,7 +809,7 @@
#define STATUS_LED_DURATION_OFF (120)

#define SAVE_STATES_DELAY_MS (3000)
#define RANDOM_DELAY_MS (4500)
#define RANDOM_DELAY_MS (3500)

#define HOMEKIT_RE_PAIR_TIME_MS (300000)

Expand Down
Loading

0 comments on commit 3a94641

Please sign in to comment.