messaging subsystem wip

This commit is contained in:
Sebastien
2020-02-19 08:02:58 -05:00
parent 8c3a52d40c
commit 4de4e07d99
28 changed files with 369 additions and 143 deletions

158
.cproject
View File

@@ -143,7 +143,7 @@
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1674304340" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1674304340" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder arguments="-j8 EXTRA_CPPFLAGS=&quot;-DRECOVERY_APPLICATION=1&quot;" command="make" id="cdt.managedbuild.builder.gnu.cross.1616827916" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/> <builder arguments="${IDF_PATH}/tools/windows/eclipse_make.py -j8 EXTRA_CPPFLAGS=&quot;-DRECOVERY_APPLICATION=1&quot;" command="python" id="cdt.managedbuild.builder.gnu.cross.1616827916" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1397900624" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler"> <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1397900624" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
@@ -203,7 +203,7 @@
<extensions> <extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> <extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
@@ -225,37 +225,57 @@
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291." name="/" resourcePath=""> <folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.845245133" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base"> <toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.base.1435070946" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.base">
<option id="cdt.managedbuild.option.gnu.cross.prefix.1090509495" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.Cygwin_PE" id="cdt.managedbuild.target.gnu.platform.cygwin.base.1190062192" name="Debug Platform" osList="win32" superClass="cdt.managedbuild.target.gnu.platform.cygwin.base"/>
<option id="cdt.managedbuild.option.gnu.cross.path.447265559" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/> <builder arguments="c:/msys32/opt/esp-idf/tools/windows/eclipse_make.py" buildPath="${workspace_loc:/squeezelite-esp32}" command="python" id="cdt.managedbuild.target.gnu.builder.cygwin.base.369581443" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="true" superClass="cdt.managedbuild.target.gnu.builder.cygwin.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1831977109" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/> <outputEntries>
<builder arguments="&quot;c:/msys32/opt/esp-idf/tools/windows/eclipse_make.py&quot;" buildPath="${workspace_loc:/squeezelite-esp32}" command="python" enabledIncrementalBuild="true" id="cdt.managedbuild.builder.gnu.cross.1069921467" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="cdt.managedbuild.builder.gnu.cross"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name=""/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1302011176" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler"> </outputEntries>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.623798750" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/> </builder>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.539301587" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> <tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.base.1072396116" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.base">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.402752019" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/squeezelite-esp32/build/include}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.270614468" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool> </tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1722031516" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler"> <tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.530059524" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.2010227748" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/> <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.374672233" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2073997022" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.1772207570" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.include.paths.1095611931" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.598708441" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"/>
</tool> </tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.746651743" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/> <tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.336308120" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.base">
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.149944553" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker"> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.include.paths.1101820056" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1372009292" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.2132792279" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.base.2029616393" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base.1857989053" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.666849419" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
@@ -265,14 +285,6 @@
</tool> </tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.649046248" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.2132030687" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1779870241" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain> </toolChain>
</folderInfo> </folderInfo>
@@ -299,7 +311,7 @@
<extensions> <extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> <extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
@@ -321,37 +333,43 @@
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736." name="/" resourcePath=""> <folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1034176750" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base"> <toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.base.1749450260" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.base">
<option id="cdt.managedbuild.option.gnu.cross.prefix.1038632104" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.Cygwin_PE" id="cdt.managedbuild.target.gnu.platform.cygwin.base.1830783239" name="Debug Platform" osList="win32" superClass="cdt.managedbuild.target.gnu.platform.cygwin.base"/>
<option id="cdt.managedbuild.option.gnu.cross.path.1589817380" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/> <builder arguments="${IDF_PATH}/tools/windows/eclipse_make.py" command="python" enabledIncrementalBuild="false" id="cdt.managedbuild.target.gnu.builder.cygwin.base.16407419" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.target.gnu.builder.cygwin.base"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.784380822" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/> <tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.base.343234684" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.base">
<builder arguments="&quot;C:/msys32/opt/esp-idf/tools/windows/eclipse_make.py&quot; -j8 EXTRA_CPPFLAGS=&quot;-DRECOVERY_APPLICATION=0&quot;" command="python" id="cdt.managedbuild.builder.gnu.cross.1150681639" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/> <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1149757934" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.824219909" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.217201640" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.644208200" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool> </tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1907231332" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler"> <tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.1424416364" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.959275134" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/> <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.1318127751" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.604467026" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.412733367" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1066196867" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"/>
</tool> </tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1073903870" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/> <tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.1943976795" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.base">
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.898376794" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker"> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.include.paths.1485056168" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1560070168" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.853026888" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.995286763" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.base.1006773344" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base.173885572" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.260247800" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
@@ -361,14 +379,6 @@
</tool> </tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.1462690215" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.40469999" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.798539361" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain> </toolChain>
</folderInfo> </folderInfo>
@@ -495,6 +505,24 @@
</scannerConfigBuildInfo> </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348;cdt.managedbuild.toolchain.gnu.cross.base.293933348.949515869;cdt.managedbuild.tool.gnu.cross.c.compiler.924305212;cdt.managedbuild.tool.gnu.c.compiler.input.851339966">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.1943976795;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.995286763">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1273482118;cdt.managedbuild.tool.gnu.cpp.compiler.input.553723389">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1907231332;cdt.managedbuild.tool.gnu.cpp.compiler.input.604467026"> <scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1907231332;cdt.managedbuild.tool.gnu.cpp.compiler.input.604467026">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
@@ -507,6 +535,12 @@
</scannerConfigBuildInfo> </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.374672233;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.598708441">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.;cdt.managedbuild.tool.gnu.cross.c.compiler.1302011176;cdt.managedbuild.tool.gnu.c.compiler.input.539301587"> <scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.;cdt.managedbuild.tool.gnu.cross.c.compiler.1302011176;cdt.managedbuild.tool.gnu.c.compiler.input.539301587">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
@@ -543,6 +577,12 @@
</scannerConfigBuildInfo> </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348;cdt.managedbuild.toolchain.gnu.cross.base.293933348.949515869;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1689301712;cdt.managedbuild.tool.gnu.cpp.compiler.input.1117032298">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1943329896;cdt.managedbuild.toolchain.gnu.cross.base.1943329896.30011915;cdt.managedbuild.tool.gnu.cross.c.compiler.2083405506;cdt.managedbuild.tool.gnu.c.compiler.input.404320567"> <scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1943329896;cdt.managedbuild.toolchain.gnu.cross.base.1943329896.30011915;cdt.managedbuild.tool.gnu.cross.c.compiler.2083405506;cdt.managedbuild.tool.gnu.c.compiler.input.404320567">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
@@ -555,18 +595,36 @@
</scannerConfigBuildInfo> </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.1318127751;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1066196867">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1476804786;cdt.managedbuild.toolchain.gnu.cross.base.1476804786.1800826258;cdt.managedbuild.tool.gnu.cross.c.compiler.1502936757;cdt.managedbuild.tool.gnu.c.compiler.input.1614739014"> <scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1476804786;cdt.managedbuild.toolchain.gnu.cross.base.1476804786.1800826258;cdt.managedbuild.tool.gnu.cross.c.compiler.1502936757;cdt.managedbuild.tool.gnu.c.compiler.input.1614739014">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo> </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.336308120;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.2132792279">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934;cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934.;cdt.managedbuild.tool.gnu.cross.c.compiler.1397900624;cdt.managedbuild.tool.gnu.c.compiler.input.24917724"> <scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934;cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934.;cdt.managedbuild.tool.gnu.cross.c.compiler.1397900624;cdt.managedbuild.tool.gnu.c.compiler.input.24917724">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo> </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.;cdt.managedbuild.tool.gnu.cross.c.compiler.450178081;cdt.managedbuild.tool.gnu.c.compiler.input.501888865">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule> </storageModule>
</cproject> </cproject>

View File

@@ -0,0 +1,2 @@
eclipse.preferences.version=1
suppressions=rO0ABXNyAAxqYXZhLmlvLkZpbGUELaRFDg3k/wMAAUwABHBhdGh0ABJMamF2YS9sYW5nL1N0cmluZzt4cHQAJWNvbXBvbmVudHNcd2lmaS1tYW5hZ2VyXGh0dHBfc2VydmVyLmN3AgBceA\=\=;comparePointers;395\!rO0ABXNyAAxqYXZhLmlvLkZpbGUELaRFDg3k/wMAAUwABHBhdGh0ABJMamF2YS9sYW5nL1N0cmluZzt4cHQAE21haW5cZXNwX2FwcF9tYWluLmN3AgBceA\=\=;comparePointers;176\!rO0ABXNyAAxqYXZhLmlvLkZpbGUELaRFDg3k/wMAAUwABHBhdGh0ABJMamF2YS9sYW5nL1N0cmluZzt4cHQAJ2NvbXBvbmVudHNcdGVsbmV0XGxpYnRlbG5ldFxsaWJ0ZWxuZXQuY3cCAFx4;va_list_usedBeforeStarted;2147483647\!

View File

@@ -57,9 +57,9 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(g?cc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/> <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)" prefer-non-shared="true" resource-scope="per-folder"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1502478736382965477" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="true" env-hash="1307847274017589925" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="xtensa-esp32-elf-gcc ${FLAGS} -std=c++11 -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
@@ -81,7 +81,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="true" name="CDT GCC Build Output Parser" parameter="xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)" prefer-non-shared="true"/> <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)" prefer-non-shared="true" resource-scope="per-project"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1766868238676867652" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="xtensa-esp32-elf-gcc ${FLAGS} -std=c++11 -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1766868238676867652" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="xtensa-esp32-elf-gcc ${FLAGS} -std=c++11 -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">

View File

@@ -32,7 +32,7 @@ environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.16039962
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/EXTRA_CPPFLAGS/value=-DRECOVERY_APPLICATION\=0 environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/EXTRA_CPPFLAGS/value=-DRECOVERY_APPLICATION\=0
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/IDF_PATH/delimiter=\: environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/IDF_PATH/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/IDF_PATH/operation=replace environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/IDF_PATH/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/IDF_PATH/value=C\:/msys32/opt/esp-idf environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/IDF_PATH/value=c\:/msys32/opt/esp-idf
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PATH/delimiter=\: environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PATH/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PATH/operation=replace environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PATH/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PATH/value=C\:\\msys32\\usr\\bin;C\:\\msys32\\mingw32\\bin;C\:\\msys32\\opt\\xtensa-esp32-elf\\bin\\ environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PATH/value=C\:\\msys32\\usr\\bin;C\:\\msys32\\mingw32\\bin;C\:\\msys32\\opt\\xtensa-esp32-elf\\bin\\
@@ -52,10 +52,10 @@ environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.16039962
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/EXTRA_CPPFLAGS/value=-DRECOVERY_APPLICATION\=1 environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/EXTRA_CPPFLAGS/value=-DRECOVERY_APPLICATION\=1
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/delimiter=\: environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/operation=replace environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/value=C\:/msys32/opt/esp-idf environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/value=c\:/msys32/opt/esp-idf
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/delimiter=\: environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/operation=replace environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/value=C\:\\msys32\\opt\\openocd-esp32\\bin;c\:\\msys32\\opt\\xtensa-esp32-elf\\bin\\;c\:\\msys32\\mingw32\\bin;C\:\\msys32\\usr\\bin;c\:\\Python27;C\:\\msys32\\usr\\bin\\vendor_perl;C\:\\msys32\\usr\\bin\\core_perl environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/value=c\:\\msys32\\opt\\openocd-esp32\\bin;c\:\\msys32\\opt\\xtensa-esp32-elf\\bin\\;c\:\\msys32\\mingw32\\bin;C\:\\msys32\\usr\\bin;c\:\\Python27;C\:\\msys32\\usr\\bin\\vendor_perl;C\:\\msys32\\usr\\bin\\core_perl
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/delimiter=\: environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/operation=replace environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/value=recovery environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/value=recovery
@@ -102,6 +102,9 @@ environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_VER/delimiter=\: environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_VER/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_VER/operation=append environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_VER/operation=append
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_VER/value=custom environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_VER/value=custom
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/WIN_IDF_PATH/delimiter=;
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/WIN_IDF_PATH/operation=append
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/WIN_IDF_PATH/value=c\:/msys32/opt/esp-idf
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/append=true environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/append=true
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/appendContributed=true environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/appendContributed=true
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/BATCH_BUILD/delimiter=; environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/BATCH_BUILD/delimiter=;

View File

@@ -13,7 +13,10 @@
#recovery: CPPFLAGS+=-DRECOVERY_APPLICATION=1 #recovery: CPPFLAGS+=-DRECOVERY_APPLICATION=1
PROJECT_NAME?=squeezelite PROJECT_NAME?=squeezelite
CPPFLAGS+= -Wno-error=maybe-uninitialized \
-I$(PROJECT_PATH)/main
include $(IDF_PATH)/make/project.mk include $(IDF_PATH)/make/project.mk
# for future gcc version, this could be needed: CPPFLAGS+= -Wno-error=format-overflow -Wno-error=stringop-truncation # for future gcc version, this could be needed: CPPFLAGS+= -Wno-error=format-overflow -Wno-error=stringop-truncation
CPPFLAGS+= -Wno-error=maybe-uninitialized

View File

@@ -1,5 +1,5 @@
idf_component_register(SRCS "cmd_i2ctools.c" idf_component_register(SRCS "cmd_i2ctools.c"
INCLUDE_DIRS "." "../tools/" INCLUDE_DIRS "." "$(PROJECT_PATH)/components/tools/"
REQUIRES esp_common REQUIRES esp_common
PRIV_REQUIRES freertos esp32 spi_flash newlib log console pthread PRIV_REQUIRES freertos esp32 spi_flash newlib log console pthread
) )

View File

@@ -1,9 +1,6 @@
# #
# Main Makefile. This is basically the same as a component makefile. # Main Makefile. This is basically the same as a component makefile.
# #
CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO \
-I$(COMPONENT_PATH)/../tools
COMPONENT_ADD_INCLUDEDIRS := . COMPONENT_ADD_INCLUDEDIRS := .
COMPONENT_ADD_INCLUDEDIRS += $(COMPONENT_PATH)/../tools CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO
COMPONENT_ADD_INCLUDEDIRS += $(COMPONENT_PATH)/../squeezelite-ota COMPONENT_SRCDIRS := .
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main/

View File

@@ -8,6 +8,3 @@
# #
COMPONENT_ADD_INCLUDEDIRS := . COMPONENT_ADD_INCLUDEDIRS := .
CFLAGS += -I$(COMPONENT_PATH)/../squeezelite-ota
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/components/tools/
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main

View File

@@ -8,5 +8,3 @@
# #
COMPONENT_ADD_INCLUDEDIRS := . COMPONENT_ADD_INCLUDEDIRS := .
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main/
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/components/tools/

View File

@@ -1,5 +1,5 @@
idf_component_register(SRCS "led.c" "audio_controls.c" "buttons.c" "services.c" "monitor.c"INCLUDE_DIRS idf_component_register(SRCS "led.c" "audio_controls.c" "buttons.c" "services.c" "monitor.c"INCLUDE_DIRS
INCLUDE_DIRS . ../tools/ INCLUDE_DIRS . $(PROJECT_PATH)/components/tools/
) )

View File

@@ -1,5 +1,5 @@
idf_component_register(SRCS "bt_app_core.c" "bt_app_sink.c" "bt_app_source.c" idf_component_register(SRCS "bt_app_core.c" "bt_app_sink.c" "bt_app_source.c"
INCLUDE_DIRS "." "../tools/" INCLUDE_DIRS "." "$($(PROJECT_PATH)/components/)/components/tools/"
REQUIRES esp_common REQUIRES esp_common
PRIV_REQUIRES freertos bt io nvs_flash esp32 spi_flash newlib log console pthread PRIV_REQUIRES freertos bt io nvs_flash esp32 spi_flash newlib log console pthread
) )

View File

@@ -7,8 +7,4 @@
# please read the SDK documents if you need to do this. # please read the SDK documents if you need to do this.
# #
CFLAGS += -I$(COMPONENT_PATH)/../tools \
-I$(COMPONENT_PATH)/../config
COMPONENT_ADD_INCLUDEDIRS := . COMPONENT_ADD_INCLUDEDIRS := .
COMPONENT_ADD_INCLUDEDIRS += $(COMPONENT_PATH)/../tools
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main/

View File

@@ -8,6 +8,6 @@
# #
CFLAGS += -fstack-usage\ CFLAGS += -fstack-usage\
-I$(COMPONENT_PATH)/../tools \ -I$(PROJECT_PATH)/components/tools \
-I$(COMPONENT_PATH)/../codecs/inc/alac \ -I$(PROJECT_PATH)/components/codecs/inc/alac \
-I$(PROJECT_PATH)/main/ -I$(PROJECT_PATH)/main/

View File

@@ -1,5 +1,5 @@
idf_component_register(SRCS "led.c" "audio_controls.c" "buttons.c" "services.c" "monitor.c"INCLUDE_DIRS idf_component_register(SRCS "led.c" "audio_controls.c" "buttons.c" "services.c" "monitor.c" "messaging.c"
INCLUDE_DIRS . ../tools/ INCLUDE_DIRS . $(PROJECT_PATH)/components/tools/
) )

View File

@@ -0,0 +1,125 @@
/**
*
*/
#include <stdlib.h> // Required for libtelnet.h
#include <esp_log.h>
#include "stdbool.h"
#include <lwip/def.h>
#include <lwip/sockets.h>
#include <errno.h>
#include <string.h>
#include "esp_app_trace.h"
#include "esp_attr.h"
#include "config.h"
#include "nvs_utilities.h"
#include "platform_esp32.h"
#include "messaging.h"
/************************************
* Globals
*/
const static char tag[] = "messaging";
static messaging_list_t top;
RingbufHandle_t messaging_create_ring_buffer(uint8_t max_count){
RingbufHandle_t buf_handle = NULL;
StaticRingbuffer_t *buffer_struct = (StaticRingbuffer_t *)heap_caps_malloc(sizeof(StaticRingbuffer_t), MALLOC_CAP_SPIRAM);
if (buffer_struct != NULL) {
size_t buf_size = (size_t )(sizeof(single_message_t)+8)*(size_t )(max_count>0?max_count:5); // no-split buffer requires an additional 8 bytes
uint8_t *buffer_storage = (uint8_t *)heap_caps_malloc(buf_size, MALLOC_CAP_SPIRAM);
if (buffer_storage== NULL) {
ESP_LOGE(tag,"Failed to allocate memory for messaging ring buffer !");
}
else {
buf_handle = xRingbufferCreateStatic(buf_size, RINGBUF_TYPE_NOSPLIT, buffer_storage, buffer_struct);
if (buf_handle == NULL) {
ESP_LOGE(tag,"Failed to create messaging ring buffer !");
}
}
}
else {
ESP_LOGE(tag,"Failed to create ring buffer for messaging!");
}
return buf_handle;
}
RingbufHandle_t messaging_register_subscriber(uint8_t max_count, char * name){
messaging_list_t * cur=&top;
while(cur->next){
cur = cur->next;
}
cur->next=heap_caps_malloc(sizeof(messaging_list_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
if(!cur->next){
ESP_LOGE(tag,"Failed to allocate messaging subscriber entry!");
return NULL;
}
memset(cur->next,0x00,sizeof(messaging_list_t));
cur = cur->next;
cur->buf_handle = messaging_create_ring_buffer(max_count);
strncpy(cur->subscriber_name,name,sizeof(cur->subscriber_name));
return cur->buf_handle;
}
esp_err_t messaging_service_init(){
top.buf_handle = messaging_create_ring_buffer(max_count);
if(!top.buf_handle){
ESP_LOGE(tag, "messaging service init failed.");
}
strncpy(top.subscriber_name,"messaging");
return (top.buf_handle!=NULL);
}
cJSON * messaging_retrieve_messages(RingbufHandle_t buf_handle){
single_message_t * message=NULL;
cJSON * json_messages=cJSON_CreateArray();
cJSON * json_message=NULL;
size_t item_size;
UBaseType_t uxItemsWaiting;
vRingbufferGetInfo(buf_handle, NULL, NULL, NULL, NULL, &uxItemsWaiting);
if(uxItemsWaiting>0){
message = (single_message_t *)xRingbufferReceive(buf_handle, &item_size, pdMS_TO_TICKS(50));
//Check received data
if (message== NULL) {
ESP_LOGE(tag,"Failed to receive message from buffer!");
}
else {
json_message = cJSON_CreateObject();
cJSON_AddStringToObject(json_message, "message", message->message);
cJSON_AddStringToObject(json_message, "type", message->message);
cJSON_AddNumberToObject(json_message,"sent_time",message->sent_time);
cJSON_AddNumberToObject(json_message,"current_time",esp_timer_get_time() / 1000);
cJSON_AddItemToArray(json_messages,json_message);
vRingbufferReturnItem(buf_handle, (void *)message);
}
}
return json_messages;
}
void messaging_release_message(RingbufHandle_t buf_handle, single_message_t * message){
}
esp_err_t messageing_post_to_queue(messaging_list_t * subscriber, single_message_t * message){
UBaseType_t res = xRingbufferSend(subscriber->buf_handle, message, sizeof(message), pdMS_TO_TICKS(1000));
if (res != pdTRUE) {
ESP_LOGE(tag,"Failed to post message to subscriber %s",subscriber->subscriber_name);
return ESP_FAIL;
}
return ESP_OK;
}
void messaging_post_message(messaging_types type, char *fmt, ...){
single_message_t message={};
messaging_list_t * cur=&top;
va_list va;
va_start(va, fmt);
vsnprintf(message.message, sizeof(message.message), fmt, va);
va_end(va);
message.type = type;
message.sent_time = esp_timer_get_time() / 1000;
while(cur->next){
messageing_post_to_queue(cur, &message);
cur = cur->next;
}
return;
}

View File

@@ -0,0 +1,25 @@
#include "sdkconfig.h"
#include "freertos/ringbuf.h"
#include "cJSON.h"
#pragma once
typedef enum {
MESSAGING_INFO,
MESSAGING_WARNING,
MESSAGING_ERROR
} messaging_types;
typedef struct {
void * next;
char subscriber_name[21];
RingbufHandle_t buf_handle;
} messaging_list_t;
typedef struct {
time_t sent_time;
messaging_types type;
char message[101];
} single_message_t;
cJSON * messaging_retrieve_messages(RingbufHandle_t buf_handle);
RingbufHandle_t messaging_register_subscriber(uint8_t max_count, char * name);
void messaging_post_message(messaging_types type, char * fmt, ...);

View File

@@ -51,6 +51,7 @@ void set_power_gpio(int gpio, char *value) {
* *
*/ */
void services_init(void) { void services_init(void) {
messaging_service_init();
gpio_install_isr_service(0); gpio_install_isr_service(0);
#ifdef CONFIG_I2C_LOCKED #ifdef CONFIG_I2C_LOCKED

View File

@@ -5,9 +5,6 @@
# todo: add support for https # todo: add support for https
COMPONENT_ADD_INCLUDEDIRS := . COMPONENT_ADD_INCLUDEDIRS := .
COMPONENT_ADD_INCLUDEDIRS += include
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main/
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/components/tools
CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO -DCONFIG_OTA_ALLOW_HTTP=1 CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO -DCONFIG_OTA_ALLOW_HTTP=1

View File

@@ -28,6 +28,7 @@
#include "esp_flash_encrypt.h" #include "esp_flash_encrypt.h"
#include "esp_spi_flash.h" #include "esp_spi_flash.h"
#include "sdkconfig.h" #include "sdkconfig.h"
#include "messaging.h"
#include "esp_ota_ops.h" #include "esp_ota_ops.h"
extern const char * get_certificate(); extern const char * get_certificate();
@@ -75,8 +76,6 @@ static struct {
struct timeval tv; struct timeval tv;
static esp_http_client_config_t ota_config; static esp_http_client_config_t ota_config;
extern void wifi_manager_refresh_ota_json();
void _printMemStats(){ void _printMemStats(){
ESP_LOGD(TAG,"Heap internal:%zu (min:%zu) external:%zu (min:%zu)", ESP_LOGD(TAG,"Heap internal:%zu (min:%zu) external:%zu (min:%zu)",
heap_caps_get_free_size(MALLOC_CAP_INTERNAL), heap_caps_get_free_size(MALLOC_CAP_INTERNAL),
@@ -84,22 +83,12 @@ void _printMemStats(){
heap_caps_get_free_size(MALLOC_CAP_SPIRAM), heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM)); heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
} }
void triggerStatusJsonRefresh(bool bDelay,const char * status, ...){ void sendMessaging(messaging_types type,char * fmt, ...){
va_list args; va_list args;
va_start(args, status); va_start(args, fmt);
vsnprintf(ota_status.status_text,sizeof(ota_status.status_text)-1,status, args); messaging_post_message(type, fmt, args);
va_end(args); va_end(args);
_printMemStats(); _printMemStats();
wifi_manager_refresh_ota_json();
if(bDelay){
ESP_LOGD(TAG,"Holding task...");
vTaskDelay(200 / portTICK_PERIOD_MS); // wait here for a short amount of time. This will help with refreshing the UI status
ESP_LOGD(TAG,"Done holding task...");
}
else {
ESP_LOGI(TAG,"%s",ota_status.status_text);
taskYIELD();
}
} }
const char * ota_get_status(){ const char * ota_get_status(){
if(!ota_status.bInitialized) if(!ota_status.bInitialized)
@@ -151,7 +140,7 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
case HTTP_EVENT_ON_CONNECTED: case HTTP_EVENT_ON_CONNECTED:
ESP_LOGD(TAG, "HTTP_EVENT_ON_CONNECTED"); ESP_LOGD(TAG, "HTTP_EVENT_ON_CONNECTED");
if(ota_status.bOTAStarted) triggerStatusJsonRefresh(true,"Installing..."); if(ota_status.bOTAStarted) sendMessaging(MESSAGING_INFO,"Installing...");
ota_status.total_image_len=0; ota_status.total_image_len=0;
ota_status.actual_image_len=0; ota_status.actual_image_len=0;
ota_status.lastpct=0; ota_status.lastpct=0;
@@ -193,7 +182,7 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
esp_err_t init_config(ota_thread_parms_t * p_ota_thread_parms){ esp_err_t init_config(ota_thread_parms_t * p_ota_thread_parms){
memset(&ota_config, 0x00, sizeof(ota_config)); memset(&ota_config, 0x00, sizeof(ota_config));
ota_status.bInitialized = true; ota_status.bInitialized = true;
triggerStatusJsonRefresh(true,"Initializing..."); sendMessaging(MESSAGING_INFO,"Initializing...");
ota_status.ota_type= OTA_TYPE_INVALID; ota_status.ota_type= OTA_TYPE_INVALID;
if(p_ota_thread_parms->url !=NULL && strlen(p_ota_thread_parms->url)>0 ){ if(p_ota_thread_parms->url !=NULL && strlen(p_ota_thread_parms->url)>0 ){
ota_status.ota_type= OTA_TYPE_HTTP; ota_status.ota_type= OTA_TYPE_HTTP;
@@ -294,7 +283,7 @@ esp_err_t _erase_last_boot_app_partition(esp_partition_t *ota_partition)
err=esp_partition_erase_range(ota_partition, i*single_pass_size, single_pass_size); err=esp_partition_erase_range(ota_partition, i*single_pass_size, single_pass_size);
if(err!=ESP_OK) return err; if(err!=ESP_OK) return err;
if(i%2) { if(i%2) {
triggerStatusJsonRefresh(false,"Erasing flash (%u/%u)",i,num_passes); sendMessaging(MESSAGING_INFO,"Erasing flash (%u/%u)",i,num_passes);
} }
vTaskDelay(200/ portTICK_PERIOD_MS); // wait here for a short amount of time. This will help with reducing WDT errors vTaskDelay(200/ portTICK_PERIOD_MS); // wait here for a short amount of time. This will help with reducing WDT errors
} }
@@ -302,7 +291,7 @@ esp_err_t _erase_last_boot_app_partition(esp_partition_t *ota_partition)
err=esp_partition_erase_range(ota_partition, ota_partition->size-remain_size, remain_size); err=esp_partition_erase_range(ota_partition, ota_partition->size-remain_size, remain_size);
if(err!=ESP_OK) return err; if(err!=ESP_OK) return err;
} }
triggerStatusJsonRefresh(true,"Erasing flash complete."); sendMessaging(MESSAGING_INFO,"Erasing flash complete.");
taskYIELD(); taskYIELD();
return ESP_OK; return ESP_OK;
} }
@@ -394,7 +383,7 @@ void ota_task_cleanup(const char * message, ...){
if(message!=NULL){ if(message!=NULL){
va_list args; va_list args;
va_start(args, message); va_start(args, message);
triggerStatusJsonRefresh(true,message, args); sendMessaging(MESSAGING_ERROR,message, args);
va_end(args); va_end(args);
ESP_LOGE(TAG, "%s",ota_status.status_text); ESP_LOGE(TAG, "%s",ota_status.status_text);
} }
@@ -438,7 +427,7 @@ void ota_task(void *pvParameter)
/* Locate and erase ota application partition */ /* Locate and erase ota application partition */
ESP_LOGW(TAG,"**************** Expecting WATCHDOG errors below during flash erase. This is OK and not to worry about **************** "); ESP_LOGW(TAG,"**************** Expecting WATCHDOG errors below during flash erase. This is OK and not to worry about **************** ");
triggerStatusJsonRefresh(true,"Erasing OTA partition"); sendMessaging(MESSAGING_INFO,"Erasing OTA partition");
esp_partition_t *ota_partition = _get_ota_partition(ESP_PARTITION_SUBTYPE_APP_OTA_0); esp_partition_t *ota_partition = _get_ota_partition(ESP_PARTITION_SUBTYPE_APP_OTA_0);
if(ota_partition == NULL){ if(ota_partition == NULL){
ESP_LOGE(TAG,"Unable to locate OTA application partition. "); ESP_LOGE(TAG,"Unable to locate OTA application partition. ");
@@ -460,7 +449,7 @@ void ota_task(void *pvParameter)
_printMemStats(); _printMemStats();
ota_status.bOTAStarted = true; ota_status.bOTAStarted = true;
triggerStatusJsonRefresh(true,"Starting OTA..."); sendMessaging(MESSAGING_INFO,"Starting OTA...");
if (ota_status.ota_type == OTA_TYPE_HTTP){ if (ota_status.ota_type == OTA_TYPE_HTTP){
ota_http_client = esp_http_client_init(&ota_config); ota_http_client = esp_http_client_init(&ota_config);
if (ota_http_client == NULL) { if (ota_http_client == NULL) {
@@ -554,7 +543,7 @@ void ota_task(void *pvParameter)
gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
uint32_t elapsed_ms= (tv.tv_sec-ota_status.OTA_start.tv_sec )*1000+(tv.tv_usec-ota_status.OTA_start.tv_usec)/1000; uint32_t elapsed_ms= (tv.tv_sec-ota_status.OTA_start.tv_sec )*1000+(tv.tv_usec-ota_status.OTA_start.tv_usec)/1000;
ESP_LOGI(TAG,"OTA progress : %d/%d (%d pct), %d KB/s", ota_status.actual_image_len, ota_status.total_image_len, ota_status.newpct, elapsed_ms>0?ota_status.actual_image_len*1000/elapsed_ms/1024:0); ESP_LOGI(TAG,"OTA progress : %d/%d (%d pct), %d KB/s", ota_status.actual_image_len, ota_status.total_image_len, ota_status.newpct, elapsed_ms>0?ota_status.actual_image_len*1000/elapsed_ms/1024:0);
triggerStatusJsonRefresh(true,ota_status.ota_type == OTA_TYPE_HTTP?"Downloading & writing update.":"Writing binary file."); sendMessaging(MESSAGING_INFO,ota_status.ota_type == OTA_TYPE_HTTP?"Downloading & writing update.":"Writing binary file.");
ota_status.lastpct=ota_status.newpct; ota_status.lastpct=ota_status.newpct;
} }
taskYIELD(); taskYIELD();
@@ -581,7 +570,7 @@ void ota_task(void *pvParameter)
err = esp_ota_set_boot_partition(ota_partition); err = esp_ota_set_boot_partition(ota_partition);
if (err == ESP_OK) { if (err == ESP_OK) {
ESP_LOGI(TAG,"OTA Process completed successfully!"); ESP_LOGI(TAG,"OTA Process completed successfully!");
triggerStatusJsonRefresh(true,"Success!"); sendMessaging(MESSAGING_INFO,"Success!");
vTaskDelay(1500/ portTICK_PERIOD_MS); // wait here to give the UI a chance to refresh vTaskDelay(1500/ portTICK_PERIOD_MS); // wait here to give the UI a chance to refresh
esp_restart(); esp_restart();
} else { } else {

View File

@@ -3,21 +3,21 @@
# #
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
CFLAGS += -O3 -DLINKALL -DLOOPBACK -DNO_FAAD -DRESAMPLE16 -DEMBEDDED -DTREMOR_ONLY -DBYTES_PER_FRAME=4 \ CFLAGS += -O3 -DLINKALL -DLOOPBACK -DNO_FAAD -DRESAMPLE16 -DEMBEDDED -DTREMOR_ONLY -DBYTES_PER_FRAME=4 \
-I$(COMPONENT_PATH)/../codecs/inc \ -I$(PROJECT_PATH)/components/codecs/inc \
-I$(COMPONENT_PATH)/../codecs/inc/mad \ -I$(PROJECT_PATH)/components/codecs/inc/mad \
-I$(COMPONENT_PATH)/../codecs/inc/alac \ -I$(PROJECT_PATH)/components/codecs/inc/alac \
-I$(COMPONENT_PATH)/../codecs/inc/helix-aac \ -I$(PROJECT_PATH)/components/codecs/inc/helix-aac \
-I$(COMPONENT_PATH)/../codecs/inc/vorbis \ -I$(PROJECT_PATH)/components/codecs/inc/vorbis \
-I$(COMPONENT_PATH)/../codecs/inc/soxr \ -I$(PROJECT_PATH)/components/codecs/inc/soxr \
-I$(COMPONENT_PATH)/../codecs/inc/resample16 \ -I$(PROJECT_PATH)/components/codecs/inc/resample16 \
-I$(COMPONENT_PATH)/../tools \ -I$(PROJECT_PATH)/components/tools \
-I$(COMPONENT_PATH)/../codecs/inc/opus \ -I$(PROJECT_PATH)/components/codecs/inc/opus \
-I$(COMPONENT_PATH)/../codecs/inc/opusfile \ -I$(PROJECT_PATH)/components/codecs/inc/opusfile \
-I$(COMPONENT_PATH)/../driver_bt \ -I$(PROJECT_PATH)/components/driver_bt \
-I$(COMPONENT_PATH)/../raop \ -I$(PROJECT_PATH)/components/raop \
-I$(COMPONENT_PATH)/../services -I$(PROJECT_PATH)/components/services
# -I$(COMPONENT_PATH)/../codecs/inc/faad2 # -I$(PROJECT_PATH)/components/codecs/inc/faad2
COMPONENT_SRCDIRS := . tas57xx a1s external COMPONENT_SRCDIRS := . tas57xx a1s external
COMPONENT_ADD_INCLUDEDIRS := . ./tas57xx ./a1s COMPONENT_ADD_INCLUDEDIRS := . ./tas57xx ./a1s

View File

@@ -1,5 +1,5 @@
idf_component_register(SRCS "telnet.c" idf_component_register(SRCS "telnet.c"
INCLUDE_DIRS . INCLUDE_DIRS .
INCLUDE_DIRS . ../tools/ INCLUDE_DIRS . $(PROJECT_PATH)/components/tools/
) )

View File

@@ -10,6 +10,4 @@
COMPONENT_SRCDIRS := . COMPONENT_SRCDIRS := .
COMPONENT_SRCDIRS += ./libtelnet COMPONENT_SRCDIRS += ./libtelnet
COMPONENT_ADD_INCLUDEDIRS := . COMPONENT_ADD_INCLUDEDIRS := .
COMPONENT_ADD_INCLUDEDIRS += ./libtelnet COMPONENT_PRIV_INCLUDEDIRS += ./libtelnet
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main/

View File

@@ -646,12 +646,24 @@ function refreshAPHTML(data){
$( "#wifi-list" ).html(h) $( "#wifi-list" ).html(h)
} }
function getMessages() {
$.getJSON("/messages.json", function(data) {
data.forEach(function(msg) {
});
})
.fail(function(xhr, ajaxOptions, thrownError) {
console.log(xhr.status);
console.log(thrownError);
if (thrownError != '') showMessage(thrownError, 'ERROR');
});
}
function checkStatus(){ function checkStatus(){
RepeatCheckStatusInterval(); RepeatCheckStatusInterval();
if (!enableStatusTimer) return; if (!enableStatusTimer) return;
if (blockAjax) return; if (blockAjax) return;
blockAjax = true; blockAjax = true;
getMessages();
$.getJSON( "/status.json", function( data ) { $.getJSON( "/status.json", function( data ) {
if (data.hasOwnProperty('ssid') && data['ssid'] != ""){ if (data.hasOwnProperty('ssid') && data['ssid'] != ""){
if (data["ssid"] === selectedSSID){ if (data["ssid"] === selectedSSID){
@@ -881,6 +893,7 @@ function getConfig() {
}); });
} }
function showMessage(message, severity) { function showMessage(message, severity) {
if (severity == 'INFO') { if (severity == 'INFO') {
$('#message').css('background', '#6af'); $('#message').css('background', '#6af');

View File

@@ -7,13 +7,7 @@
# please read the SDK documents if you need to do this. # please read the SDK documents if you need to do this.
# #
COMPONENT_EMBED_FILES := style.css code.js index.html bootstrap.min.css.gz jquery.min.js.gz popper.min.js.gz bootstrap.min.js.gz COMPONENT_EMBED_FILES := style.css code.js index.html bootstrap.min.css.gz jquery.min.js.gz popper.min.js.gz bootstrap.min.js.gz
CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO \
-I$(COMPONENT_PATH)/../tools
COMPONENT_ADD_INCLUDEDIRS := . COMPONENT_ADD_INCLUDEDIRS := .
COMPONENT_ADD_INCLUDEDIRS += $(COMPONENT_PATH)/../tools CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO
COMPONENT_ADD_INCLUDEDIRS += $(COMPONENT_PATH)/../squeezelite-ota
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main/

View File

@@ -49,6 +49,7 @@ function to process requests, decode URLs, serve files, etc. etc.
#include "sys/param.h" #include "sys/param.h"
#include "esp_vfs.h" #include "esp_vfs.h"
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "messaging.h"
#define HTTP_STACK_SIZE (5*1024) #define HTTP_STACK_SIZE (5*1024)
#define FREE_AND_NULL(p) if(p!=NULL){ free(p); p=NULL;} #define FREE_AND_NULL(p) if(p!=NULL){ free(p); p=NULL;}
@@ -59,7 +60,7 @@ static const char TAG[] = "httpd_handlers";
/* @brief task handle for the http server */ /* @brief task handle for the http server */
SemaphoreHandle_t http_server_config_mutex = NULL; SemaphoreHandle_t http_server_config_mutex = NULL;
extern RingbufHandle_t messaging;
#define AUTH_TOKEN_SIZE 50 #define AUTH_TOKEN_SIZE 50
typedef struct session_context { typedef struct session_context {
char * auth_token; char * auth_token;
@@ -1039,6 +1040,31 @@ esp_err_t redirect_processor(httpd_req_t *req, httpd_err_code_t error){
esp_err_t redirect_ev_handler(httpd_req_t *req){ esp_err_t redirect_ev_handler(httpd_req_t *req){
return redirect_processor(req,0); return redirect_processor(req,0);
} }
esp_err_t messages_get_handler(httpd_req_t *req){
ESP_LOGD_LOC(TAG, "serving [%s]", req->uri);
if(!is_user_authenticated(req)){
// todo: redirect to login page
// return ESP_OK;
}
esp_err_t err = set_content_type_from_req(req);
if(err != ESP_OK){
return err;
}
cJSON * json_messages= messaging_retrieve_messages(messaging);
if(json_messages!=NULL){
char * json_text= cJSON_Print(json_messages);
httpd_resp_send(req, (const char *)json_text, strlen(json_text));
cJSON_free(json_messages);
free(json_text);
}
else {
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR , "Unable to retrieve messages");
}
return ESP_OK;
}
esp_err_t status_get_handler(httpd_req_t *req){ esp_err_t status_get_handler(httpd_req_t *req){
ESP_LOGD_LOC(TAG, "serving [%s]", req->uri); ESP_LOGD_LOC(TAG, "serving [%s]", req->uri);
if(!is_user_authenticated(req)){ if(!is_user_authenticated(req)){

View File

@@ -92,6 +92,8 @@ esp_err_t recovery_post_handler(httpd_req_t *req);
esp_err_t flash_post_handler(httpd_req_t *req); esp_err_t flash_post_handler(httpd_req_t *req);
#endif #endif
esp_err_t status_get_handler(httpd_req_t *req); esp_err_t status_get_handler(httpd_req_t *req);
esp_err_t messages_get_handler(httpd_req_t *req);
esp_err_t ap_scan_handler(httpd_req_t *req); esp_err_t ap_scan_handler(httpd_req_t *req);
esp_err_t redirect_ev_handler(httpd_req_t *req); esp_err_t redirect_ev_handler(httpd_req_t *req);
esp_err_t redirect_200_ev_handler(httpd_req_t *req); esp_err_t redirect_200_ev_handler(httpd_req_t *req);

View File

@@ -29,11 +29,12 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "config.h" #include "config.h"
#include "messaging.h"
static const char TAG[] = "http_server"; static const char TAG[] = "http_server";
static httpd_handle_t _server = NULL; static httpd_handle_t _server = NULL;
rest_server_context_t *rest_context = NULL; rest_server_context_t *rest_context = NULL;
RingbufHandle_t messaging=NULL;
void register_common_handlers(httpd_handle_t server){ void register_common_handlers(httpd_handle_t server){
httpd_uri_t res_get = { .uri = "/res/*", .method = HTTP_GET, .handler = resource_filehandler, .user_ctx = rest_context }; httpd_uri_t res_get = { .uri = "/res/*", .method = HTTP_GET, .handler = resource_filehandler, .user_ctx = rest_context };
@@ -52,6 +53,8 @@ void register_regular_handlers(httpd_handle_t server){
httpd_register_uri_handler(server, &config_get); httpd_register_uri_handler(server, &config_get);
httpd_uri_t status_get = { .uri = "/status.json", .method = HTTP_GET, .handler = status_get_handler, .user_ctx = rest_context }; httpd_uri_t status_get = { .uri = "/status.json", .method = HTTP_GET, .handler = status_get_handler, .user_ctx = rest_context };
httpd_register_uri_handler(server, &status_get); httpd_register_uri_handler(server, &status_get);
httpd_uri_t messages_get = { .uri = "/messages.json", .method = HTTP_GET, .handler = messages_get_handler, .user_ctx = rest_context };
httpd_register_uri_handler(server, &messages_get);
httpd_uri_t config_post = { .uri = "/config.json", .method = HTTP_POST, .handler = config_post_handler, .user_ctx = rest_context }; httpd_uri_t config_post = { .uri = "/config.json", .method = HTTP_POST, .handler = config_post_handler, .user_ctx = rest_context };
httpd_register_uri_handler(server, &config_post); httpd_register_uri_handler(server, &config_post);
@@ -112,6 +115,7 @@ void register_regular_handlers(httpd_handle_t server){
esp_err_t http_server_start() esp_err_t http_server_start()
{ {
ESP_LOGI(TAG, "Initializing HTTP Server"); ESP_LOGI(TAG, "Initializing HTTP Server");
messaging = messaging_register_subscriber(10, "http_server");
rest_context = calloc(1, sizeof(rest_server_context_t)); rest_context = calloc(1, sizeof(rest_server_context_t));
if(rest_context==NULL){ if(rest_context==NULL){
ESP_LOGE(TAG,"No memory for http context"); ESP_LOGE(TAG,"No memory for http context");

View File

@@ -7,8 +7,6 @@
# please read the SDK documents if you need to do this. # please read the SDK documents if you need to do this.
# #
CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO -DMODEL_NAME=SqueezeESP32 CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO -DMODEL_NAME=SqueezeESP32
COMPONENT_ADD_INCLUDEDIRS += $(COMPONENT_PATH)/../tools \
$(COMPONENT_PATH)/../config
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/components/tools/
LDFLAGS += -s LDFLAGS += -s
COMPONENT_EMBED_TXTFILES := ${PROJECT_PATH}/server_certs/github.pem COMPONENT_EMBED_TXTFILES := ${PROJECT_PATH}/server_certs/github.pem
COMPONENT_ADD_INCLUDEDIRS := .