Network manager implemented and relatively stable

This commit is contained in:
Sebastien L
2021-12-10 13:07:27 -05:00
parent 81756a7649
commit 63fbc2f645
66 changed files with 4528 additions and 2679 deletions

View File

@@ -17,6 +17,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
#include "freertos/task.h"
#include "globdefs.h"
static const char * TAG = "btappcore";
@@ -41,8 +42,7 @@ bool bt_app_work_dispatch(bt_app_cb_t p_cback, uint16_t event, void *p_params, i
if (param_len == 0) {
return bt_app_send_msg(&msg);
} else if (p_params && param_len > 0) {
if ((msg.param = malloc(param_len)) != NULL) {
memcpy(msg.param, p_params, param_len);
if ((msg.param = clone_obj_psram(p_params, param_len)) != NULL) {
/* check if caller has provided a copy callback to do the deep copy */
if (p_copy_cback) {
p_copy_cback(&msg, msg.param, p_params);

View File

@@ -20,6 +20,7 @@
#include "trace.h"
#include "messaging.h"
#include "cJSON.h"
#include "globdefs.h"
static const char * TAG = "bt_app_source";
static const char * BT_RC_CT_TAG="RCCT";
@@ -226,8 +227,8 @@ void hal_bluetooth_init(const char * options)
squeezelite_args.end = arg_end(2);
ESP_LOGD(TAG,"Copying parameters");
char * opts = strdup(options);
char **argv = malloc(sizeof(char**)*15);
char * opts = strdup_psram(options);
char **argv = malloc_init_external(sizeof(char**)*15);
size_t argv_size=15;
@@ -254,7 +255,7 @@ void hal_bluetooth_init(const char * options)
ESP_LOGW(TAG,"Unable to retrieve the a2dp sink name from nvs.");
}
} else {
squeezelite_conf.sink_name=strdup(squeezelite_args.sink_name->sval[0]);
squeezelite_conf.sink_name=strdup_psram(squeezelite_args.sink_name->sval[0]);
// sync with NVS
esp_err_t err=ESP_OK;
if((err= config_set_value(NVS_TYPE_STR, "a2dp_sink_name", squeezelite_args.sink_name->sval[0]))!=ESP_OK){