Merge remote-tracking branch 'origin/Over_The_Air_Update' into

Over_The_Air_Update

Conflicts:
	.cproject
	.settings/language.settings.xml
	.settings/org.eclipse.cdt.core.prefs
This commit is contained in:
Sebastien
2019-09-22 22:24:18 -04:00
12 changed files with 2136 additions and 1836 deletions

246
.cproject
View File

@@ -41,6 +41,7 @@
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1562292378" 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.1562292378" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<<<<<<< HEAD
<builder arguments="${IDF_PATH}/tools/windows/eclipse_make.py" command="python" id="cdt.managedbuild.builder.gnu.cross.1011968237" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/> <builder arguments="${IDF_PATH}/tools/windows/eclipse_make.py" command="python" id="cdt.managedbuild.builder.gnu.cross.1011968237" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1502936757" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler"> <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1502936757" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
@@ -198,6 +199,251 @@
<buildArguments>${IDF_PATH}/tools/windows/eclipse_make.py -j8 app PROJECT_NAME="recovery.custom" EXTRA_CFLAGS=" -DRECOVERY_APPLICATION=1"</buildArguments> <buildArguments>${IDF_PATH}/tools/windows/eclipse_make.py -j8 app PROJECT_NAME="recovery.custom" EXTRA_CFLAGS=" -DRECOVERY_APPLICATION=1"</buildArguments>
<buildTarget>recovery</buildTarget> <buildTarget>recovery</buildTarget>
=======
<builder arguments="" command="make" id="cdt.managedbuild.builder.gnu.cross.1011968237" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1502936757" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1614739014" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.254690821" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1365876654" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.407309631" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.765822218" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.655344480" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.1494383819" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.280698320" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1422333326" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495" moduleId="org.eclipse.cdt.core.settings" name="recovery">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" 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.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495" name="recovery" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1615055647" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
<option id="cdt.managedbuild.option.gnu.cross.prefix.1669084138" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
<option id="cdt.managedbuild.option.gnu.cross.path.1601842088" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.2065316488" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder arguments="" command="make" id="cdt.managedbuild.builder.gnu.cross.442472928" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.802362645" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.123064752" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.425997512" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1366677700" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1792747550" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.199471499" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1088734719" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.878488427" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.939007176" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1973534280" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="squeezelite-esp32.null.1272501664" name="squeezelite-esp32"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1943329896;cdt.managedbuild.toolchain.gnu.cross.base.1943329896.30011915;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1749746745;cdt.managedbuild.tool.gnu.cpp.compiler.input.1914005798">
<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.cpp.compiler.254690821;cdt.managedbuild.tool.gnu.cpp.compiler.input.1365876654">
<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">
<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">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/squeezelite-esp32"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j8</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="size-components" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>size-components</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="flash" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j2</buildArguments>
<buildTarget>flash</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="recovery" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>-j8 PROJECT_NAME="recovery.custom" EXTRA_CFLAGS=" -DRECOVERY_APPLICATION=1"</buildArguments>
<buildTarget>app</buildTarget>
>>>>>>> refs/remotes/origin/Over_The_Air_Update
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>

View File

@@ -1,4 +1,5 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
<<<<<<< HEAD
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/delimiter=; environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/delimiter=;
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/operation=append environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/operation=append
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/value=1 environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/value=1
@@ -8,5 +9,27 @@ environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/IDF_PAT
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/delimiter=; environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/delimiter=;
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/operation=replace environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/value=C\:/msys2/opt/xtensa-esp32-elf/bin;C\:/jdk-12.0.2/bin/server;C\:/jdk-12.0.2/bin;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C\:\\jdk-12.0.2\\bin;C\:\\Program Files\\PuTTY\\;C\:\\Program Files (x86)\\HP\\IdrsOCR_15.2.10.1114\\;C\:\\eclipse environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/value=C\:/msys2/opt/xtensa-esp32-elf/bin;C\:/jdk-12.0.2/bin/server;C\:/jdk-12.0.2/bin;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C\:\\jdk-12.0.2\\bin;C\:\\Program Files\\PuTTY\\;C\:\\Program Files (x86)\\HP\\IdrsOCR_15.2.10.1114\\;C\:\\eclipse
=======
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/BATCH_BUILD/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/BATCH_BUILD/operation=append
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/BATCH_BUILD/value=1
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/EXTRA_CFLAGS/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/EXTRA_CFLAGS/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/EXTRA_CFLAGS/value=-DRECOVERY_APPLICATION\=1
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/IDF_PATH/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/IDF_PATH/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/IDF_PATH/value=/var/opt/esp-idf
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/append=true
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/appendContributed=true
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/operation=append
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/value=1
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/EXTRA_CFLAGS/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/EXTRA_CFLAGS/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/EXTRA_CFLAGS/value=
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/IDF_PATH/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/IDF_PATH/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/IDF_PATH/value=/var/opt/esp-idf
>>>>>>> refs/remotes/origin/Over_The_Air_Update
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/append=true environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/append=true
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/appendContributed=true environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/appendContributed=true

View File

@@ -8,3 +8,5 @@
# #
COMPONENT_ADD_INCLUDEDIRS := . COMPONENT_ADD_INCLUDEDIRS := .
CFLAGS += -I$(COMPONENT_PATH)/../squeezelite-ota

View File

@@ -1,4 +1,4 @@
/* /*
* platform setting definition * platform setting definition
* *
* (c) Philippe, philippe_44@outlook.com * (c) Philippe, philippe_44@outlook.com
@@ -16,112 +16,112 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
#ifndef __PLATFORM_H #ifndef __PLATFORM_H
#define __PLATFORM_H #define __PLATFORM_H
#ifdef WIN32 #ifdef WIN32
#define LINUX 0 #define LINUX 0
#define WIN 1 #define WIN 1
#else #else
#define LINUX 1 #define LINUX 1
#define WIN 0 #define WIN 0
#endif #endif
#include <stdbool.h> #include <stdbool.h>
#include <signal.h> #include <signal.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef WIN32 #ifdef WIN32
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <io.h> #include <io.h>
#include <iphlpapi.h> #include <iphlpapi.h>
#include <sys/timeb.h> #include <sys/timeb.h>
typedef unsigned __int8 u8_t; typedef unsigned __int8 u8_t;
typedef unsigned __int16 u16_t; typedef unsigned __int16 u16_t;
typedef unsigned __int32 u32_t; typedef unsigned __int32 u32_t;
typedef unsigned __int64 u64_t; typedef unsigned __int64 u64_t;
typedef __int16 s16_t; typedef __int16 s16_t;
typedef __int32 s32_t; typedef __int32 s32_t;
typedef __int64 s64_t; typedef __int64 s64_t;
#define inline __inline #define inline __inline
int gettimeofday(struct timeval *tv, struct timezone *tz); int gettimeofday(struct timeval *tv, struct timezone *tz);
char *strcasestr(const char *haystack, const char *needle); char *strcasestr(const char *haystack, const char *needle);
#define usleep(x) Sleep((x)/1000) #define usleep(x) Sleep((x)/1000)
#define sleep(x) Sleep((x)*1000) #define sleep(x) Sleep((x)*1000)
#define last_error() WSAGetLastError() #define last_error() WSAGetLastError()
#define ERROR_WOULDBLOCK WSAEWOULDBLOCK #define ERROR_WOULDBLOCK WSAEWOULDBLOCK
#define open _open #define open _open
#define read _read #define read _read
#define poll WSAPoll #define poll WSAPoll
#define snprintf _snprintf #define snprintf _snprintf
#define strcasecmp stricmp #define strcasecmp stricmp
#define _random(x) random(x) #define _random(x) random(x)
#define VALGRIND_MAKE_MEM_DEFINED(x,y) #define VALGRIND_MAKE_MEM_DEFINED(x,y)
#define S_ADDR(X) X.S_un.S_addr #define S_ADDR(X) X.S_un.S_addr
#define in_addr_t u32_t #define in_addr_t u32_t
#define socklen_t int #define socklen_t int
#define ssize_t int #define ssize_t int
#define RTLD_NOW 0 #define RTLD_NOW 0
#else #else
#include <strings.h> #include <strings.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <inttypes.h> #include <inttypes.h>
/* /*
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <sys/time.h> #include <sys/time.h>
#include <netdb.h> #include <netdb.h>
*/ */
#include <arpa/inet.h> #include <arpa/inet.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/poll.h> #include <sys/poll.h>
#include <lwip/inet.h> #include <lwip/inet.h>
#include <pthread.h> #include <pthread.h>
#include <errno.h> #include <errno.h>
#define min(a,b) (((a) < (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b)) #define max(a,b) (((a) > (b)) ? (a) : (b))
typedef int16_t s16_t; typedef int16_t s16_t;
typedef int32_t s32_t; typedef int32_t s32_t;
typedef int64_t s64_t; typedef int64_t s64_t;
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;
typedef uint32_t u32_t; typedef uint32_t u32_t;
typedef unsigned long long u64_t; typedef unsigned long long u64_t;
#define last_error() errno #define last_error() errno
#define ERROR_WOULDBLOCK EWOULDBLOCK #define ERROR_WOULDBLOCK EWOULDBLOCK
char *strlwr(char *str); char *strlwr(char *str);
#define _random(x) random() #define _random(x) random()
#define closesocket(s) close(s) #define closesocket(s) close(s)
#define S_ADDR(X) X.s_addr #define S_ADDR(X) X.s_addr
#endif #endif
typedef struct ntp_s { typedef struct ntp_s {
u32_t seconds; u32_t seconds;
u32_t fraction; u32_t fraction;
} ntp_t; } ntp_t;
u64_t timeval_to_ntp(struct timeval tv, struct ntp_s *ntp); u64_t timeval_to_ntp(struct timeval tv, struct ntp_s *ntp);
u64_t get_ntp(struct ntp_s *ntp); u64_t get_ntp(struct ntp_s *ntp);
// we expect somebody to provide the ms clock, system-wide // we expect somebody to provide the ms clock, system-wide
u32_t _gettime_ms_(void); u32_t _gettime_ms_(void);
#define gettime_ms _gettime_ms_ #define gettime_ms _gettime_ms_

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
/* /*
* AirConnect: Chromecast & UPnP to AirPlay * AirConnect: Chromecast & UPnP to AirPlay
* *
* (c) Philippe 2016-2017, philippe_44@outlook.com * (c) Philippe 2016-2017, philippe_44@outlook.com
@@ -16,11 +16,11 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
#include "platform.h" #include "platform.h"
#ifdef WIN32 #ifdef WIN32
#include <iphlpapi.h> #include <iphlpapi.h>
#else #else
/* /*
@@ -34,63 +34,63 @@
#include <stdarg.h> #include <stdarg.h>
#include "pthread.h" #include "pthread.h"
#include "util.h" #include "util.h"
#include "log_util.h" #include "log_util.h"
/*----------------------------------------------------------------------------*/
/* globals */
/*----------------------------------------------------------------------------*/
extern log_level util_loglevel;
/*----------------------------------------------------------------------------*/
/* locals */
/*----------------------------------------------------------------------------*/
static log_level *loglevel = &util_loglevel;
static char *ltrim(char *s);
static int read_line(int fd, char *line, int maxlen, int timeout);
/*----------------------------------------------------------------------------*/
/* */
/* NETWORKING utils */
/* */
/*----------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
#define MAX_INTERFACES 256 /* globals */
#define DEFAULT_INTERFACE 1 /*----------------------------------------------------------------------------*/
#if !defined(WIN32)
#define INVALID_SOCKET (-1) extern log_level util_loglevel;
#endif
in_addr_t get_localhost(char **name) /*----------------------------------------------------------------------------*/
{ /* locals */
#ifdef WIN32 /*----------------------------------------------------------------------------*/
char buf[256]; static log_level *loglevel = &util_loglevel;
struct hostent *h = NULL;
struct sockaddr_in LocalAddr; static char *ltrim(char *s);
static int read_line(int fd, char *line, int maxlen, int timeout);
memset(&LocalAddr, 0, sizeof(LocalAddr));
/*----------------------------------------------------------------------------*/
gethostname(buf, 256); /* */
h = gethostbyname(buf); /* NETWORKING utils */
/* */
if (name) *name = strdup(buf); /*----------------------------------------------------------------------------*/
if (h != NULL) { /*---------------------------------------------------------------------------*/
memcpy(&LocalAddr.sin_addr, h->h_addr_list[0], 4); #define MAX_INTERFACES 256
return LocalAddr.sin_addr.s_addr; #define DEFAULT_INTERFACE 1
} #if !defined(WIN32)
else return INADDR_ANY; #define INVALID_SOCKET (-1)
#else #endif
// missing platform here ... in_addr_t get_localhost(char **name)
return INADDR_ANY; {
#endif #ifdef WIN32
} char buf[256];
struct hostent *h = NULL;
struct sockaddr_in LocalAddr;
/*----------------------------------------------------------------------------*/
memset(&LocalAddr, 0, sizeof(LocalAddr));
gethostname(buf, 256);
h = gethostbyname(buf);
if (name) *name = strdup(buf);
if (h != NULL) {
memcpy(&LocalAddr.sin_addr, h->h_addr_list[0], 4);
return LocalAddr.sin_addr.s_addr;
}
else return INADDR_ANY;
#else
// missing platform here ...
return INADDR_ANY;
#endif
}
/*----------------------------------------------------------------------------*/
#ifdef WIN32 #ifdef WIN32
void winsock_init(void) { void winsock_init(void) {
WSADATA wsaData; WSADATA wsaData;
@@ -108,92 +108,92 @@ void winsock_close(void) {
} }
#endif #endif
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
int shutdown_socket(int sd) int shutdown_socket(int sd)
{ {
if (sd <= 0) return -1; if (sd <= 0) return -1;
#ifdef WIN32 #ifdef WIN32
shutdown(sd, SD_BOTH); shutdown(sd, SD_BOTH);
#else #else
shutdown(sd, SHUT_RDWR); shutdown(sd, SHUT_RDWR);
#endif #endif
LOG_DEBUG("closed socket %d", sd); LOG_DEBUG("closed socket %d", sd);
return closesocket(sd); return closesocket(sd);
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
int bind_socket(unsigned short *port, int mode) int bind_socket(unsigned short *port, int mode)
{ {
int sock; int sock;
socklen_t len = sizeof(struct sockaddr); socklen_t len = sizeof(struct sockaddr);
struct sockaddr_in addr; struct sockaddr_in addr;
if ((sock = socket(AF_INET, mode, 0)) < 0) { if ((sock = socket(AF_INET, mode, 0)) < 0) {
LOG_ERROR("cannot create socket %d", sock); LOG_ERROR("cannot create socket %d", sock);
return sock; return sock;
} }
/* Populate socket address structure */ /* Populate socket address structure */
memset(&addr, 0, sizeof(addr)); memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_port = htons(*port); addr.sin_port = htons(*port);
#ifdef SIN_LEN #ifdef SIN_LEN
si.sin_len = sizeof(si); si.sin_len = sizeof(si);
#endif #endif
if (bind(sock, (struct sockaddr*) &addr, sizeof(addr)) < 0) { if (bind(sock, (struct sockaddr*) &addr, sizeof(addr)) < 0) {
closesocket(sock); closesocket(sock);
LOG_ERROR("cannot bind socket %d", sock); LOG_ERROR("cannot bind socket %d", sock);
return -1; return -1;
} }
if (!*port) { if (!*port) {
getsockname(sock, (struct sockaddr *) &addr, &len); getsockname(sock, (struct sockaddr *) &addr, &len);
*port = ntohs(addr.sin_port); *port = ntohs(addr.sin_port);
} }
LOG_DEBUG("socket binding %d on port %d", sock, *port); LOG_DEBUG("socket binding %d on port %d", sock, *port);
return sock; return sock;
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
int conn_socket(unsigned short port) int conn_socket(unsigned short port)
{ {
struct sockaddr_in addr; struct sockaddr_in addr;
int sd; int sd;
sd = socket(AF_INET, SOCK_STREAM, 0); sd = socket(AF_INET, SOCK_STREAM, 0);
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
addr.sin_port = htons(port); addr.sin_port = htons(port);
if (sd < 0 || connect(sd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { if (sd < 0 || connect(sd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
close(sd); close(sd);
return -1; return -1;
} }
LOG_DEBUG("created socket %d", sd); LOG_DEBUG("created socket %d", sd);
return sd; return sd;
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
/* */ /* */
/* SYSTEM utils */ /* SYSTEM utils */
/* */ /* */
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
#ifdef WIN32 #ifdef WIN32
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
void *dlopen(const char *filename, int flag) { void *dlopen(const char *filename, int flag) {
@@ -222,14 +222,14 @@ char *dlerror(void) {
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
/* */ /* */
/* STDLIB extensions */ /* STDLIB extensions */
/* */ /* */
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
#ifdef WIN32 #ifdef WIN32
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
char *strcasestr(const char *haystack, const char *needle) { char *strcasestr(const char *haystack, const char *needle) {
size_t length_needle; size_t length_needle;
size_t length_haystack; size_t length_haystack;
size_t i; size_t i;
@@ -242,7 +242,7 @@ char *strcasestr(const char *haystack, const char *needle) {
if (length_haystack < length_needle) return NULL; if (length_haystack < length_needle) return NULL;
length_haystack -= length_needle - 1; length_haystack -= length_needle - 1;
for (i = 0; i < length_haystack; i++) for (i = 0; i < length_haystack; i++)
{ {
@@ -264,92 +264,92 @@ char *strcasestr(const char *haystack, const char *needle) {
} }
return NULL; return NULL;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
char* strsep(char** stringp, const char* delim) char* strsep(char** stringp, const char* delim)
{ {
char* start = *stringp; char* start = *stringp;
char* p; char* p;
p = (start != NULL) ? strpbrk(start, delim) : NULL; p = (start != NULL) ? strpbrk(start, delim) : NULL;
if (p == NULL) { if (p == NULL) {
*stringp = NULL; *stringp = NULL;
} else { } else {
*p = '\0'; *p = '\0';
*stringp = p + 1; *stringp = p + 1;
} }
return start; return start;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
char *strndup(const char *s, size_t n) { char *strndup(const char *s, size_t n) {
char *p = malloc(n + 1); char *p = malloc(n + 1);
strncpy(p, s, n); strncpy(p, s, n);
p[n] = '\0'; p[n] = '\0';
return p; return p;
} }
#endif #endif
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
char* strextract(char *s1, char *beg, char *end) char* strextract(char *s1, char *beg, char *end)
{ {
char *p1, *p2, *res; char *p1, *p2, *res;
p1 = strcasestr(s1, beg); p1 = strcasestr(s1, beg);
if (!p1) return NULL; if (!p1) return NULL;
p1 += strlen(beg); p1 += strlen(beg);
p2 = strcasestr(p1, end); p2 = strcasestr(p1, end);
if (!p2) return strdup(p1); if (!p2) return strdup(p1);
res = malloc(p2 - p1 + 1); res = malloc(p2 - p1 + 1);
memcpy(res, p1, p2 - p1); memcpy(res, p1, p2 - p1);
res[p2 - p1] = '\0'; res[p2 - p1] = '\0';
return res; return res;
} }
#ifdef WIN32 #ifdef WIN32
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
int asprintf(char **strp, const char *fmt, ...) int asprintf(char **strp, const char *fmt, ...)
{ {
va_list args, cp; va_list args, cp;
int len, ret = 0; int len, ret = 0;
va_start(args, fmt); va_start(args, fmt);
len = vsnprintf(NULL, 0, fmt, args); len = vsnprintf(NULL, 0, fmt, args);
*strp = malloc(len + 1); *strp = malloc(len + 1);
if (*strp) ret = vsprintf(*strp, fmt, args); if (*strp) ret = vsprintf(*strp, fmt, args);
va_end(args); va_end(args);
return ret; return ret;
} }
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static char *ltrim(char *s) static char *ltrim(char *s)
{ {
while(isspace((int) *s)) s++; while(isspace((int) *s)) s++;
return s; return s;
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
/* */ /* */
/* HTTP management */ /* HTTP management */
/* */ /* */
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
bool http_parse(int sock, char *method, key_data_t *rkd, char **body, int *len) bool http_parse(int sock, char *method, key_data_t *rkd, char **body, int *len)
{ {
char line[256], *dp; char line[256], *dp;
unsigned j; unsigned j;
int i, timeout = 100; int i, timeout = 100;
@@ -357,14 +357,14 @@ bool http_parse(int sock, char *method, key_data_t *rkd, char **body, int *len)
rkd[0].key = NULL; rkd[0].key = NULL;
if ((i = read_line(sock, line, sizeof(line), timeout)) <= 0) { if ((i = read_line(sock, line, sizeof(line), timeout)) <= 0) {
if (i < 0) { if (i < 0) {
LOG_ERROR("cannot read method", NULL); LOG_ERROR("cannot read method", NULL);
} }
return false; return false;
} }
if (!sscanf(line, "%s", method)) { if (!sscanf(line, "%s", method)) {
LOG_ERROR("missing method", NULL); LOG_ERROR("missing method", NULL);
return false; return false;
} }
@@ -377,7 +377,7 @@ bool http_parse(int sock, char *method, key_data_t *rkd, char **body, int *len)
// line folding should be deprecated // line folding should be deprecated
if (i && rkd[i].key && (line[0] == ' ' || line[0] == '\t')) { if (i && rkd[i].key && (line[0] == ' ' || line[0] == '\t')) {
for(j = 0; j < strlen(line); j++) if (line[j] != ' ' && line[j] != '\t') break; for(j = 0; j < strlen(line); j++) if (line[j] != ' ' && line[j] != '\t') break;
rkd[i].data = realloc(rkd[i].data, strlen(rkd[i].data) + strlen(line + j) + 1); rkd[i].data = realloc(rkd[i].data, strlen(rkd[i].data) + strlen(line + j) + 1);
strcat(rkd[i].data, line + j); strcat(rkd[i].data, line + j);
continue; continue;
} }
@@ -403,7 +403,7 @@ bool http_parse(int sock, char *method, key_data_t *rkd, char **body, int *len)
if (*len) { if (*len) {
int size = 0; int size = 0;
*body = malloc(*len + 1); *body = malloc(*len + 1);
while (*body && size < *len) { while (*body && size < *len) {
int bytes = recv(sock, *body + size, *len - size, 0); int bytes = recv(sock, *body + size, *len - size, 0);
if (bytes <= 0) break; if (bytes <= 0) break;
@@ -467,23 +467,23 @@ static int read_line(int fd, char *line, int maxlen, int timeout)
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
char *http_send(int sock, char *method, key_data_t *rkd) char *http_send(int sock, char *method, key_data_t *rkd)
{ {
unsigned sent, len; unsigned sent, len;
char *resp = kd_dump(rkd); char *resp = kd_dump(rkd);
char *data = malloc(strlen(method) + 2 + strlen(resp) + 2 + 1); char *data = malloc(strlen(method) + 2 + strlen(resp) + 2 + 1);
len = sprintf(data, "%s\r\n%s\r\n", method, resp); len = sprintf(data, "%s\r\n%s\r\n", method, resp);
NFREE(resp); NFREE(resp);
sent = send(sock, data, len, 0); sent = send(sock, data, len, 0);
if (sent != len) { if (sent != len) {
LOG_ERROR("HTTP send() error:%s %u (strlen=%u)", data, sent, len); LOG_ERROR("HTTP send() error:%s %u (strlen=%u)", data, sent, len);
NFREE(data); NFREE(data);
} }
return data; return data;
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
@@ -534,7 +534,7 @@ char *kd_dump(key_data_t *kd)
char *str = NULL; char *str = NULL;
if (!kd || !kd[0].key) return strdup("\r\n"); if (!kd || !kd[0].key) return strdup("\r\n");
while (kd && kd[i].key) { while (kd && kd[i].key) {
char *buf; char *buf;
int len; int len;
@@ -545,8 +545,8 @@ char *kd_dump(key_data_t *kd)
void *p = realloc(str, size + 1024); void *p = realloc(str, size + 1024);
size += 1024; size += 1024;
if (!p) { if (!p) {
free(str); free(str);
return NULL; return NULL;
} }
str = p; str = p;
} }
@@ -574,28 +574,28 @@ void free_metadata(struct metadata_s *metadata)
NFREE(metadata->artwork); NFREE(metadata->artwork);
NFREE(metadata->remote_title); NFREE(metadata->remote_title);
} }
/*----------------------------------------------------------------------------*/
int _fprintf(FILE *file, ...)
{
va_list args;
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
int n;
int _fprintf(FILE *file, ...)
{
va_list args;
char *fmt;
int n;
va_start(args, file);
fmt = va_arg(args, char*);
n = vfprintf(file, fmt, args);
va_end(args);
return n;
}
fmt = va_arg(args, char*);
n = vfprintf(file, fmt, args);
va_end(args);
return n;

View File

@@ -1,4 +1,4 @@
/* /*
* Misc utilities * Misc utilities
* *
* (c) Adrian Smith 2012-2014, triode1@btinternet.com * (c) Adrian Smith 2012-2014, triode1@btinternet.com
@@ -17,43 +17,43 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
#ifndef __UTIL_H #ifndef __UTIL_H
#define __UTIL_H #define __UTIL_H
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include "platform.h" #include "platform.h"
#include "pthread.h" #include "pthread.h"
#define NFREE(p) if (p) { free(p); p = NULL; } #define NFREE(p) if (p) { free(p); p = NULL; }
typedef struct metadata_s { typedef struct metadata_s {
char *artist; char *artist;
char *album; char *album;
char *title; char *title;
char *genre; char *genre;
char *path; char *path;
char *artwork; char *artwork;
char *remote_title; char *remote_title;
u32_t track; u32_t track;
u32_t duration; u32_t duration;
u32_t track_hash; u32_t track_hash;
u32_t sample_rate; u32_t sample_rate;
u8_t sample_size; u8_t sample_size;
u8_t channels; u8_t channels;
} metadata_t; } metadata_t;
/* /*
void free_metadata(struct metadata_s *metadata); void free_metadata(struct metadata_s *metadata);
void dup_metadata(struct metadata_s *dst, struct metadata_s *src); void dup_metadata(struct metadata_s *dst, struct metadata_s *src);
*/ */
u32_t gettime_ms(void); u32_t gettime_ms(void);
#ifdef WIN32 #ifdef WIN32
char* strsep(char** stringp, const char* delim); char* strsep(char** stringp, const char* delim);
@@ -64,22 +64,22 @@ void winsock_close(void);
#else #else
char *strlwr(char *str); char *strlwr(char *str);
#endif #endif
char* strextract(char *s1, char *beg, char *end); char* strextract(char *s1, char *beg, char *end);
in_addr_t get_localhost(char **name); in_addr_t get_localhost(char **name);
void get_mac(u8_t mac[]); void get_mac(u8_t mac[]);
int shutdown_socket(int sd); int shutdown_socket(int sd);
int bind_socket(short unsigned *port, int mode); int bind_socket(short unsigned *port, int mode);
int conn_socket(unsigned short port); int conn_socket(unsigned short port);
typedef struct {
typedef struct {
char *key; char *key;
char *data; char *data;
char *data; } key_data_t;
} key_data_t;
bool http_parse(int sock, char *method, key_data_t *rkd, char **body, int *len);
char* http_send(int sock, char *method, key_data_t *rkd); char* http_send(int sock, char *method, key_data_t *rkd);
char* kd_lookup(key_data_t *kd, char *key); char* kd_lookup(key_data_t *kd, char *key);
bool kd_add(key_data_t *kd, char *key, char *value); bool kd_add(key_data_t *kd, char *key, char *value);
bool kd_add(key_data_t *kd, char *key, char *value); char* kd_dump(key_data_t *kd);

View File

@@ -27,21 +27,46 @@
#include "sdkconfig.h" #include "sdkconfig.h"
static const char * TAG = "platform_esp32"; static const char * TAG = "platform_esp32";
extern void start_ota(const char * bin_url);
static struct {
struct arg_str *url;
struct arg_end *end;
} ota_args;
/* 'heap' command prints minumum heap size */ /* 'heap' command prints minumum heap size */
static int perform_ota_update(int argc, char **argv) static int perform_ota_update(int argc, char **argv)
{ {
int nerrors = arg_parse(argc, argv, (void **) &ota_args);
if (nerrors != 0) {
arg_print_errors(stderr, ota_args.end, argv[0]);
return 1;
}
const char *url = ota_args.url->sval[0];
esp_err_t err=ESP_OK;
start_ota(url);
if (err != ESP_OK) {
ESP_LOGE(TAG, "%s", esp_err_to_name(err));
return 1;
}
return 0; return 0;
} }
static void register_ota_cmd() void register_ota_cmd()
{ {
ota_args.url= arg_str1(NULL, NULL, "<url>", "url of the binary app file");
ota_args.end = arg_end(2);
const esp_console_cmd_t cmd = { const esp_console_cmd_t cmd = {
.command = "ota_update", .command = "ota_update",
.help = "Updates the application binary from the provided URL", .help = "Updates the application binary from the provided URL",
.hint = NULL, .hint = NULL,
.func = &perform_ota_update, .func = &perform_ota_update,
.argtable = &ota_args
}; };
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) ); ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
} }

View File

@@ -13,7 +13,7 @@ extern "C" {
#endif #endif
// Register system functions // Register system functions
static void register_ota_cmd(); void register_ota_cmd();
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -41,12 +41,15 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
switch (evt->event_id) { switch (evt->event_id) {
case HTTP_EVENT_ERROR: case HTTP_EVENT_ERROR:
ESP_LOGD(TAG, "HTTP_EVENT_ERROR"); ESP_LOGD(TAG, "HTTP_EVENT_ERROR");
strncpy(ota_status,sizeof(ota_status)-1,"HTTP_EVENT_ERROR");
break; break;
case HTTP_EVENT_ON_CONNECTED: case HTTP_EVENT_ON_CONNECTED:
ESP_LOGD(TAG, "HTTP_EVENT_ON_CONNECTED"); ESP_LOGD(TAG, "HTTP_EVENT_ON_CONNECTED");
break; strncpy(ota_status,sizeof(ota_status)-1,"HTTP_EVENT_ON_CONNECTED");
break;
case HTTP_EVENT_HEADER_SENT: case HTTP_EVENT_HEADER_SENT:
ESP_LOGD(TAG, "HTTP_EVENT_HEADER_SENT"); ESP_LOGD(TAG, "HTTP_EVENT_HEADER_SENT");
strncpy(ota_status,sizeof(ota_status)-1,"HTTP_EVENT_HEADER_SENT");
break; break;
case HTTP_EVENT_ON_HEADER: case HTTP_EVENT_ON_HEADER:
ESP_LOGD(TAG, "HTTP_EVENT_ON_HEADER, key=%s, value=%s", evt->header_key, evt->header_value); ESP_LOGD(TAG, "HTTP_EVENT_ON_HEADER, key=%s, value=%s", evt->header_key, evt->header_value);
@@ -59,6 +62,7 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
break; break;
case HTTP_EVENT_DISCONNECTED: case HTTP_EVENT_DISCONNECTED:
ESP_LOGD(TAG, "HTTP_EVENT_DISCONNECTED"); ESP_LOGD(TAG, "HTTP_EVENT_DISCONNECTED");
strncpy(ota_status,sizeof(ota_status)-1,"HTTP_EVENT_DISCONNECTED");
break; break;
} }
return ESP_OK; return ESP_OK;

View File

@@ -240,11 +240,11 @@ void console_start() {
esp_console_register_help_command(); esp_console_register_help_command();
register_system(); register_system();
register_nvs(); register_nvs();
#if !RECOVERY_APPLICATION #if ! RECOVERY_APPLICATION
#pragma message "compiling for squeezelite"" #warning "compiling for squeezelite"
register_squeezelite(); register_squeezelite();
#else #else
#pragma message "compiling for recovery" #warning "compiling for recovery"
register_ota_cmd(); register_ota_cmd();
#endif #endif
register_i2ctools(); register_i2ctools();