Skip to content

Commit

Permalink
Update for dynamic output buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed Jul 30, 2020
1 parent d0e11c9 commit 3f647fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion mos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
author: 'Deomid "rojer" Ryabkov'
description: A HomeKit firmware for Shelly switches
version: 2.0.10
version: 2.0.11
platform: esp8266

libs_version: latest
Expand Down
12 changes: 3 additions & 9 deletions src/shelly_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
#include "shelly_sw_service.h"

#define KVS_FILE_NAME "kvs.json"
#define NUM_SESSIONS 6
#define IO_BUF_SIZE 1536
#define NUM_SESSIONS 9
#define SCRATCH_BUF_SIZE 1536

#ifndef LED_ON
#define LED_ON 0
Expand All @@ -53,8 +53,7 @@
#endif

static HAPIPSession sessions[NUM_SESSIONS];
static uint8_t out_bufs[NUM_SESSIONS][IO_BUF_SIZE];
static uint8_t scratch_buf[IO_BUF_SIZE];
static uint8_t scratch_buf[SCRATCH_BUF_SIZE];
static HAPIPAccessoryServerStorage s_ip_storage = {
.sessions = sessions,
.numSessions = ARRAY_SIZE(sessions),
Expand Down Expand Up @@ -426,11 +425,6 @@ bool shelly_app_init() {
static const HAPPlatformServiceDiscoveryOptions sd_opts = {};
HAPPlatformServiceDiscoveryCreate(&s_service_discovery, &sd_opts);

for (size_t i = 0; i < ARRAY_SIZE(sessions); i++) {
sessions[i].outboundBuffer.bytes = out_bufs[i];
sessions[i].outboundBuffer.numBytes = sizeof(out_bufs[i]);
}

s_callbacks.handleUpdatedState = shelly_hap_server_state_update_cb;

s_accessory.name = mgos_sys_config_get_device_id();
Expand Down

0 comments on commit 3f647fb

Please sign in to comment.