2023-11-26 23:05:35 +08:00
|
|
|
|
#ifndef CMD_SLAVE_H
|
|
|
|
|
#define CMD_SLAVE_H
|
|
|
|
|
|
|
|
|
|
#include "prot/prot_slave.h"
|
|
|
|
|
|
|
|
|
|
|
2023-11-29 15:36:45 +08:00
|
|
|
|
|
|
|
|
|
// 从机检测命令
|
2023-11-26 23:05:35 +08:00
|
|
|
|
class slave_check:public HandleSlave
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
slave_check():HandleSlave(){}
|
|
|
|
|
int start(myarray data);
|
2023-11-27 14:31:00 +08:00
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
2023-11-26 23:05:35 +08:00
|
|
|
|
};
|
|
|
|
|
|
2023-11-29 15:36:45 +08:00
|
|
|
|
|
2023-12-09 10:37:48 +08:00
|
|
|
|
// 从机检测命令
|
|
|
|
|
class slave_check2:public HandleBoardCast
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
slave_check2():HandleBoardCast(){}
|
|
|
|
|
int start(myarray data);
|
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
|
|
|
|
};
|
|
|
|
|
|
2023-11-29 15:36:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取检测结果命令
|
|
|
|
|
class slave_result:public HandleSlave
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
slave_result():HandleSlave(){}
|
|
|
|
|
int start(myarray data);
|
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置硬件版本号命令
|
|
|
|
|
class slave_sethardver:public HandleSlave
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
slave_sethardver():HandleSlave(){}
|
|
|
|
|
int start(myarray data);
|
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置电阻校准值命令
|
|
|
|
|
class slave_setresver:public HandleSlave
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
slave_setresver():HandleSlave(){}
|
|
|
|
|
int start(myarray data);
|
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取电阻值命令
|
|
|
|
|
class slave_resvalue:public HandleSlave
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
slave_resvalue():HandleSlave(){}
|
|
|
|
|
int start(myarray data);
|
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 程序升级
|
|
|
|
|
class boardcast_updata:public HandleBoardCast
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
boardcast_updata():HandleBoardCast(){step=0;count_sent=0;}
|
|
|
|
|
int start(myarray data);
|
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
|
|
|
|
bool send_packet();
|
|
|
|
|
private:
|
|
|
|
|
int step;
|
|
|
|
|
myarray data;
|
|
|
|
|
int count_sent;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-05 18:37:40 +08:00
|
|
|
|
// 方案升级
|
|
|
|
|
class boardcast_updata_scheme:public HandleBoardCast
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
boardcast_updata_scheme():HandleBoardCast(){step=0;count_sent=0;base_addr=0;}
|
|
|
|
|
virtual int start(myarray data);
|
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
|
|
|
|
bool send_packet();
|
|
|
|
|
protected:
|
|
|
|
|
int step;
|
|
|
|
|
myarray data;
|
|
|
|
|
int count_sent;
|
|
|
|
|
uint32_t base_addr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// jwt升级
|
|
|
|
|
class boardcast_updata_jwt:public boardcast_updata_scheme
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
boardcast_updata_jwt():boardcast_updata_scheme(){step=0;count_sent=0;base_addr=0;}
|
|
|
|
|
int start(myarray data);
|
|
|
|
|
};
|
2023-11-29 15:36:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-07 18:29:49 +08:00
|
|
|
|
|
|
|
|
|
// 自检信息
|
|
|
|
|
class slave_bootinfo:public HandleSlave
|
|
|
|
|
{
|
|
|
|
|
public:
|
2023-12-13 18:29:46 +08:00
|
|
|
|
slave_bootinfo():HandleSlave(){}
|
|
|
|
|
int start(myarray data);
|
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取命令数据,使用前先设置cmd
|
2023-12-29 09:41:37 +08:00
|
|
|
|
// 自动加入包信息,可以发送长数据
|
2023-12-13 18:29:46 +08:00
|
|
|
|
class slave_cmd:public HandleBoardCast
|
|
|
|
|
{
|
|
|
|
|
public:
|
2023-12-19 18:14:35 +08:00
|
|
|
|
slave_cmd():HandleBoardCast(){
|
|
|
|
|
send_bytes=0;
|
|
|
|
|
send_pack_num=0;
|
2023-12-21 18:51:58 +08:00
|
|
|
|
step=0;
|
2023-12-19 18:14:35 +08:00
|
|
|
|
}
|
2023-12-13 18:29:46 +08:00
|
|
|
|
int start(myarray data);
|
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
2023-12-19 18:14:35 +08:00
|
|
|
|
bool send_next();
|
|
|
|
|
protected:
|
|
|
|
|
int send_bytes;
|
|
|
|
|
int send_pack_num;
|
|
|
|
|
myarray data;
|
2023-12-21 18:51:58 +08:00
|
|
|
|
int step;
|
2023-12-07 18:29:49 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-20 18:24:00 +08:00
|
|
|
|
// 获取命令数据,使用前先设置cmd
|
2023-12-29 09:41:37 +08:00
|
|
|
|
// 不加入分包信息,不可发送长数据
|
2023-12-20 18:24:00 +08:00
|
|
|
|
class slave_cmd2:public HandleBoardCast
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
slave_cmd2():HandleBoardCast(){
|
|
|
|
|
send_bytes=0;
|
|
|
|
|
send_pack_num=0;
|
|
|
|
|
}
|
|
|
|
|
int start(myarray data);
|
|
|
|
|
int dolater(int cmd, myarray data);
|
|
|
|
|
void timeout();
|
|
|
|
|
bool send_next();
|
|
|
|
|
protected:
|
|
|
|
|
int send_bytes;
|
|
|
|
|
int send_pack_num;
|
|
|
|
|
myarray data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-07 18:29:49 +08:00
|
|
|
|
|
2023-11-26 23:05:35 +08:00
|
|
|
|
#endif // CMD_SLAVE_H
|