mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-13 05:28:14 +08:00
WebLog() OK v2.1.1
This commit is contained in:
@@ -7,16 +7,16 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
||||||
<title>zTC1</title>
|
<title>zTC1</title>
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<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 -->
|
<!-- Add to homescreen for Safari on iOS -->
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<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-status-bar-style" content="black">
|
||||||
<meta name="apple-mobile-web-app-title" content="Material Design Lite">
|
<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) -->
|
<!-- 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">
|
<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">
|
<link rel="stylesheet" href="assets/css_pack.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class="demo-drawer mdl-layout__drawer mdl-color--blue-grey-900 mdl-color-text--blue-grey-50">
|
<div class="demo-drawer mdl-layout__drawer mdl-color--blue-grey-900 mdl-color-text--blue-grey-50">
|
||||||
<header class="demo-drawer-header">
|
<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"/> -->
|
<!-- <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>
|
<svg width="112pt" height="112pt" viewBox="0 0 112 112" class="demo-avatar"><use xlink:href="#img-user"/></svg>
|
||||||
<div class="demo-avatar-dropdown">
|
<div class="demo-avatar-dropdown">
|
||||||
@@ -393,7 +393,7 @@
|
|||||||
<div class="mdl-card__supporting-text">
|
<div class="mdl-card__supporting-text">
|
||||||
<form action="#">
|
<form action="#">
|
||||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
<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>
|
<label class="mdl-textfield__label" for="ota_url">OTA 地址</label>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include"http_server/web_log.h"
|
#include"http_server/web_log.h"
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ void WebLog(const char *M, ...)
|
|||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, M);
|
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);
|
va_end(ap);
|
||||||
|
|
||||||
SetLogRecord(&log_record, buff);
|
SetLogRecord(&log_record, buff);
|
||||||
|
|||||||
22
TC1/main.h
22
TC1/main.h
@@ -4,18 +4,18 @@
|
|||||||
#include "mico.h"
|
#include "mico.h"
|
||||||
#include "micokit_ext.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 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 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 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 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 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 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 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 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 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 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 1
|
||||||
#define TYPE_NAME "zTC1"
|
#define TYPE_NAME "zTC1"
|
||||||
|
|||||||
@@ -76,10 +76,12 @@ void WifiScanCallback(ScanResult_adv* scan_ret, void* arg)
|
|||||||
char* tmp2 = secs;
|
char* tmp2 = secs;
|
||||||
for (; i < count; i++)
|
for (; i < count; i++)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
ApInfo* ap = (ApInfo*)&scan_ret->ApList[i];
|
ApInfo* ap = (ApInfo*)&scan_ret->ApList[i];
|
||||||
uint8_t* mac = (uint8_t*)ap->bssid;
|
uint8_t* mac = (uint8_t*)ap->bssid;
|
||||||
//wifi_log("wifi_scan_callback ssid[%16s] bssid[%02X-%02X-%02X-%02X-%02X-%02X] security[%d]",
|
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);
|
ap->ssid, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], ap->security);
|
||||||
|
*/
|
||||||
char* ssid = scan_ret->ApList[i].ssid;
|
char* ssid = scan_ret->ApList[i].ssid;
|
||||||
//排除隐藏的wifi和SSID带'或"的我wifi
|
//排除隐藏的wifi和SSID带'或"的我wifi
|
||||||
if (ssid[0] == 0 || strstr(ssid, "'") || strstr(ssid, "\"")) continue;
|
if (ssid[0] == 0 || strstr(ssid, "'") || strstr(ssid, "\"")) continue;
|
||||||
|
|||||||
2
TODO.txt
2
TODO.txt
@@ -10,3 +10,5 @@
|
|||||||
*. 定时任务插座不对?
|
*. 定时任务插座不对?
|
||||||
*. 最近一个月每天功耗
|
*. 最近一个月每天功耗
|
||||||
*. 最近一周每小时功率
|
*. 最近一周每小时功率
|
||||||
|
|
||||||
|
*. 重启保留定时任务
|
||||||
|
|||||||
Reference in New Issue
Block a user