Pulled in the latest SystemK (with new BLE). (#2)
The new spec is here: [KTag Beacon Specification v0.11](https://ktag.clubk.club/Technology/BLE/KTag%20Beacon%20Specification%20v0.11.pdf) Co-authored-by: Joe Kearney <joe@clubk.club> Reviewed-on: #2
This commit is contained in:
parent
af01bfed91
commit
7a7ce06d66
46 changed files with 2364 additions and 1531 deletions
|
@ -37,11 +37,11 @@ This software in turn makes use of the following open-source software libraries
|
|||
| Name | Version | License ([SPDX](https://spdx.org/licenses/)) | URL
|
||||
|----------------------------|--------:|--------------------------------------------------------------------------|---------------------------------------------
|
||||
| SystemK | 1.0 | [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html) | https://git.ktag.clubk.club/Software/SystemK/
|
||||
| ESP-IDF | 5.4.0 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://github.com/espressif/esp-idf/
|
||||
| ESP-IDF | 5.4.1 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://github.com/espressif/esp-idf/
|
||||
| espressif/button | 3.5.0 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/espressif/button
|
||||
| espressif/led_strip | 2.5.3 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/espressif/led_strip
|
||||
| espressif/usb_host_msc | 1.1.3 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/espressif/usb_host_msc
|
||||
| espressif/mdns | 1.4.3 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/espressif/mdns
|
||||
| espressif/mdns | 1.8.2 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/espressif/mdns
|
||||
| chmorgan/esp-audio-player | 1.0.7 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/chmorgan/esp-audio-player
|
||||
| esp-libhelix-mp3 | 1.0.3 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://github.com/chmorgan/esp-libhelix-mp3
|
||||
| libhelix-mp3 | f443079 | [RPSL](https://github.com/chmorgan/libhelix-mp3/blob/master/LICENSE.txt) | https://github.com/chmorgan/libhelix-mp3/
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
static const char *TAG = "BLE";
|
||||
static bool Host_And_Controller_Synced = false;
|
||||
static bool Is_Scanning_And_Advertising = false;
|
||||
static bool Is_Scanning = false;
|
||||
static bool Is_Advertising = false;
|
||||
|
||||
static uint8_t Advertising_Data[BLE_KTAG_PACKET_TOTAL_SIZE] = {0x1E, 0xFF, 0xFF, 0xFF, 'K', 'T', 'a', 'g'};
|
||||
|
||||
|
@ -247,7 +248,7 @@ SystemKResult_T BLE_SetAdvertisingData(BLE_AdvertisingData_T *data)
|
|||
memcpy(Advertising_Data, data, BLE_KTAG_PACKET_TOTAL_SIZE);
|
||||
}
|
||||
|
||||
if (Is_Scanning_And_Advertising == true)
|
||||
if (Is_Advertising == true)
|
||||
{
|
||||
// Restart advertising to put the new data into the advertisement.
|
||||
ble_gap_adv_stop();
|
||||
|
@ -263,11 +264,32 @@ SystemKResult_T BLE_ScanAndAdvertise(void)
|
|||
|
||||
if (Host_And_Controller_Synced == true)
|
||||
{
|
||||
if (Is_Scanning_And_Advertising == false)
|
||||
if (Is_Scanning == false)
|
||||
{
|
||||
ble_scan();
|
||||
Is_Scanning = true;
|
||||
}
|
||||
if (Is_Advertising == false)
|
||||
{
|
||||
ble_advertise();
|
||||
Is_Scanning_And_Advertising = true;
|
||||
Is_Advertising = true;
|
||||
}
|
||||
result = SYSTEMK_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SystemKResult_T BLE_StopAdvertising(void)
|
||||
{
|
||||
SystemKResult_T result = SYSTEMK_RESULT_NOT_READY;
|
||||
|
||||
if (Host_And_Controller_Synced == true)
|
||||
{
|
||||
if (Is_Advertising == true)
|
||||
{
|
||||
ble_gap_adv_stop();
|
||||
Is_Advertising = false;
|
||||
}
|
||||
result = SYSTEMK_RESULT_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,25 @@
|
|||
/*
|
||||
* This program source code file is part of the KTag project, a DIY laser tag
|
||||
* game with customizable features and wide interoperability.
|
||||
*
|
||||
* 🛡️ <https://ktag.clubk.club> 🃞
|
||||
*
|
||||
* Copyright © 2024-2025 Joseph P. Kearney and the KTag developers.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License as published by the Free
|
||||
* Software Foundation, either version 3 of the License, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* There should be a copy of the GNU Affero General Public License in the LICENSE
|
||||
* file in the root of this repository. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <SystemK.h>
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/rmt_tx.h>
|
||||
|
@ -53,6 +75,11 @@ static TimedPulseTrain_T Left_Rxd_RMT_Data;
|
|||
static TimedPulseTrain_T Forward_Rxd_RMT_Data;
|
||||
static TimedPulseTrain_T Right_Rxd_RMT_Data;
|
||||
|
||||
volatile TickType_t Last_Time_Checked_In_Ticks = 0;
|
||||
TagSensorLocation_T Active_Tag_Sensor = TAG_SENSOR_NONE;
|
||||
SemaphoreHandle_t Tag_Sensor_Mutex;
|
||||
static const TickType_t LOCKOUT_TIME_IN_TICKS = pdMS_TO_TICKS(100);
|
||||
|
||||
#define IR_RX_STACK_SIZE 4096
|
||||
static StaticTask_t xTaskBuffer;
|
||||
static StackType_t xStack[IR_RX_STACK_SIZE];
|
||||
|
@ -66,14 +93,45 @@ typedef struct
|
|||
TagSensorLocation_T location;
|
||||
} RxNotification_T;
|
||||
|
||||
// Prevent double-receiving (or triple-receiving!) IR packets by locking out the other sensors for a short time once one sensor becomes active.
|
||||
// A sensor is allowed if it is the already-active sensor or the lockout period has expired.
|
||||
static BaseType_t Is_Sensor_Allowed(TagSensorLocation_T sensor_location, BaseType_t *xHigherPriorityTaskWoken)
|
||||
{
|
||||
BaseType_t is_allowed = pdFALSE;
|
||||
TickType_t current_time_in_ticks = xTaskGetTickCountFromISR();
|
||||
|
||||
if (xSemaphoreTakeFromISR(Tag_Sensor_Mutex, xHigherPriorityTaskWoken) == pdTRUE)
|
||||
{
|
||||
if ((Active_Tag_Sensor != TAG_SENSOR_NONE) && (Active_Tag_Sensor != sensor_location) &&
|
||||
((current_time_in_ticks - Last_Time_Checked_In_Ticks) < LOCKOUT_TIME_IN_TICKS))
|
||||
{
|
||||
// We're in lockout period and this is not the active sensor--ignore this sensor.
|
||||
is_allowed = pdFALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// It's OK to allow this sensor.
|
||||
Active_Tag_Sensor = sensor_location;
|
||||
Last_Time_Checked_In_Ticks = current_time_in_ticks;
|
||||
is_allowed = pdTRUE;
|
||||
}
|
||||
|
||||
xSemaphoreGiveFromISR(Tag_Sensor_Mutex, xHigherPriorityTaskWoken);
|
||||
}
|
||||
|
||||
return is_allowed;
|
||||
}
|
||||
|
||||
static bool RMT_Rx_Left_Done_Callback(rmt_channel_handle_t channel, const rmt_rx_done_event_data_t *edata, void *user_data)
|
||||
{
|
||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||
RxNotification_T notice;
|
||||
|
||||
notice.count = edata->num_symbols * 2;
|
||||
notice.location = TAG_SENSOR_LEFT;
|
||||
if (Is_Sensor_Allowed(TAG_SENSOR_LEFT, &xHigherPriorityTaskWoken) == pdTRUE)
|
||||
{
|
||||
RxNotification_T notice = {.count = edata->num_symbols * 2,
|
||||
.location = TAG_SENSOR_LEFT};
|
||||
xQueueSendFromISR(Receive_Queue, ¬ice, &xHigherPriorityTaskWoken);
|
||||
}
|
||||
|
||||
return xHigherPriorityTaskWoken;
|
||||
}
|
||||
|
@ -81,11 +139,13 @@ static bool RMT_Rx_Left_Done_Callback(rmt_channel_handle_t channel, const rmt_rx
|
|||
static bool RMT_Rx_Forward_Done_Callback(rmt_channel_handle_t channel, const rmt_rx_done_event_data_t *edata, void *user_data)
|
||||
{
|
||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||
RxNotification_T notice;
|
||||
|
||||
notice.count = edata->num_symbols * 2;
|
||||
notice.location = TAG_SENSOR_FORWARD;
|
||||
if (Is_Sensor_Allowed(TAG_SENSOR_FORWARD, &xHigherPriorityTaskWoken) == pdTRUE)
|
||||
{
|
||||
RxNotification_T notice = {.count = edata->num_symbols * 2,
|
||||
.location = TAG_SENSOR_FORWARD};
|
||||
xQueueSendFromISR(Receive_Queue, ¬ice, &xHigherPriorityTaskWoken);
|
||||
}
|
||||
|
||||
return xHigherPriorityTaskWoken;
|
||||
}
|
||||
|
@ -93,11 +153,13 @@ static bool RMT_Rx_Forward_Done_Callback(rmt_channel_handle_t channel, const rmt
|
|||
static bool RMT_Rx_Right_Done_Callback(rmt_channel_handle_t channel, const rmt_rx_done_event_data_t *edata, void *user_data)
|
||||
{
|
||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||
RxNotification_T notice;
|
||||
|
||||
notice.count = edata->num_symbols * 2;
|
||||
notice.location = TAG_SENSOR_RIGHT;
|
||||
if (Is_Sensor_Allowed(TAG_SENSOR_RIGHT, &xHigherPriorityTaskWoken) == pdTRUE)
|
||||
{
|
||||
RxNotification_T notice = {.count = edata->num_symbols * 2,
|
||||
.location = TAG_SENSOR_RIGHT};
|
||||
xQueueSendFromISR(Receive_Queue, ¬ice, &xHigherPriorityTaskWoken);
|
||||
}
|
||||
|
||||
return xHigherPriorityTaskWoken;
|
||||
}
|
||||
|
@ -186,6 +248,13 @@ static void IR_Receive_Task(void *param)
|
|||
|
||||
static void Initialize_Receive_Task(void)
|
||||
{
|
||||
Tag_Sensor_Mutex = xSemaphoreCreateMutex();
|
||||
|
||||
if (Tag_Sensor_Mutex == NULL)
|
||||
{
|
||||
KLOG_ERROR(TAG, "Failed to create tag sensor mutex!");
|
||||
}
|
||||
|
||||
IR_Rx_Task_Handle = xTaskCreateStaticPinnedToCore(
|
||||
IR_Receive_Task, // Function that implements the task.
|
||||
"IR Rx", // Text name for the task.
|
||||
|
|
|
@ -1,3 +1,25 @@
|
|||
/*
|
||||
* This program source code file is part of the KTag project, a DIY laser tag
|
||||
* game with customizable features and wide interoperability.
|
||||
*
|
||||
* 🛡️ <https://ktag.clubk.club> 🃞
|
||||
*
|
||||
* Copyright © 2024-2025 Joseph P. Kearney and the KTag developers.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License as published by the Free
|
||||
* Software Foundation, either version 3 of the License, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* There should be a copy of the GNU Affero General Public License in the LICENSE
|
||||
* file in the root of this repository. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
void Initialize_IR(SemaphoreHandle_t init_complete);
|
|
@ -24,10 +24,7 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <SystemK.h>
|
||||
|
||||
#define MAX_LINE_LENGTH 140
|
||||
#define MAX_KEY_LENGTH 64
|
||||
#define MAX_VALUE_LENGTH 64
|
||||
#include "Key_Value.h"
|
||||
|
||||
static const char *TAG = "NVM KV";
|
||||
static const char *TEMP_FILE = "/usb/esp/temp.txt";
|
||||
|
@ -52,10 +49,10 @@ static int KV_Parse_Line(char *line, char *key, char *value)
|
|||
if (delimiter == NULL)
|
||||
return 0;
|
||||
*delimiter = '\0';
|
||||
strncpy(key, line, MAX_KEY_LENGTH - 1);
|
||||
strncpy(value, delimiter + 1, MAX_VALUE_LENGTH - 1);
|
||||
key[MAX_KEY_LENGTH - 1] = '\0';
|
||||
value[MAX_VALUE_LENGTH - 1] = '\0';
|
||||
strncpy(key, line, KV_MAX_KEY_LENGTH - 1);
|
||||
strncpy(value, delimiter + 1, KV_MAX_VALUE_LENGTH - 1);
|
||||
key[KV_MAX_KEY_LENGTH - 1] = '\0';
|
||||
value[KV_MAX_VALUE_LENGTH - 1] = '\0';
|
||||
KV_Trim(key);
|
||||
KV_Trim(value);
|
||||
return 1;
|
||||
|
@ -70,8 +67,8 @@ SystemKResult_T KV_Get_Value_string(const char *filename, const char *search_key
|
|||
return SYSTEMK_RESULT_FILE_NOT_FOUND;
|
||||
}
|
||||
|
||||
char line[MAX_LINE_LENGTH];
|
||||
char key[MAX_KEY_LENGTH];
|
||||
char line[KV_MAX_LINE_LENGTH];
|
||||
char key[KV_MAX_KEY_LENGTH];
|
||||
|
||||
while (fgets(line, sizeof(line), file))
|
||||
{
|
||||
|
@ -104,16 +101,16 @@ SystemKResult_T KV_Set_Value_string(const char *filename, const char *set_key, c
|
|||
return SYSTEMK_RESULT_WRITE_FAILED;
|
||||
}
|
||||
|
||||
char line[MAX_LINE_LENGTH];
|
||||
char line_copy[MAX_LINE_LENGTH];
|
||||
char key[MAX_KEY_LENGTH];
|
||||
char value[MAX_VALUE_LENGTH];
|
||||
char line[KV_MAX_LINE_LENGTH];
|
||||
char line_copy[KV_MAX_LINE_LENGTH];
|
||||
char key[KV_MAX_KEY_LENGTH];
|
||||
char value[KV_MAX_VALUE_LENGTH];
|
||||
int found = 0;
|
||||
|
||||
while (fgets(line, sizeof(line), file))
|
||||
{
|
||||
strncpy(line_copy, line, MAX_LINE_LENGTH);
|
||||
line_copy[MAX_LINE_LENGTH - 1] = '\0'; // Ensure null-termination
|
||||
strncpy(line_copy, line, KV_MAX_LINE_LENGTH);
|
||||
line_copy[KV_MAX_LINE_LENGTH - 1] = '\0'; // Ensure null-termination
|
||||
|
||||
if (KV_Parse_Line(line, key, value) && strcmp(key, set_key) == 0)
|
||||
{
|
||||
|
@ -142,7 +139,7 @@ SystemKResult_T KV_Set_Value_string(const char *filename, const char *set_key, c
|
|||
|
||||
SystemKResult_T KV_Get_Value_uint32(const char *filename, const char *search_key, uint32_t *value)
|
||||
{
|
||||
char value_str[MAX_VALUE_LENGTH];
|
||||
char value_str[KV_MAX_VALUE_LENGTH];
|
||||
|
||||
SystemKResult_T result = KV_Get_Value_string(filename, search_key, value_str);
|
||||
if (result != SYSTEMK_RESULT_SUCCESS)
|
||||
|
@ -179,10 +176,10 @@ SystemKResult_T KV_Get_Value_uint32(const char *filename, const char *search_key
|
|||
|
||||
SystemKResult_T KV_Set_Value_uint32(const char *filename, const char *set_key, uint32_t *set_value)
|
||||
{
|
||||
char value_str[MAX_VALUE_LENGTH];
|
||||
int written = snprintf(value_str, MAX_VALUE_LENGTH, "%lu", *set_value);
|
||||
char value_str[KV_MAX_VALUE_LENGTH];
|
||||
int written = snprintf(value_str, KV_MAX_VALUE_LENGTH, "%lu", *set_value);
|
||||
|
||||
if (written < 0 || written >= MAX_VALUE_LENGTH)
|
||||
if (written < 0 || written >= KV_MAX_VALUE_LENGTH)
|
||||
{
|
||||
KLOG_ERROR(TAG, "Error converting uint32_t to string for key %s!", set_key);
|
||||
return SYSTEMK_RESULT_WRONG_DATATYPE;
|
||||
|
@ -215,10 +212,10 @@ SystemKResult_T KV_Get_Value_uint8(const char *filename, const char *search_key,
|
|||
|
||||
SystemKResult_T KV_Set_Value_uint8(const char *filename, const char *set_key, uint8_t *set_value)
|
||||
{
|
||||
char value_str[MAX_VALUE_LENGTH];
|
||||
int written = snprintf(value_str, MAX_VALUE_LENGTH, "%u", *set_value);
|
||||
char value_str[KV_MAX_VALUE_LENGTH];
|
||||
int written = snprintf(value_str, KV_MAX_VALUE_LENGTH, "%u", *set_value);
|
||||
|
||||
if (written < 0 || written >= MAX_VALUE_LENGTH)
|
||||
if (written < 0 || written >= KV_MAX_VALUE_LENGTH)
|
||||
{
|
||||
KLOG_ERROR(TAG, "Error converting uint8_t to string for key %s!", set_key);
|
||||
return SYSTEMK_RESULT_WRONG_DATATYPE;
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
* file in the root of this repository. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define KV_MAX_LINE_LENGTH 140
|
||||
#define KV_MAX_KEY_LENGTH 64
|
||||
#define KV_MAX_VALUE_LENGTH 64
|
||||
|
||||
SystemKResult_T KV_Get_Value_string(const char *filename, const char *search_key, char *value);
|
||||
SystemKResult_T KV_Set_Value_string(const char *filename, const char *set_key, const char *set_value);
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
* file in the root of this repository. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <SystemK.h>
|
||||
#include <NVM.h>
|
||||
|
||||
|
@ -27,6 +28,8 @@ static const uint8_t UNINTIALIZED_UINT8 = UINT8_MAX;
|
|||
static uint8_t Cached_Team_ID = UNINTIALIZED_UINT8;
|
||||
static uint8_t Cached_Player_ID = UNINTIALIZED_UINT8;
|
||||
static uint8_t Cached_Weapon_ID = UNINTIALIZED_UINT8;
|
||||
static uint8_t Cached_Max_Health = UNINTIALIZED_UINT8;
|
||||
static uint8_t Cached_N_Special_Weapons_On_Reentry = UNINTIALIZED_UINT8;
|
||||
|
||||
SystemKResult_T SETTINGS_get_uint8_t(SystemKSettingID_T id, uint8_t *value)
|
||||
{
|
||||
|
@ -55,7 +58,6 @@ SystemKResult_T SETTINGS_get_uint8_t(SystemKSettingID_T id, uint8_t *value)
|
|||
key = "Team_ID";
|
||||
cached_value = &Cached_Team_ID;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_PLAYERID:
|
||||
|
@ -84,6 +86,32 @@ SystemKResult_T SETTINGS_get_uint8_t(SystemKSettingID_T id, uint8_t *value)
|
|||
}
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_MAX_HEALTH:
|
||||
if (Cached_Max_Health != UNINTIALIZED_UINT8)
|
||||
{
|
||||
*value = Cached_Max_Health;
|
||||
result = SYSTEMK_RESULT_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
key = "Max_Health";
|
||||
cached_value = &Cached_Max_Health;
|
||||
}
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_N_SPECIAL_WEAPONS_ON_REENTRY:
|
||||
if (Cached_N_Special_Weapons_On_Reentry != UNINTIALIZED_UINT8)
|
||||
{
|
||||
*value = Cached_N_Special_Weapons_On_Reentry;
|
||||
result = SYSTEMK_RESULT_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
key = "N_Special_Weapons_On_Reentry";
|
||||
cached_value = &Cached_N_Special_Weapons_On_Reentry;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
result = SYSTEMK_RESULT_WRONG_DATATYPE;
|
||||
break;
|
||||
|
@ -142,6 +170,16 @@ SystemKResult_T SETTINGS_set_uint8_t(SystemKSettingID_T id, uint8_t value)
|
|||
result = KV_Set_Value_uint8(CONFIG_FILE, "Weapon_ID", &value);
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_MAX_HEALTH:
|
||||
Cached_Max_Health = value;
|
||||
result = KV_Set_Value_uint8(CONFIG_FILE, "Max_Health", &value);
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_N_SPECIAL_WEAPONS_ON_REENTRY:
|
||||
Cached_N_Special_Weapons_On_Reentry = value;
|
||||
result = KV_Set_Value_uint8(CONFIG_FILE, "N_Special_Weapons_On_Reentry", &value);
|
||||
break;
|
||||
|
||||
default:
|
||||
result = SYSTEMK_RESULT_WRONG_DATATYPE;
|
||||
break;
|
||||
|
@ -157,10 +195,19 @@ SystemKResult_T SETTINGS_get_uint32_t(SystemKSettingID_T id, uint32_t *value)
|
|||
|
||||
switch (id)
|
||||
{
|
||||
case SYSTEMK_SETTING_DEVICE_TYPE:
|
||||
*value = BLE_DEVICE_TYPE_32ESPECIAL;
|
||||
return result;
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_T_START_GAME_in_ms:
|
||||
key = "T_Start_Game_in_ms";
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_T_GAME_LENGTH_in_ms:
|
||||
key = "T_Game_Length_in_ms";
|
||||
break;
|
||||
|
||||
default:
|
||||
result = SYSTEMK_RESULT_WRONG_DATATYPE;
|
||||
break;
|
||||
|
@ -194,6 +241,10 @@ SystemKResult_T SETTINGS_set_uint32_t(SystemKSettingID_T id, uint32_t value)
|
|||
result = KV_Set_Value_uint32(CONFIG_FILE, "T_Start_Game_in_ms", &value);
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_T_GAME_LENGTH_in_ms:
|
||||
result = KV_Set_Value_uint32(CONFIG_FILE, "T_Game_Length_in_ms", &value);
|
||||
break;
|
||||
|
||||
default:
|
||||
result = SYSTEMK_RESULT_WRONG_DATATYPE;
|
||||
break;
|
||||
|
@ -202,6 +253,26 @@ SystemKResult_T SETTINGS_set_uint32_t(SystemKSettingID_T id, uint32_t value)
|
|||
return result;
|
||||
}
|
||||
|
||||
SystemKResult_T SETTINGS_get_device_name(char* name)
|
||||
{
|
||||
char buffer[KV_MAX_VALUE_LENGTH];
|
||||
SystemKResult_T result = KV_Get_Value_string(CONFIG_FILE, "Device_Name", buffer);
|
||||
|
||||
if (result == SYSTEMK_RESULT_SUCCESS)
|
||||
{
|
||||
memcpy(name, buffer, SYSTEMK_MAX_CHARS_IN_DEVICE_NAME);
|
||||
buffer[SYSTEMK_MAX_CHARS_IN_DEVICE_NAME] = 0x00;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SystemKResult_T SETTINGS_set_device_name(char* name)
|
||||
{
|
||||
SystemKResult_T result = KV_Set_Value_string(CONFIG_FILE, "Device_Name", name);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Settings are saved on change in this implementation.
|
||||
SystemKResult_T SETTINGS_Save(void)
|
||||
{
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4fe072f2d3280b19aa53e197bd22ec44b174ff88
|
||||
Subproject commit bfcdf4c354ae6c96165e11e2fd6d52d0c8ab91eb
|
|
@ -2,13 +2,13 @@ dependencies:
|
|||
chmorgan/esp-audio-player:
|
||||
component_hash: c8ac1998e9af863bc41b57e592f88d1a5791a0f891485122336ddabbf7a65033
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
version: '>=5.0'
|
||||
- name: chmorgan/esp-libhelix-mp3
|
||||
registry_url: https://components.espressif.com
|
||||
require: private
|
||||
version: '>=1.0.0,<2.0.0'
|
||||
- name: idf
|
||||
require: private
|
||||
version: '>=5.0'
|
||||
source:
|
||||
registry_url: https://components.espressif.com/
|
||||
type: service
|
||||
|
@ -48,7 +48,7 @@ dependencies:
|
|||
type: service
|
||||
version: 0.5.3
|
||||
espressif/mdns:
|
||||
component_hash: d36b265164be5139f92de993f08f5ecaa0de0c0acbf84deee1f10bb5902d04ff
|
||||
component_hash: 3ec0af5f6bce310512e90f482388d21cc7c0e99668172d2f895356165fc6f7c5
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
|
@ -56,7 +56,7 @@ dependencies:
|
|||
source:
|
||||
registry_url: https://components.espressif.com/
|
||||
type: service
|
||||
version: 1.4.3
|
||||
version: 1.8.2
|
||||
espressif/usb_host_msc:
|
||||
component_hash: efbf44743b0f1f1f808697a671064531ae4661ccbce84632637261f8f670b375
|
||||
dependencies:
|
||||
|
@ -74,7 +74,7 @@ dependencies:
|
|||
idf:
|
||||
source:
|
||||
type: idf
|
||||
version: 5.4.0
|
||||
version: 5.4.1
|
||||
direct_dependencies:
|
||||
- chmorgan/esp-audio-player
|
||||
- chmorgan/esp-libhelix-mp3
|
||||
|
@ -82,6 +82,6 @@ direct_dependencies:
|
|||
- espressif/mdns
|
||||
- espressif/usb_host_msc
|
||||
- idf
|
||||
manifest_hash: 49abffad73ef20c1e9924d5aece4befeab0cbad25b99f353334b089de1f63639
|
||||
manifest_hash: 72ba8da366b6b4b2cc56f840cec689a58098757a271c9f018dd9fb39380b65dc
|
||||
target: esp32s3
|
||||
version: 2.0.0
|
||||
|
|
|
@ -1,8 +1,30 @@
|
|||
/*
|
||||
* This program source code file is part of the KTag project, a DIY laser tag
|
||||
* game with customizable features and wide interoperability.
|
||||
*
|
||||
* 🛡️ <https://ktag.clubk.club> 🃞
|
||||
*
|
||||
* Copyright © 2024-2025 Joseph P. Kearney and the KTag developers.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License as published by the Free
|
||||
* Software Foundation, either version 3 of the License, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* There should be a copy of the GNU Affero General Public License in the LICENSE
|
||||
* file in the root of this repository. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
#define VERSION_MAJOR 00
|
||||
#define VERSION_MINOR 38
|
||||
#define VERSION_MINOR 40
|
||||
|
||||
#define STRINGIFY(number) #number
|
||||
#define VERSION_STRING(major, minor) STRINGIFY(major) "." STRINGIFY(minor)
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
dependencies:
|
||||
chmorgan/esp-libhelix-mp3: "^1.0.3"
|
||||
chmorgan/esp-audio-player: "^1.0.7"
|
||||
espressif/button: "^3.3.1"
|
||||
espressif/mdns: "^1.3.2"
|
||||
espressif/usb_host_msc: "^1.1.2"
|
||||
espressif/button: "^3.5.0"
|
||||
espressif/mdns: "^1.8.2"
|
||||
espressif/usb_host_msc: "^1.1.3"
|
||||
|
||||
## Required IDF version (>=5.1 is required for the SPI backend of the led-strip component.)
|
||||
## We tested with 5.4.0.
|
||||
## We tested with 5.4.1.
|
||||
idf:
|
||||
version: ">=5.4.0"
|
||||
version: ">=5.4.1"
|
||||
|
||||
# # Put list of dependencies here
|
||||
# # For components maintained by Espressif:
|
||||
|
|
0
managed_components/espressif__cmake_utilities/scripts/gen_custom_ota.py
Executable file → Normal file
0
managed_components/espressif__cmake_utilities/scripts/gen_custom_ota.py
Executable file → Normal file
0
managed_components/espressif__cmake_utilities/scripts/relinker/relinker.py
Executable file → Normal file
0
managed_components/espressif__cmake_utilities/scripts/relinker/relinker.py
Executable file → Normal file
|
@ -1 +1 @@
|
|||
d36b265164be5139f92de993f08f5ecaa0de0c0acbf84deee1f10bb5902d04ff
|
||||
3ec0af5f6bce310512e90f482388d21cc7c0e99668172d2f895356165fc6f7c5
|
|
@ -3,6 +3,6 @@ commitizen:
|
|||
bump_message: 'bump(mdns): $current_version -> $new_version'
|
||||
pre_bump_hooks: python ../../ci/changelog.py mdns
|
||||
tag_format: mdns-v$version
|
||||
version: 1.4.3
|
||||
version: 1.8.2
|
||||
version_files:
|
||||
- idf_component.yml
|
||||
|
|
|
@ -1,5 +1,92 @@
|
|||
# Changelog
|
||||
|
||||
## [1.8.2](https://github.com/espressif/esp-protocols/commits/mdns-v1.8.2)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix parsing incorrect txt records ([8fd2c99f](https://github.com/espressif/esp-protocols/commit/8fd2c99f))
|
||||
|
||||
## [1.8.1](https://github.com/espressif/esp-protocols/commits/mdns-v1.8.1)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix potential task delete race ([8ca45f34](https://github.com/espressif/esp-protocols/commit/8ca45f34))
|
||||
|
||||
## [1.8.0](https://github.com/espressif/esp-protocols/commits/mdns-v1.8.0)
|
||||
|
||||
### Features
|
||||
|
||||
- Add version keys ([e01e67e7](https://github.com/espressif/esp-protocols/commit/e01e67e7))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Reformat mdns sources per indent-cont=120 ([c7663cde](https://github.com/espressif/esp-protocols/commit/c7663cde))
|
||||
|
||||
## [1.7.0](https://github.com/espressif/esp-protocols/commits/mdns-v1.7.0)
|
||||
|
||||
### Features
|
||||
|
||||
- Support user defined allocators ([88162d1f](https://github.com/espressif/esp-protocols/commit/88162d1f))
|
||||
- Allow allocate memory with configured caps ([7d29b476](https://github.com/espressif/esp-protocols/commit/7d29b476))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Adjust some formatting per indent-cont=120 ([5b2077e3](https://github.com/espressif/esp-protocols/commit/5b2077e3))
|
||||
|
||||
## [1.6.0](https://github.com/espressif/esp-protocols/commits/mdns-v1.6.0)
|
||||
|
||||
### Features
|
||||
|
||||
- support allocating mDNS task from SPIRAM ([8fcad10c](https://github.com/espressif/esp-protocols/commit/8fcad10c))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Use correct task delete function ([eb4ab524](https://github.com/espressif/esp-protocols/commit/eb4ab524))
|
||||
|
||||
### Updated
|
||||
|
||||
- ci(mdns): Fix mdns host test layers with static task creation ([0690eba3](https://github.com/espressif/esp-protocols/commit/0690eba3))
|
||||
|
||||
## [1.5.3](https://github.com/espressif/esp-protocols/commits/mdns-v1.5.3)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix responder to ignore only invalid queries ([cd07228f](https://github.com/espressif/esp-protocols/commit/cd07228f), [#754](https://github.com/espressif/esp-protocols/issues/754))
|
||||
|
||||
## [1.5.2](https://github.com/espressif/esp-protocols/commits/mdns-v1.5.2)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix potential NULL deref when sending sub-buy ([e7273c46](https://github.com/espressif/esp-protocols/commit/e7273c46))
|
||||
- Fix _mdns_append_fqdn excessive stack usage ([bd23c233](https://github.com/espressif/esp-protocols/commit/bd23c233))
|
||||
|
||||
## [1.5.1](https://github.com/espressif/esp-protocols/commits/mdns-v1.5.1)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix incorrect memory free for mdns browse ([4451a8c5](https://github.com/espressif/esp-protocols/commit/4451a8c5))
|
||||
|
||||
## [1.5.0](https://github.com/espressif/esp-protocols/commits/mdns-v1.5.0)
|
||||
|
||||
### Features
|
||||
|
||||
- supported removal of subtype when updating service ([4ad88e29](https://github.com/espressif/esp-protocols/commit/4ad88e29))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix zero-sized VLA clang-tidy warnings ([196198ec](https://github.com/espressif/esp-protocols/commit/196198ec))
|
||||
- Remove dead store to arg variable shared ([e838bf03](https://github.com/espressif/esp-protocols/commit/e838bf03))
|
||||
- Fix name mangling not to use strcpy() ([99b54ac3](https://github.com/espressif/esp-protocols/commit/99b54ac3))
|
||||
- Fix potential null derefernce in _mdns_execute_action() ([f5be2f41](https://github.com/espressif/esp-protocols/commit/f5be2f41))
|
||||
- Fix AFL test mock per espressif/esp-idf@a5bc08fb55c ([3d8835cf](https://github.com/espressif/esp-protocols/commit/3d8835cf))
|
||||
- Fixed potential out-of-bound interface error ([24f55ce9](https://github.com/espressif/esp-protocols/commit/24f55ce9))
|
||||
- Fixed incorrect error conversion ([8f8516cc](https://github.com/espressif/esp-protocols/commit/8f8516cc))
|
||||
- Fixed potential overflow when allocating txt data ([75a8e864](https://github.com/espressif/esp-protocols/commit/75a8e864))
|
||||
- Move MDNS_NAME_BUF_LEN to public headers ([907087c0](https://github.com/espressif/esp-protocols/commit/907087c0), [#724](https://github.com/espressif/esp-protocols/issues/724))
|
||||
- Cleanup includes in mdns.c ([68a9e148](https://github.com/espressif/esp-protocols/commit/68a9e148), [#725](https://github.com/espressif/esp-protocols/issues/725))
|
||||
- Allow advertizing service with port==0 ([827ea65f](https://github.com/espressif/esp-protocols/commit/827ea65f))
|
||||
- Fixed complier warning if MDNS_MAX_SERVICES==0 ([95377216](https://github.com/espressif/esp-protocols/commit/95377216), [#611](https://github.com/espressif/esp-protocols/issues/611))
|
||||
|
||||
## [1.4.3](https://github.com/espressif/esp-protocols/commits/mdns-v1.4.3)
|
||||
|
||||
### Features
|
||||
|
|
1
managed_components/espressif__mdns/CHECKSUMS.json
Normal file
1
managed_components/espressif__mdns/CHECKSUMS.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -10,15 +10,17 @@ else()
|
|||
set(MDNS_CONSOLE "")
|
||||
endif()
|
||||
|
||||
set(MDNS_MEMORY "mdns_mem_caps.c")
|
||||
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
if(${target} STREQUAL "linux")
|
||||
set(dependencies esp_netif_linux esp_event)
|
||||
set(private_dependencies esp_timer console esp_system)
|
||||
set(srcs "mdns.c" ${MDNS_NETWORKING} ${MDNS_CONSOLE})
|
||||
set(srcs "mdns.c" ${MDNS_MEMORY} ${MDNS_NETWORKING} ${MDNS_CONSOLE})
|
||||
else()
|
||||
set(dependencies lwip console esp_netif)
|
||||
set(private_dependencies esp_timer esp_wifi)
|
||||
set(srcs "mdns.c" ${MDNS_NETWORKING} ${MDNS_CONSOLE})
|
||||
set(srcs "mdns.c" ${MDNS_MEMORY} ${MDNS_NETWORKING} ${MDNS_CONSOLE})
|
||||
endif()
|
||||
|
||||
idf_component_register(
|
||||
|
@ -32,7 +34,9 @@ if(${target} STREQUAL "linux")
|
|||
target_link_libraries(${COMPONENT_LIB} PRIVATE "-lbsd")
|
||||
endif()
|
||||
|
||||
|
||||
if(CONFIG_ETH_ENABLED)
|
||||
idf_component_optional_requires(PRIVATE esp_eth)
|
||||
endif()
|
||||
|
||||
idf_component_get_property(MDNS_VERSION ${COMPONENT_NAME} COMPONENT_VERSION)
|
||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DESP_MDNS_VERSION_NUMBER=\"${MDNS_VERSION}\"")
|
||||
|
|
|
@ -61,6 +61,48 @@ menu "mDNS"
|
|||
default 0x0 if MDNS_TASK_AFFINITY_CPU0
|
||||
default 0x1 if MDNS_TASK_AFFINITY_CPU1
|
||||
|
||||
menu "MDNS Memory Configuration"
|
||||
|
||||
choice MDNS_TASK_MEMORY_ALLOC_FROM
|
||||
prompt "Select mDNS task create on which type of memory"
|
||||
default MDNS_TASK_CREATE_FROM_INTERNAL
|
||||
config MDNS_TASK_CREATE_FROM_SPIRAM
|
||||
bool "mDNS task creates on the SPIRAM (READ HELP)"
|
||||
depends on (SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC)
|
||||
help
|
||||
mDNS task creates on the SPIRAM.
|
||||
This option requires FreeRTOS component to allow creating
|
||||
tasks on the external memory.
|
||||
Please read the documentation about FREERTOS_TASK_CREATE_ALLOW_EXT_MEM
|
||||
|
||||
config MDNS_TASK_CREATE_FROM_INTERNAL
|
||||
bool "mDNS task creates on the internal RAM"
|
||||
|
||||
endchoice
|
||||
|
||||
choice MDNS_MEMORY_ALLOC_FROM
|
||||
prompt "Select mDNS memory allocation type"
|
||||
default MDNS_MEMORY_ALLOC_INTERNAL
|
||||
|
||||
config MDNS_MEMORY_ALLOC_SPIRAM
|
||||
bool "Allocate mDNS memory from SPIRAM"
|
||||
depends on (SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC)
|
||||
|
||||
config MDNS_MEMORY_ALLOC_INTERNAL
|
||||
bool "Allocate mDNS memory from internal RAM"
|
||||
|
||||
endchoice
|
||||
|
||||
config MDNS_MEMORY_CUSTOM_IMPL
|
||||
bool "Implement custom memory functions"
|
||||
default n
|
||||
help
|
||||
Enable to implement custom memory functions for mDNS library.
|
||||
This option is useful when the application wants to use custom
|
||||
memory allocation functions for mDNS library.
|
||||
|
||||
endmenu # MDNS Memory Configuration
|
||||
|
||||
config MDNS_SERVICE_ADD_TIMEOUT_MS
|
||||
int "mDNS adding service timeout (ms)"
|
||||
range 10 30000
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
|
@ -314,6 +314,8 @@ void app_main(void)
|
|||
ESP_ERROR_CHECK(esp_netif_init());
|
||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
|
||||
ESP_LOGI(TAG, "mDNS Ver: %s", ESP_MDNS_VERSION_NUMBER);
|
||||
|
||||
initialise_mdns();
|
||||
|
||||
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
|
||||
|
|
|
@ -7,7 +7,7 @@ documentation: https://docs.espressif.com/projects/esp-protocols/mdns/docs/lates
|
|||
issues: https://github.com/espressif/esp-protocols/issues
|
||||
repository: git://github.com/espressif/esp-protocols.git
|
||||
repository_info:
|
||||
commit_sha: 4394f845fccf93bc49111808c24bbd25fbbb20f4
|
||||
commit_sha: e9d7350219dfb5e39eb56e5ef60c094190888c55
|
||||
path: components/mdns
|
||||
url: https://github.com/espressif/esp-protocols/tree/master/components/mdns
|
||||
version: 1.4.3
|
||||
version: 1.8.2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include <esp_netif.h>
|
||||
|
||||
#define MDNS_TYPE_A 0x0001
|
||||
|
@ -21,6 +22,13 @@ extern "C" {
|
|||
#define MDNS_TYPE_NSEC 0x002F
|
||||
#define MDNS_TYPE_ANY 0x00FF
|
||||
|
||||
#if defined(CONFIG_LWIP_IPV6) && defined(CONFIG_MDNS_RESPOND_REVERSE_QUERIES)
|
||||
#define MDNS_NAME_MAX_LEN (64+4) // Need to account for IPv6 reverse queries (64 char address + ".ip6" )
|
||||
#else
|
||||
#define MDNS_NAME_MAX_LEN 64 // Maximum string length of hostname, instance, service and proto
|
||||
#endif
|
||||
#define MDNS_NAME_BUF_LEN (MDNS_NAME_MAX_LEN+1) // Maximum char buffer size to hold hostname, instance, service or proto
|
||||
|
||||
/**
|
||||
* @brief Asynchronous query handle
|
||||
*/
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@
|
|||
#include "mdns.h"
|
||||
#include "mdns_private.h"
|
||||
#include "inttypes.h"
|
||||
#include "mdns_mem_caps.h"
|
||||
|
||||
static const char *ip_protocol_str[] = {"V4", "V6", "MAX"};
|
||||
|
||||
|
@ -644,7 +645,7 @@ static mdns_txt_item_t *_convert_items(const char **values, int count)
|
|||
{
|
||||
int i = 0, e;
|
||||
const char *value = NULL;
|
||||
mdns_txt_item_t *items = (mdns_txt_item_t *) malloc(sizeof(mdns_txt_item_t) * count);
|
||||
mdns_txt_item_t *items = (mdns_txt_item_t *) mdns_mem_malloc(sizeof(mdns_txt_item_t) * count);
|
||||
if (!items) {
|
||||
printf("ERROR: No Memory!\n");
|
||||
goto fail;
|
||||
|
@ -661,15 +662,15 @@ static mdns_txt_item_t *_convert_items(const char **values, int count)
|
|||
}
|
||||
int var_len = esign - value;
|
||||
int val_len = strlen(value) - var_len - 1;
|
||||
char *var = (char *)malloc(var_len + 1);
|
||||
char *var = (char *)mdns_mem_malloc(var_len + 1);
|
||||
if (var == NULL) {
|
||||
printf("ERROR: No Memory!\n");
|
||||
goto fail;
|
||||
}
|
||||
char *val = (char *)malloc(val_len + 1);
|
||||
char *val = (char *)mdns_mem_malloc(val_len + 1);
|
||||
if (val == NULL) {
|
||||
printf("ERROR: No Memory!\n");
|
||||
free(var);
|
||||
mdns_mem_free(var);
|
||||
goto fail;
|
||||
}
|
||||
memcpy(var, value, var_len);
|
||||
|
@ -685,10 +686,10 @@ static mdns_txt_item_t *_convert_items(const char **values, int count)
|
|||
|
||||
fail:
|
||||
for (e = 0; e < i; e++) {
|
||||
free((char *)items[e].key);
|
||||
free((char *)items[e].value);
|
||||
mdns_mem_free((char *)items[e].key);
|
||||
mdns_mem_free((char *)items[e].value);
|
||||
}
|
||||
free(items);
|
||||
mdns_mem_free(items);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -736,7 +737,7 @@ static int cmd_mdns_service_add(int argc, char **argv)
|
|||
|
||||
ESP_ERROR_CHECK(mdns_service_add_for_host(instance, mdns_add_args.service->sval[0], mdns_add_args.proto->sval[0],
|
||||
host, mdns_add_args.port->ival[0], items, mdns_add_args.txt->count));
|
||||
free(items);
|
||||
mdns_mem_free(items);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -971,7 +972,7 @@ static int cmd_mdns_service_txt_replace(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
ESP_ERROR_CHECK(mdns_service_txt_set_for_host(instance, mdns_txt_replace_args.service->sval[0], mdns_txt_replace_args.proto->sval[0], host, items, mdns_txt_replace_args.txt->count));
|
||||
free(items);
|
||||
mdns_mem_free(items);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
96
managed_components/espressif__mdns/mdns_mem_caps.c
Normal file
96
managed_components/espressif__mdns/mdns_mem_caps.c
Normal file
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <string.h>
|
||||
#include "sdkconfig.h"
|
||||
#include "mdns_private.h"
|
||||
#include "mdns_mem_caps.h"
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#if CONFIG_MDNS_MEMORY_CUSTOM_IMPL
|
||||
#define ALLOW_WEAK __attribute__((weak))
|
||||
#else
|
||||
#define ALLOW_WEAK
|
||||
#endif
|
||||
|
||||
#if CONFIG_MDNS_TASK_CREATE_FROM_SPIRAM
|
||||
#define MDNS_TASK_MEMORY_CAPS (MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT)
|
||||
#define MDNS_TASK_MEMORY_LOG "SPIRAM"
|
||||
#endif
|
||||
#if CONFIG_MDNS_TASK_CREATE_FROM_INTERNAL
|
||||
#define MDNS_TASK_MEMORY_CAPS (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)
|
||||
#define MDNS_TASK_MEMORY_LOG "internal RAM"
|
||||
#endif
|
||||
|
||||
#if CONFIG_MDNS_MEMORY_ALLOC_SPIRAM
|
||||
#define MDNS_MEMORY_CAPS (MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT)
|
||||
#endif
|
||||
#if CONFIG_MDNS_MEMORY_ALLOC_INTERNAL
|
||||
#define MDNS_MEMORY_CAPS (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)
|
||||
#endif
|
||||
|
||||
// Allocate memory from internal heap as default.
|
||||
#ifndef MDNS_MEMORY_CAPS
|
||||
#warning "No memory allocation method defined, using internal memory"
|
||||
#define MDNS_MEMORY_CAPS (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)
|
||||
#endif
|
||||
#ifndef MDNS_TASK_MEMORY_CAPS
|
||||
#define MDNS_TASK_MEMORY_CAPS (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)
|
||||
#define MDNS_TASK_MEMORY_LOG "internal RAM"
|
||||
#endif
|
||||
|
||||
void ALLOW_WEAK *mdns_mem_malloc(size_t size)
|
||||
{
|
||||
return heap_caps_malloc(size, MDNS_MEMORY_CAPS);
|
||||
}
|
||||
|
||||
void ALLOW_WEAK *mdns_mem_calloc(size_t num, size_t size)
|
||||
{
|
||||
return heap_caps_calloc(num, size, MDNS_MEMORY_CAPS);
|
||||
}
|
||||
|
||||
void ALLOW_WEAK mdns_mem_free(void *ptr)
|
||||
{
|
||||
heap_caps_free(ptr);
|
||||
}
|
||||
|
||||
char ALLOW_WEAK *mdns_mem_strdup(const char *s)
|
||||
{
|
||||
if (!s) {
|
||||
return NULL;
|
||||
}
|
||||
size_t len = strlen(s) + 1;
|
||||
char *copy = (char *)heap_caps_malloc(len, MDNS_MEMORY_CAPS);
|
||||
if (copy) {
|
||||
memcpy(copy, s, len);
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
char ALLOW_WEAK *mdns_mem_strndup(const char *s, size_t n)
|
||||
{
|
||||
if (!s) {
|
||||
return NULL;
|
||||
}
|
||||
size_t len = strnlen(s, n);
|
||||
char *copy = (char *)heap_caps_malloc(len + 1, MDNS_MEMORY_CAPS);
|
||||
if (copy) {
|
||||
memcpy(copy, s, len);
|
||||
copy[len] = '\0';
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
void ALLOW_WEAK *mdns_mem_task_malloc(size_t size)
|
||||
{
|
||||
ESP_LOGI("mdns_mem", "mDNS task will be created from %s", MDNS_TASK_MEMORY_LOG);
|
||||
return heap_caps_malloc(size, MDNS_TASK_MEMORY_CAPS);
|
||||
}
|
||||
|
||||
void ALLOW_WEAK mdns_mem_task_free(void *ptr)
|
||||
{
|
||||
heap_caps_free(ptr);
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -20,6 +20,7 @@
|
|||
#include "esp_event.h"
|
||||
#include "mdns_networking.h"
|
||||
#include "esp_netif_net_stack.h"
|
||||
#include "mdns_mem_caps.h"
|
||||
|
||||
/*
|
||||
* MDNS Server Networking
|
||||
|
@ -143,7 +144,7 @@ static void _udp_recv(void *arg, struct udp_pcb *upcb, struct pbuf *pb, const ip
|
|||
pb = pb->next;
|
||||
this_pb->next = NULL;
|
||||
|
||||
mdns_rx_packet_t *packet = (mdns_rx_packet_t *)malloc(sizeof(mdns_rx_packet_t));
|
||||
mdns_rx_packet_t *packet = (mdns_rx_packet_t *)mdns_mem_malloc(sizeof(mdns_rx_packet_t));
|
||||
if (!packet) {
|
||||
HOOK_MALLOC_FAILED;
|
||||
//missed packet - no memory
|
||||
|
@ -205,7 +206,7 @@ static void _udp_recv(void *arg, struct udp_pcb *upcb, struct pbuf *pb, const ip
|
|||
|
||||
if (!found || _mdns_send_rx_action(packet) != ESP_OK) {
|
||||
pbuf_free(this_pb);
|
||||
free(packet);
|
||||
mdns_mem_free(packet);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -288,7 +289,7 @@ typedef struct {
|
|||
static err_t _mdns_pcb_init_api(struct tcpip_api_call_data *api_call_msg)
|
||||
{
|
||||
mdns_api_call_t *msg = (mdns_api_call_t *)api_call_msg;
|
||||
msg->err = _udp_pcb_init(msg->tcpip_if, msg->ip_protocol);
|
||||
msg->err = _udp_pcb_init(msg->tcpip_if, msg->ip_protocol) == ESP_OK ? ERR_OK : ERR_IF;
|
||||
return msg->err;
|
||||
}
|
||||
|
||||
|
@ -393,5 +394,5 @@ size_t _mdns_get_packet_len(mdns_rx_packet_t *packet)
|
|||
void _mdns_packet_free(mdns_rx_packet_t *packet)
|
||||
{
|
||||
pbuf_free(packet->pb);
|
||||
free(packet);
|
||||
mdns_mem_free(packet);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -21,6 +21,7 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#include "esp_log.h"
|
||||
#include "mdns_mem_caps.h"
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_LINUX)
|
||||
#include <sys/ioctl.h>
|
||||
|
@ -87,9 +88,9 @@ size_t _mdns_get_packet_len(mdns_rx_packet_t *packet)
|
|||
|
||||
void _mdns_packet_free(mdns_rx_packet_t *packet)
|
||||
{
|
||||
free(packet->pb->payload);
|
||||
free(packet->pb);
|
||||
free(packet);
|
||||
mdns_mem_free(packet->pb->payload);
|
||||
mdns_mem_free(packet->pb);
|
||||
mdns_mem_free(packet);
|
||||
}
|
||||
|
||||
esp_err_t _mdns_pcb_deinit(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol)
|
||||
|
@ -297,13 +298,13 @@ void sock_recv_task(void *arg)
|
|||
inet_to_espaddr(&raddr, &addr, &port);
|
||||
|
||||
// Allocate the packet structure and pass it to the mdns main engine
|
||||
mdns_rx_packet_t *packet = (mdns_rx_packet_t *) calloc(1, sizeof(mdns_rx_packet_t));
|
||||
struct pbuf *packet_pbuf = calloc(1, sizeof(struct pbuf));
|
||||
uint8_t *buf = malloc(len);
|
||||
mdns_rx_packet_t *packet = (mdns_rx_packet_t *) mdns_mem_calloc(1, sizeof(mdns_rx_packet_t));
|
||||
struct pbuf *packet_pbuf = mdns_mem_calloc(1, sizeof(struct pbuf));
|
||||
uint8_t *buf = mdns_mem_malloc(len);
|
||||
if (packet == NULL || packet_pbuf == NULL || buf == NULL) {
|
||||
free(buf);
|
||||
free(packet_pbuf);
|
||||
free(packet);
|
||||
mdns_mem_free(buf);
|
||||
mdns_mem_free(packet_pbuf);
|
||||
mdns_mem_free(packet);
|
||||
HOOK_MALLOC_FAILED;
|
||||
ESP_LOGE(TAG, "Failed to allocate the mdns packet");
|
||||
continue;
|
||||
|
@ -326,9 +327,9 @@ void sock_recv_task(void *arg)
|
|||
packet->src.type == ESP_IPADDR_TYPE_V4 ? MDNS_IP_PROTOCOL_V4 : MDNS_IP_PROTOCOL_V6;
|
||||
if (_mdns_send_rx_action(packet) != ESP_OK) {
|
||||
ESP_LOGE(TAG, "_mdns_send_rx_action failed!");
|
||||
free(packet->pb->payload);
|
||||
free(packet->pb);
|
||||
free(packet);
|
||||
mdns_mem_free(packet->pb->payload);
|
||||
mdns_mem_free(packet->pb);
|
||||
mdns_mem_free(packet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
54
managed_components/espressif__mdns/mem_prefix_script.py
Normal file
54
managed_components/espressif__mdns/mem_prefix_script.py
Normal file
|
@ -0,0 +1,54 @@
|
|||
# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import re
|
||||
import sys
|
||||
|
||||
# Configurable prefix for memory functions
|
||||
MDNS_MEM_PREFIX = 'mdns_mem_' # Change this to modify the prefix
|
||||
|
||||
|
||||
def add_prefix_to_mem_funcs(content):
|
||||
# List of memory functions to prefix
|
||||
mem_funcs = [
|
||||
'malloc',
|
||||
'calloc',
|
||||
'free',
|
||||
'strdup',
|
||||
'strndup'
|
||||
]
|
||||
|
||||
# Create regex pattern matching the memory functions but not already prefixed ones
|
||||
pattern = fr'(?<!{MDNS_MEM_PREFIX})(?<![\w])(' + '|'.join(mem_funcs) + r')(?=\s*\()'
|
||||
|
||||
# Replace all occurrences with configured prefix
|
||||
modified = re.sub(pattern, fr'{MDNS_MEM_PREFIX}\1', content)
|
||||
|
||||
return modified
|
||||
|
||||
|
||||
def process_file(filename):
|
||||
try:
|
||||
# Read the file
|
||||
with open(filename, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Add prefixes
|
||||
modified = add_prefix_to_mem_funcs(content)
|
||||
|
||||
# Write back to file
|
||||
with open(filename, 'w') as f:
|
||||
f.write(modified)
|
||||
|
||||
print(f'Successfully processed {filename}')
|
||||
|
||||
except Exception as e:
|
||||
print(f'Error processing {filename}: {str(e)}')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) != 2:
|
||||
print('Usage: python script.py <filename>')
|
||||
sys.exit(1)
|
||||
|
||||
process_file(sys.argv[1])
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Allocate memory.
|
||||
* @param size Number of bytes to allocate.
|
||||
* @return Pointer to allocated memory, or NULL on failure.
|
||||
*/
|
||||
void *mdns_mem_malloc(size_t size);
|
||||
|
||||
/**
|
||||
* @brief Allocate and zero memory.
|
||||
* @param num Number of elements.
|
||||
* @param size Size of each element.
|
||||
* @return Pointer to allocated memory, or NULL on failure.
|
||||
*/
|
||||
void *mdns_mem_calloc(size_t num, size_t size);
|
||||
|
||||
/**
|
||||
* @brief Free allocated memory.
|
||||
* @param ptr Pointer to memory to free.
|
||||
*/
|
||||
void mdns_mem_free(void *ptr);
|
||||
|
||||
/**
|
||||
* @brief Duplicate a string.
|
||||
* @param s String to duplicate.
|
||||
* @return Pointer to duplicated string, or NULL on failure.
|
||||
*/
|
||||
char *mdns_mem_strdup(const char *s);
|
||||
|
||||
/**
|
||||
* @brief Duplicate a string with length limit.
|
||||
* @param s String to duplicate.
|
||||
* @param n Maximum number of characters to copy.
|
||||
* @return Pointer to duplicated string, or NULL on failure.
|
||||
*/
|
||||
char *mdns_mem_strndup(const char *s, size_t n);
|
||||
|
||||
/**
|
||||
* @brief Allocate memory for mDNS task.
|
||||
* @param size Number of bytes to allocate.
|
||||
* @return Pointer to allocated memory, or NULL on failure.
|
||||
*/
|
||||
void *mdns_mem_task_malloc(size_t size);
|
||||
|
||||
/**
|
||||
* @brief Free allocated memory for mDNS task.
|
||||
* @param ptr Pointer to memory to free.
|
||||
*/
|
||||
void mdns_mem_task_free(void *ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -103,12 +103,6 @@
|
|||
#define MDNS_PACKET_QUEUE_LEN 16 // Maximum packets that can be queued for parsing
|
||||
#define MDNS_ACTION_QUEUE_LEN CONFIG_MDNS_ACTION_QUEUE_LEN // Maximum actions pending to the server
|
||||
#define MDNS_TXT_MAX_LEN 1024 // Maximum string length of text data in TXT record
|
||||
#if defined(CONFIG_LWIP_IPV6) && defined(CONFIG_MDNS_RESPOND_REVERSE_QUERIES)
|
||||
#define MDNS_NAME_MAX_LEN (64+4) // Need to account for IPv6 reverse queries (64 char address + ".ip6" )
|
||||
#else
|
||||
#define MDNS_NAME_MAX_LEN 64 // Maximum string length of hostname, instance, service and proto
|
||||
#endif
|
||||
#define MDNS_NAME_BUF_LEN (MDNS_NAME_MAX_LEN+1) // Maximum char buffer size to hold hostname, instance, service or proto
|
||||
#define MDNS_MAX_PACKET_SIZE 1460 // Maximum size of mDNS outgoing packet
|
||||
|
||||
#define MDNS_HEAD_LEN 12
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
|
@ -117,7 +117,46 @@ void esp_log_write(esp_log_level_t level, const char *tag, const char *format, .
|
|||
{
|
||||
}
|
||||
|
||||
void esp_log(esp_log_config_t config, const char *tag, const char *format, ...)
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t esp_log_timestamp(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *mdns_mem_malloc(size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void *mdns_mem_calloc(size_t num, size_t size)
|
||||
{
|
||||
return calloc(num, size);
|
||||
}
|
||||
|
||||
void mdns_mem_free(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
char *mdns_mem_strdup(const char *s)
|
||||
{
|
||||
return strdup(s);
|
||||
}
|
||||
|
||||
char *mdns_mem_strndup(const char *s, size_t n)
|
||||
{
|
||||
return strndup(s, n);
|
||||
}
|
||||
|
||||
void *mdns_mem_task_malloc(size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void mdns_mem_task_free(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -38,6 +38,10 @@
|
|||
#define ESP_ERR_INVALID_RESPONSE 0x108
|
||||
#define ESP_ERR_INVALID_CRC 0x109
|
||||
|
||||
#define MDNS_TASK_MEMORY_LOG "internal RAM"
|
||||
#define MALLOC_CAP_8BIT (1<<2)
|
||||
#define MALLOC_CAP_INTERNAL (1<<11)
|
||||
|
||||
#define pdTRUE true
|
||||
#define pdFALSE false
|
||||
#define pdPASS ( pdTRUE )
|
||||
|
@ -62,6 +66,7 @@
|
|||
#define vSemaphoreDelete(s) free(s)
|
||||
#define queueQUEUE_TYPE_MUTEX ( ( uint8_t ) 1U
|
||||
#define xTaskCreatePinnedToCore(a,b,c,d,e,f,g) *(f) = malloc(1)
|
||||
#define xTaskCreateStaticPinnedToCore(a,b,c,d,e,f,g,h) true
|
||||
#define vTaskDelay(m) usleep((m)*0)
|
||||
#define esp_random() (rand()%UINT32_MAX)
|
||||
|
||||
|
@ -79,7 +84,8 @@ typedef void *QueueHandle_t;
|
|||
typedef void *TaskHandle_t;
|
||||
typedef int BaseType_t;
|
||||
typedef uint32_t TickType_t;
|
||||
|
||||
typedef void *StackType_t;
|
||||
typedef void *StaticTask_t;
|
||||
|
||||
struct udp_pcb {
|
||||
uint8_t dummy;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
|
|
66
sdkconfig
66
sdkconfig
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Automatically generated file. DO NOT EDIT.
|
||||
# Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Configuration
|
||||
# Espressif IoT Development Framework (ESP-IDF) 5.4.1 Project Configuration
|
||||
#
|
||||
CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000
|
||||
CONFIG_SOC_MPU_REGIONS_MAX_NUM=8
|
||||
|
@ -64,6 +64,7 @@ CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y
|
|||
CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y
|
||||
CONFIG_SOC_LP_PERIPH_SHARE_INTERRUPT=y
|
||||
CONFIG_SOC_PM_SUPPORTED=y
|
||||
CONFIG_SOC_SIMD_INSTRUCTION_SUPPORTED=y
|
||||
CONFIG_SOC_XTAL_SUPPORT_40M=y
|
||||
CONFIG_SOC_APPCPU_HAS_CLOCK_GATING_BUG=y
|
||||
CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y
|
||||
|
@ -101,6 +102,7 @@ CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y
|
|||
CONFIG_SOC_CPU_BREAKPOINTS_NUM=2
|
||||
CONFIG_SOC_CPU_WATCHPOINTS_NUM=2
|
||||
CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=64
|
||||
CONFIG_SOC_SIMD_PREFERRED_DATA_ALIGNMENT=16
|
||||
CONFIG_SOC_DS_SIGNATURE_MAX_BIT_LEN=4096
|
||||
CONFIG_SOC_DS_KEY_PARAM_MD_IV_LENGTH=16
|
||||
CONFIG_SOC_DS_KEY_CHECK_MAX_WAIT_US=1100
|
||||
|
@ -205,6 +207,7 @@ CONFIG_SOC_RTCIO_PIN_COUNT=22
|
|||
CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y
|
||||
CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y
|
||||
CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y
|
||||
CONFIG_SOC_LP_IO_CLOCK_IS_INDEPENDENT=y
|
||||
CONFIG_SOC_SDM_GROUPS=y
|
||||
CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8
|
||||
CONFIG_SOC_SDM_CLK_SUPPORT_APB=y
|
||||
|
@ -245,6 +248,8 @@ CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=54
|
|||
CONFIG_SOC_TIMER_GROUP_SUPPORT_XTAL=y
|
||||
CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y
|
||||
CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4
|
||||
CONFIG_SOC_LP_TIMER_BIT_WIDTH_LO=32
|
||||
CONFIG_SOC_LP_TIMER_BIT_WIDTH_HI=16
|
||||
CONFIG_SOC_TOUCH_SENSOR_VERSION=2
|
||||
CONFIG_SOC_TOUCH_SENSOR_NUM=15
|
||||
CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y
|
||||
|
@ -370,7 +375,7 @@ CONFIG_IDF_TOOLCHAIN_GCC=y
|
|||
CONFIG_IDF_TARGET_ARCH_XTENSA=y
|
||||
CONFIG_IDF_TARGET_ARCH="xtensa"
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_IDF_INIT_VERSION="5.3.1"
|
||||
CONFIG_IDF_INIT_VERSION="5.4.1"
|
||||
CONFIG_IDF_TARGET_ESP32S3=y
|
||||
CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009
|
||||
|
||||
|
@ -647,6 +652,7 @@ CONFIG_BT_NIMBLE_SM_SC=y
|
|||
# CONFIG_BT_NIMBLE_SM_SC_DEBUG_KEYS is not set
|
||||
CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_ENCRYPTION=y
|
||||
CONFIG_BT_NIMBLE_SM_LVL=0
|
||||
CONFIG_BT_NIMBLE_SM_SC_ONLY=0
|
||||
# CONFIG_BT_NIMBLE_DEBUG is not set
|
||||
# CONFIG_BT_NIMBLE_DYNAMIC_SERVICE is not set
|
||||
CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="KTag 32ESPecial"
|
||||
|
@ -725,12 +731,27 @@ CONFIG_BT_NIMBLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL=0
|
|||
CONFIG_BT_NIMBLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL=0
|
||||
CONFIG_BT_NIMBLE_SVC_GAP_PPCP_SLAVE_LATENCY=0
|
||||
CONFIG_BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO=0
|
||||
# CONFIG_BT_NIMBLE_SVC_GAP_GATT_SECURITY_LEVEL is not set
|
||||
# end of GAP Service
|
||||
|
||||
#
|
||||
# BLE Services
|
||||
#
|
||||
# CONFIG_BT_NIMBLE_HID_SERVICE is not set
|
||||
# CONFIG_BT_NIMBLE_SVC_BAS_BATTERY_LEVEL_NOTIFY is not set
|
||||
|
||||
#
|
||||
# Device Information Service
|
||||
#
|
||||
# CONFIG_BT_NIMBLE_SVC_DIS_MANUFACTURER_NAME is not set
|
||||
# CONFIG_BT_NIMBLE_SVC_DIS_SERIAL_NUMBER is not set
|
||||
# CONFIG_BT_NIMBLE_SVC_DIS_HARDWARE_REVISION is not set
|
||||
# CONFIG_BT_NIMBLE_SVC_DIS_FIRMWARE_REVISION is not set
|
||||
# CONFIG_BT_NIMBLE_SVC_DIS_SOFTWARE_REVISION is not set
|
||||
# CONFIG_BT_NIMBLE_SVC_DIS_SYSTEM_ID is not set
|
||||
# CONFIG_BT_NIMBLE_SVC_DIS_PNP_ID is not set
|
||||
# CONFIG_BT_NIMBLE_SVC_DIS_INCLUDED is not set
|
||||
# end of Device Information Service
|
||||
# end of BLE Services
|
||||
|
||||
# CONFIG_BT_NIMBLE_VS_SUPPORT is not set
|
||||
|
@ -738,6 +759,7 @@ CONFIG_BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO=0
|
|||
CONFIG_BT_NIMBLE_HIGH_DUTY_ADV_ITVL=y
|
||||
# CONFIG_BT_NIMBLE_HOST_ALLOW_CONNECT_WITH_SCAN is not set
|
||||
# CONFIG_BT_NIMBLE_HOST_QUEUE_CONG_CHECK is not set
|
||||
# CONFIG_BT_NIMBLE_GATTC_PROC_PREEMPTION_PROTECT is not set
|
||||
|
||||
#
|
||||
# Host-controller Transport
|
||||
|
@ -748,6 +770,9 @@ CONFIG_BT_NIMBLE_HCI_UART_FLOW_CTRL=0
|
|||
CONFIG_BT_NIMBLE_HCI_UART_RTS_PIN=19
|
||||
CONFIG_BT_NIMBLE_HCI_UART_CTS_PIN=23
|
||||
# end of Host-controller Transport
|
||||
|
||||
CONFIG_BT_NIMBLE_EATT_CHAN_NUM=0
|
||||
# CONFIG_BT_NIMBLE_SUBRATE is not set
|
||||
# end of NimBLE Options
|
||||
|
||||
#
|
||||
|
@ -828,20 +853,22 @@ CONFIG_BT_CTRL_CHAN_ASS_EN=y
|
|||
CONFIG_BT_CTRL_LE_PING_EN=y
|
||||
|
||||
#
|
||||
# BLE disconnect when instant passed
|
||||
# BLE disconnects when Instant Passed (0x28) occurs
|
||||
#
|
||||
# CONFIG_BT_CTRL_BLE_LLCP_CONN_UPDATE is not set
|
||||
# CONFIG_BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE is not set
|
||||
# CONFIG_BT_CTRL_BLE_LLCP_PHY_UPDATE is not set
|
||||
# end of BLE disconnect when instant passed
|
||||
# end of BLE disconnects when Instant Passed (0x28) occurs
|
||||
|
||||
# CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY is not set
|
||||
# CONFIG_BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS is not set
|
||||
# end of Controller Options
|
||||
|
||||
#
|
||||
# Common Options
|
||||
#
|
||||
CONFIG_BT_ALARM_MAX_NUM=50
|
||||
# CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set
|
||||
# end of Common Options
|
||||
|
||||
# CONFIG_BT_HCI_LOG_DEBUG_EN is not set
|
||||
|
@ -870,6 +897,7 @@ CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y
|
|||
# Legacy ADC Driver Configuration
|
||||
#
|
||||
# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK is not set
|
||||
|
||||
#
|
||||
# Legacy ADC Calibration Configuration
|
||||
|
@ -882,42 +910,49 @@ CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y
|
|||
# Legacy MCPWM Driver Configurations
|
||||
#
|
||||
# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_MCPWM_SKIP_LEGACY_CONFLICT_CHECK is not set
|
||||
# end of Legacy MCPWM Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy Timer Group Driver Configurations
|
||||
#
|
||||
# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_GPTIMER_SKIP_LEGACY_CONFLICT_CHECK is not set
|
||||
# end of Legacy Timer Group Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy RMT Driver Configurations
|
||||
#
|
||||
# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_RMT_SKIP_LEGACY_CONFLICT_CHECK is not set
|
||||
# end of Legacy RMT Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy I2S Driver Configurations
|
||||
#
|
||||
# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_I2S_SKIP_LEGACY_CONFLICT_CHECK is not set
|
||||
# end of Legacy I2S Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy PCNT Driver Configurations
|
||||
#
|
||||
# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_PCNT_SKIP_LEGACY_CONFLICT_CHECK is not set
|
||||
# end of Legacy PCNT Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy SDM Driver Configurations
|
||||
#
|
||||
# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_SDM_SKIP_LEGACY_CONFLICT_CHECK is not set
|
||||
# end of Legacy SDM Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy Temperature Sensor Driver Configurations
|
||||
#
|
||||
# CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_TEMP_SENSOR_SKIP_LEGACY_CONFLICT_CHECK is not set
|
||||
# end of Legacy Temperature Sensor Driver Configurations
|
||||
# end of Driver Configurations
|
||||
|
||||
|
@ -1097,6 +1132,13 @@ CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y
|
|||
CONFIG_ESP_GDBSTUB_MAX_TASKS=32
|
||||
# end of GDB Stub
|
||||
|
||||
#
|
||||
# ESP HID
|
||||
#
|
||||
CONFIG_ESPHID_TASK_SIZE_BT=2048
|
||||
CONFIG_ESPHID_TASK_SIZE_BLE=4096
|
||||
# end of ESP HID
|
||||
|
||||
#
|
||||
# ESP HTTP client
|
||||
#
|
||||
|
@ -1681,7 +1723,6 @@ CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2
|
|||
CONFIG_HAL_WDT_USE_ROM_IMPL=y
|
||||
CONFIG_HAL_SPI_MASTER_FUNC_IN_IRAM=y
|
||||
CONFIG_HAL_SPI_SLAVE_FUNC_IN_IRAM=y
|
||||
# CONFIG_HAL_ECDSA_GEN_SIG_CM is not set
|
||||
# end of Hardware Abstraction Layer (HAL) and Low Level (LL)
|
||||
|
||||
#
|
||||
|
@ -2125,6 +2166,7 @@ CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y
|
|||
CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y
|
||||
CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y
|
||||
CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y
|
||||
CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_PATCH_VERSION=y
|
||||
# end of Protocomm
|
||||
|
||||
#
|
||||
|
@ -2417,6 +2459,17 @@ CONFIG_MDNS_TASK_STACK_SIZE=4096
|
|||
CONFIG_MDNS_TASK_AFFINITY_CPU0=y
|
||||
# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set
|
||||
CONFIG_MDNS_TASK_AFFINITY=0x0
|
||||
|
||||
#
|
||||
# MDNS Memory Configuration
|
||||
#
|
||||
# CONFIG_MDNS_TASK_CREATE_FROM_SPIRAM is not set
|
||||
CONFIG_MDNS_TASK_CREATE_FROM_INTERNAL=y
|
||||
# CONFIG_MDNS_MEMORY_ALLOC_SPIRAM is not set
|
||||
CONFIG_MDNS_MEMORY_ALLOC_INTERNAL=y
|
||||
# CONFIG_MDNS_MEMORY_CUSTOM_IMPL is not set
|
||||
# end of MDNS Memory Configuration
|
||||
|
||||
CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000
|
||||
CONFIG_MDNS_TIMER_PERIOD_MS=100
|
||||
# CONFIG_MDNS_NETWORKING_SOCKET is not set
|
||||
|
@ -2567,7 +2620,6 @@ CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
|
|||
CONFIG_ESP32S3_DEBUG_OCDAWARE=y
|
||||
CONFIG_BROWNOUT_DET=y
|
||||
CONFIG_ESP32S3_BROWNOUT_DET=y
|
||||
CONFIG_ESP32S3_BROWNOUT_DET=y
|
||||
CONFIG_BROWNOUT_DET_LVL_SEL_7=y
|
||||
CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y
|
||||
# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set
|
||||
|
@ -2597,8 +2649,6 @@ CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32
|
|||
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_TX_BA_WIN=6
|
||||
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_RX_BA_WIN=6
|
||||
CONFIG_ESP32_WIFI_RX_BA_WIN=6
|
||||
# CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED is not set
|
||||
CONFIG_ESP32_WIFI_NVS_ENABLED=y
|
||||
|
|
|
@ -1 +1 @@
|
|||
Welcome to KTag! SPIFFS version 00.37
|
||||
Welcome to KTag! SPIFFS version 00.39
|
|
@ -6,15 +6,22 @@
|
|||
Config_Version=1
|
||||
Model=2024A
|
||||
|
||||
; Device-Specific
|
||||
Device_Name=Another 32ESP'al
|
||||
|
||||
; Game Settings
|
||||
Player_ID=1
|
||||
Team_ID=1
|
||||
Weapon_ID=10
|
||||
Max_Health=100
|
||||
N_Special_Weapons_On_Reentry=1
|
||||
T_Start_Game_in_ms=30000
|
||||
T_Game_Length_in_ms=600000
|
||||
Secondary_Color=0
|
||||
|
||||
; Hardware Settings
|
||||
Is_Right_Handed=1
|
||||
Audio_Volume=30
|
||||
T_Start_Game_in_ms=30000
|
||||
|
||||
; WiFi
|
||||
; SSID and password of the network this device should connect to when it is in range.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue