Skip to content
Snippets Groups Projects
Commit d1dda25c authored by Andy Green's avatar Andy Green
Browse files

esp32: allow no factory upload info

parent 34822f19
Branches
Tags
No related merge requests found
...@@ -173,6 +173,8 @@ static void reboot_timer_cb(TimerHandle_t t) ...@@ -173,6 +173,8 @@ static void reboot_timer_cb(TimerHandle_t t)
static int static int
client_connection(struct per_vhost_data__esplws_scan *vhd, const char *file) client_connection(struct per_vhost_data__esplws_scan *vhd, const char *file)
{ {
#if CONFIG_LWS_IS_FACTORY_APPLICATION == 'y' && defined(CONFIG_LWS_OTA_SERVER_BASE_URL) &&
defined(CONFIG_LWS_OTA_SERVER_FQDN)
static struct lws_client_connect_info i; static struct lws_client_connect_info i;
char path[256]; char path[256];
...@@ -199,7 +201,7 @@ client_connection(struct per_vhost_data__esplws_scan *vhd, const char *file) ...@@ -199,7 +201,7 @@ client_connection(struct per_vhost_data__esplws_scan *vhd, const char *file)
lwsl_notice("NULL return\n"); lwsl_notice("NULL return\n");
return 1; /* fail */ return 1; /* fail */
} }
#endif
return 0; /* ongoing */ return 0; /* ongoing */
} }
......
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
jbi=$(COMPONENT_PATH)/../build/json-buildinfo jbi=$(COMPONENT_PATH)/../build/json-buildinfo
FAC=$(CONFIG_LWS_IS_FACTORY_APPLICATION)
ifeq ($(FAC),)
FAC=0
endif
export FAC
.PHONY: romfs.img .PHONY: romfs.img
pack.img: pack.img:
DIRNAME=$$(basename $$(pwd) | tr -d '\n') ;\ DIRNAME=$$(basename $$(pwd) | tr -d '\n') ;\
...@@ -36,7 +42,7 @@ pack.img: ...@@ -36,7 +42,7 @@ pack.img:
echo -n -e "\",\r\n \"unixtime\": \"" >> $(jbi) ;\ echo -n -e "\",\r\n \"unixtime\": \"" >> $(jbi) ;\
echo -n $$UNIXTIME >> $(jbi) ;\ echo -n $$UNIXTIME >> $(jbi) ;\
echo -n -e "\",\r\n \"file\": \""$$DIRNAME-$$UNIXTIME.bin >> $(jbi) ;\ echo -n -e "\",\r\n \"file\": \""$$DIRNAME-$$UNIXTIME.bin >> $(jbi) ;\
echo -n -e "\",\r\n \"factory\": \"$(LWS_IS_FACTORY_APPLICATION)" >> $(jbi) ;\ echo -n -e "\",\r\n \"factory\": \"$(FAC)" >> $(jbi) ;\
echo -n -e "\"\r\n}" >> $(jbi) ;\ echo -n -e "\"\r\n}" >> $(jbi) ;\
JLEN=$$(stat -c %s $(jbi)) ;\ JLEN=$$(stat -c %s $(jbi)) ;\
printf %02x $$(( $$JLEN % 256 )) | xxd -r -p >> $(COMPONENT_PATH)/../build/$$DIRNAME.bin ;\ printf %02x $$(( $$JLEN % 256 )) | xxd -r -p >> $(COMPONENT_PATH)/../build/$$DIRNAME.bin ;\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment