WebLog() OK v2.1.1

This commit is contained in:
zogodo
2021-12-18 12:32:04 +08:00
parent 205e4913d0
commit 9c82fbae78
7 changed files with 693 additions and 679 deletions

View File

@@ -7,16 +7,16 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>zTC1</title>
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" sizes="192x192" href="http://119.23.191.79/tc1/images/android-desktop.png">
<link rel="icon" sizes="192x192" href="http://www.yuntong.com/tc1/images/android-desktop.png">
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Material Design Lite">
<link rel="apple-touch-icon-precomposed" href="http://119.23.191.79/tc1/images/ios-desktop.png">
<link rel="apple-touch-icon-precomposed" href="http://www.yuntong.com/tc1/images/ios-desktop.png">
<!-- Tile icon for Win8 (144x144 + tile color) -->
<meta name="msapplication-TileImage" content="http://119.23.191.79/tc1/images/touch/ms-touch-icon-144x144-precomposed.png">
<meta name="msapplication-TileImage" content="http://www.yuntong.com/tc1/images/touch/ms-touch-icon-144x144-precomposed.png">
<meta name="msapplication-TileColor" content="#3372DF">
<link rel="shortcut icon" href="http://119.23.191.79/tc1/images/favicon.png">
<link rel="shortcut icon" href="http://www.yuntong.com/tc1/images/favicon.png">
<link rel="stylesheet" href="assets/css_pack.css">
</head>
<body>
@@ -46,7 +46,7 @@
</header>
<div class="demo-drawer mdl-layout__drawer mdl-color--blue-grey-900 mdl-color-text--blue-grey-50">
<header class="demo-drawer-header">
<!-- <img src="http://119.23.191.79/tc1/images/user.jpg" class="demo-avatar"> -->
<!-- <img src="http://www.yuntong.com/tc1/images/user.jpg" class="demo-avatar"> -->
<!-- <img width="112px" src="assets/user2.svg" class="demo-avatar"/> -->
<svg width="112pt" height="112pt" viewBox="0 0 112 112" class="demo-avatar"><use xlink:href="#img-user"/></svg>
<div class="demo-avatar-dropdown">
@@ -393,7 +393,7 @@
<div class="mdl-card__supporting-text">
<form action="#">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="ota_url" value="http://119.23.191.79/tc1/tc1ota.bin">
<input class="mdl-textfield__input" type="text" id="ota_url" value="http://www.yuntong.icu/ztc1/tc1-v2.1.1-ota.bin">
<label class="mdl-textfield__label" for="ota_url">OTA 地址</label>
</div>
</form>

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include"http_server/web_log.h"
@@ -46,7 +47,7 @@ void WebLog(const char *M, ...)
va_list ap;
va_start(ap, M);
int ret = vsnprintf(buff + TIME_LEN, sizeof(buff) - TIME_LEN, M, ap);
vsnprintf(buff + TIME_LEN, LOG_LEN - TIME_LEN, M, ap);
va_end(ap);
SetLogRecord(&log_record, buff);

View File

@@ -4,18 +4,18 @@
#include "mico.h"
#include "micokit_ext.h"
#define app_log(M, ...) do { custom_log("APP", M, ##__VA_ARGS__); web_log("APP", M, ##__VA_ARGS__) } while(0)
#define key_log(M, ...) do { custom_log("KEY", M, ##__VA_ARGS__); web_log("KEY", M, ##__VA_ARGS__) } while(0)
#define ota_log(M, ...) do { custom_log("OTA", M, ##__VA_ARGS__); web_log("OTA", M, ##__VA_ARGS__) } while(0)
#define rtc_log(M, ...) do { custom_log("RTC", M, ##__VA_ARGS__); web_log("RTC", M, ##__VA_ARGS__) } while(0)
#define tc1_log(M, ...) do { custom_log("TC1", M, ##__VA_ARGS__); web_log("TC1", M, ##__VA_ARGS__) } while(0)
#define task_log(M, ...) do { custom_log("TASK", M, ##__VA_ARGS__); web_log("TASK", M, ##__VA_ARGS__) } while(0)
#define http_log(M, ...) do { custom_log("HTTP", M, ##__VA_ARGS__); web_log("HTTP", M, ##__VA_ARGS__) } while(0)
#define mqtt_log(M, ...) do { custom_log("MQTT", M, ##__VA_ARGS__); web_log("MQTT", M, ##__VA_ARGS__) } while(0)
#define wifi_log(M, ...) do { custom_log("WIFI", M, ##__VA_ARGS__); web_log("WIFI", M, ##__VA_ARGS__) } while(0)
#define power_log(M, ...) do { custom_log("POWER", M, ##__VA_ARGS__); web_log("POWER", M, ##__VA_ARGS__) } while(0)
#define app_log(M, ...) do { custom_log("APP", M, ##__VA_ARGS__); web_log("APP", M, ##__VA_ARGS__); } while(0)
#define key_log(M, ...) do { custom_log("KEY", M, ##__VA_ARGS__); web_log("KEY", M, ##__VA_ARGS__); } while(0)
#define ota_log(M, ...) do { custom_log("OTA", M, ##__VA_ARGS__); web_log("OTA", M, ##__VA_ARGS__); } while(0)
#define rtc_log(M, ...) do { custom_log("RTC", M, ##__VA_ARGS__); web_log("RTC", M, ##__VA_ARGS__); } while(0)
#define tc1_log(M, ...) do { custom_log("TC1", M, ##__VA_ARGS__); web_log("TC1", M, ##__VA_ARGS__); } while(0)
#define task_log(M, ...) do { custom_log("TASK", M, ##__VA_ARGS__); web_log("TASK", M, ##__VA_ARGS__); } while(0)
#define http_log(M, ...) do { custom_log("HTTP", M, ##__VA_ARGS__); web_log("HTTP", M, ##__VA_ARGS__); } while(0)
#define mqtt_log(M, ...) do { custom_log("MQTT", M, ##__VA_ARGS__); web_log("MQTT", M, ##__VA_ARGS__); } while(0)
#define wifi_log(M, ...) do { custom_log("WIFI", M, ##__VA_ARGS__); web_log("WIFI", M, ##__VA_ARGS__); } while(0)
#define power_log(M, ...) do { custom_log("POWER", M, ##__VA_ARGS__); web_log("POWER", M, ##__VA_ARGS__); } while(0)
#define VERSION "v2.1.0"
#define VERSION "v2.1.1"
#define TYPE 1
#define TYPE_NAME "zTC1"

View File

@@ -76,10 +76,12 @@ void WifiScanCallback(ScanResult_adv* scan_ret, void* arg)
char* tmp2 = secs;
for (; i < count; i++)
{
/*
ApInfo* ap = (ApInfo*)&scan_ret->ApList[i];
uint8_t* mac = (uint8_t*)ap->bssid;
//wifi_log("wifi_scan_callback ssid[%16s] bssid[%02X-%02X-%02X-%02X-%02X-%02X] security[%d]",
// ap->ssid, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], ap->security);
wifi_log("wifi_scan_callback ssid[%16s] bssid[%02X-%02X-%02X-%02X-%02X-%02X] security[%d]",
ap->ssid, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], ap->security);
*/
char* ssid = scan_ret->ApList[i].ssid;
//排除隐藏的wifi和SSID带'或"的我wifi
if (ssid[0] == 0 || strstr(ssid, "'") || strstr(ssid, "\"")) continue;

View File

@@ -10,3 +10,5 @@
*. 定时任务插座不对?
*. 最近一个月每天功耗
*. 最近一周每小时功率
*. 重启保留定时任务

8
build.sh Normal file
View File

@@ -0,0 +1,8 @@
mico make clean
mico make TC1@MK3031@moc
mico make TC1@MK3031@moc download run
mico make TC1@MK3031@moc total download run