mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 21:18:13 +08:00
保存插座通电状态
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "mico.h"
|
||||
#include "micokit_ext.h"
|
||||
|
||||
#define VERSION "v1.0.6"
|
||||
#define VERSION "v1.0.7"
|
||||
|
||||
#define TYPE 1
|
||||
#define TYPE_NAME "zTC1"
|
||||
|
||||
@@ -46,15 +46,20 @@ const unsigned char* GetSocketStatus()
|
||||
|
||||
void SetSocketStatus(char* socket_status)
|
||||
{
|
||||
int ons[6] = { 0 };
|
||||
sscanf(socket_status, "%d,%d,%d,%d,%d,%d,",
|
||||
&ons[0], &ons[1], &ons[2], &ons[3], &ons[4], &ons[5]);
|
||||
(int*)&user_config->socket_configs[0].on,
|
||||
(int*)&user_config->socket_configs[1].on,
|
||||
(int*)&user_config->socket_configs[2].on,
|
||||
(int*)&user_config->socket_configs[3].on,
|
||||
(int*)&user_config->socket_configs[4].on,
|
||||
(int*)&user_config->socket_configs[5].on);
|
||||
int i = 0;
|
||||
for (i = 0; i < SOCKET_NUM; i++)
|
||||
{
|
||||
UserRelaySet(i, ons[i]);
|
||||
UserRelaySet(i, user_config->socket_configs[i].on);
|
||||
UserMqttSendSocketState(i);
|
||||
}
|
||||
mico_system_context_update(sys_config);
|
||||
}
|
||||
|
||||
/*UserRelaySet
|
||||
|
||||
Reference in New Issue
Block a user