Skip to content

Commit

Permalink
Home Accessory Architect v12.13.2 Merlin
Browse files Browse the repository at this point in the history
  • Loading branch information
RavenSystem committed Sep 7, 2024
1 parent 1be2741 commit faf46b1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 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.12.0"INSTALLER_BETA_REVISION
#define INSTALLER_VERSION "7.12.1"INSTALLER_BETA_REVISION

#endif // __HAA_OTA_HEADER_H__
2 changes: 2 additions & 0 deletions HAA/HAA_Main/main/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ FLASH_SPEED = 40

# Max HAA firmware size is 585728 bytes

EXTRA_CFLAGS += -Os
#EXTRA_CFLAGS += -O2 \
# -fpredictive-commoning \
# -ftree-slp-vectorize \
Expand Down Expand Up @@ -107,6 +108,7 @@ EXTRA_CFLAGS += -DconfigTIMER_TASK_STACK_DEPTH=736

## HOMEKIT DEBUG
#EXTRA_CFLAGS += -DHOMEKIT_DEBUG
#EXTRA_CFLAGS += -DHOMEKIT_PAIR_VERIFY_TIME_DEBUG

## mDNS Responder DEBUG
#EXTRA_CFLAGS += -DqDebugLog -DqLogIncoming -DqLogAllTraffic
Expand Down
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.13.1"
#define HAA_FIRMWARE_VERSION "12.13.2"
#define HAA_FIRMWARE_BETA_REVISION "" // Format: "b01"
#define HAA_FIRMWARE_CODENAME "Merlin"

Expand Down
5 changes: 2 additions & 3 deletions HAA/HAA_Main/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3416,7 +3416,7 @@ void hsi2rgbw(uint16_t h, float s, uint8_t v, ch_group_t* ch_group) {
L_DEBUG("d: [%g, %g]", d[0], d[1]);

float mat2[2][2], p5[2], p6[2];
// array_subtract(p5, (LED_RGB + k), d); THIS DOES NOT WORK for this matrix, idk why
array_subtract(p5, *(LED_RGB + k), d);
float new_vertex[2] = { myRGB[k][0], myRGB[k][1] };
array_subtract(p5, new_vertex, d);
array_subtract(p6, vertex, d);
Expand All @@ -3428,10 +3428,9 @@ void hsi2rgbw(uint16_t h, float s, uint8_t v, ch_group_t* ch_group) {
L_DEBUG("p5: [%g, %g]", p5[0], p5[1]);
L_DEBUG("p6: [%g, %g]", p6[0], p6[1]);
L_DEBUG("mat2 = { {%g, %g}, {%g, %g} }", mat2[0][0], mat2[0][1], mat2[1][0], mat2[1][1]);

}

INFO("Chrom %g, %g", p[0], p[1]);
L_DEBUG("Chrom %g, %g", p[0], p[1]);
}

float targetRGB[3];
Expand Down
3 changes: 1 addition & 2 deletions libs/homekit-rsf/include/homekit/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ typedef struct {
bool is_null: 1;
bool is_static: 1;
homekit_format_t format: 4;
int _align: 10;
uint16_t data_size;
uint32_t data_size: 26;
union {
bool bool_value;
int int_value;
Expand Down
20 changes: 18 additions & 2 deletions libs/homekit-rsf/src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ void write_characteristic_json(json_stream *json, client_context_t *client, cons
size_t encoded_data_size = base64_encoded_size(v.data_value, v.data_size);
byte* encoded_data = malloc(encoded_data_size + 1);
if (!encoded_data) {
CLIENT_ERROR(client, "Allocate %d bytes for encoding data", encoded_data_size + 1);
CLIENT_ERROR(client, "Allocate %d bytes for encoding", encoded_data_size + 1);
json_string(json, "");
break;
}
Expand Down Expand Up @@ -1648,6 +1648,10 @@ void homekit_server_on_pair_setup(client_context_t *context, const byte *data, s
}

void homekit_server_on_pair_verify(client_context_t *context, const byte *data, size_t size) {
#ifdef HOMEKIT_PAIR_VERIFY_TIME_DEBUG
uint32_t function_time = sdk_system_get_time_raw();
#endif

HOMEKIT_DEBUG_LOG("Pair Verify");
DEBUG_HEAP();

Expand Down Expand Up @@ -2073,6 +2077,10 @@ void homekit_server_on_pair_verify(client_context_t *context, const byte *data,
#endif // HOMEKIT_OVERCLOCK_PAIR_VERIFY

tlv_free(message);

#ifdef HOMEKIT_PAIR_VERIFY_TIME_DEBUG
CLIENT_INFO(context, "Verify Time %d", sdk_system_get_time_raw() - function_time);
#endif
}


Expand Down Expand Up @@ -2691,7 +2699,7 @@ void homekit_server_on_update_characteristics(client_context_t *context, const b
// Default max data len = 2,097,152 but that does not make sense
// for this accessory
#ifndef HOMEKIT_DISABLE_MAXLEN_CHECK
unsigned int max_len = (ch->max_data_len) ? *ch->max_data_len : 4096;
unsigned int max_len = (ch->max_data_len) ? *ch->max_data_len : 16384;
#endif //HOMEKIT_DISABLE_MAXLEN_CHECK

char *value = j_value->valuestring;
Expand Down Expand Up @@ -2720,6 +2728,14 @@ void homekit_server_on_update_characteristics(client_context_t *context, const b
CLIENT_DEBUG(context, "for %d.%d", aid, iid);

h_value = HOMEKIT_DATA(data, data_size);
if (ch->setter_ex) {
ch->setter_ex(ch, h_value);
} else {
homekit_value_destruct(&ch->value);
homekit_value_copy(&ch->value, &h_value);
}

free(data);
break;
}
default: {
Expand Down

0 comments on commit faf46b1

Please sign in to comment.