195 lines
3.1 KiB
C++
195 lines
3.1 KiB
C++
#ifndef CMD_SLAVE_H
|
||
#define CMD_SLAVE_H
|
||
|
||
#include "prot/prot_slave.h"
|
||
|
||
|
||
|
||
// 从机检测命令
|
||
class slave_check:public HandleSlave
|
||
{
|
||
public:
|
||
slave_check():HandleSlave(){}
|
||
int start(myarray data);
|
||
int dolater(int cmd, myarray data);
|
||
void timeout();
|
||
};
|
||
|
||
|
||
// 从机检测命令
|
||
class slave_check2:public HandleBoardCast
|
||
{
|
||
public:
|
||
slave_check2():HandleBoardCast(){}
|
||
int start(myarray data);
|
||
int dolater(int cmd, myarray data);
|
||
void timeout();
|
||
};
|
||
|
||
|
||
|
||
// 获取检测结果命令
|
||
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;
|
||
};
|
||
|
||
|
||
|
||
|
||
// 方案升级
|
||
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);
|
||
};
|
||
|
||
|
||
|
||
|
||
|
||
|
||
// 自检信息
|
||
class slave_bootinfo:public HandleSlave
|
||
{
|
||
public:
|
||
slave_bootinfo():HandleSlave(){}
|
||
int start(myarray data);
|
||
int dolater(int cmd, myarray data);
|
||
void timeout();
|
||
};
|
||
|
||
|
||
|
||
|
||
// 获取命令数据,使用前先设置cmd
|
||
// 自动加入包信息,可以发送长数据
|
||
class slave_cmd:public HandleBoardCast
|
||
{
|
||
public:
|
||
slave_cmd():HandleBoardCast(){
|
||
send_bytes=0;
|
||
send_pack_num=0;
|
||
step=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;
|
||
int step;
|
||
};
|
||
|
||
|
||
|
||
// 获取命令数据,使用前先设置cmd
|
||
// 不加入分包信息,不可发送长数据
|
||
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;
|
||
};
|
||
|
||
|
||
|
||
|
||
#endif // CMD_SLAVE_H
|