Skip to content

Commit 3f647fb

Browse files
committed
Update for dynamic output buffers
1 parent d0e11c9 commit 3f647fb

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

mos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
author: 'Deomid "rojer" Ryabkov'
22
description: A HomeKit firmware for Shelly switches
3-
version: 2.0.10
3+
version: 2.0.11
44
platform: esp8266
55

66
libs_version: latest

src/shelly_main.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
#include "shelly_sw_service.h"
4343

4444
#define KVS_FILE_NAME "kvs.json"
45-
#define NUM_SESSIONS 6
46-
#define IO_BUF_SIZE 1536
45+
#define NUM_SESSIONS 9
46+
#define SCRATCH_BUF_SIZE 1536
4747

4848
#ifndef LED_ON
4949
#define LED_ON 0
@@ -53,8 +53,7 @@
5353
#endif
5454

5555
static HAPIPSession sessions[NUM_SESSIONS];
56-
static uint8_t out_bufs[NUM_SESSIONS][IO_BUF_SIZE];
57-
static uint8_t scratch_buf[IO_BUF_SIZE];
56+
static uint8_t scratch_buf[SCRATCH_BUF_SIZE];
5857
static HAPIPAccessoryServerStorage s_ip_storage = {
5958
.sessions = sessions,
6059
.numSessions = ARRAY_SIZE(sessions),
@@ -426,11 +425,6 @@ bool shelly_app_init() {
426425
static const HAPPlatformServiceDiscoveryOptions sd_opts = {};
427426
HAPPlatformServiceDiscoveryCreate(&s_service_discovery, &sd_opts);
428427

429-
for (size_t i = 0; i < ARRAY_SIZE(sessions); i++) {
430-
sessions[i].outboundBuffer.bytes = out_bufs[i];
431-
sessions[i].outboundBuffer.numBytes = sizeof(out_bufs[i]);
432-
}
433-
434428
s_callbacks.handleUpdatedState = shelly_hap_server_state_update_cb;
435429

436430
s_accessory.name = mgos_sys_config_get_device_id();

0 commit comments

Comments
 (0)