广播命令已接收的回复不再触发回调
检测命令0x0c只能使用单播方式,广播方式因为不能即时回复停止信号,回复会出错 添加电阻测试命令,添加自检命令
This commit is contained in:
45
base/beep.h
Normal file
45
base/beep.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef BEEP_H
|
||||
#define BEEP_H
|
||||
|
||||
#include <QFile>
|
||||
#include <QDebug>
|
||||
#include <QObject>
|
||||
#include <QThread>
|
||||
#include <QMutexLocker>
|
||||
#include <QMutex>
|
||||
class beep : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit beep(QObject *parent = nullptr);
|
||||
|
||||
bool stop();
|
||||
void start();
|
||||
// 用户程序调用这个函数开启蜂鸣器
|
||||
void set_beep(int delay_on_ms,int delay_off_ms,int ticks);
|
||||
private:
|
||||
bool get_state();
|
||||
bool set_state(bool state);
|
||||
private:
|
||||
bool is_run;
|
||||
bool state;
|
||||
|
||||
int delay_on_ms;
|
||||
int delay_off_ms;
|
||||
int ticks;
|
||||
|
||||
QMutex lock;
|
||||
QFile file;
|
||||
|
||||
private slots:
|
||||
void run_cb();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
beep *Beep();
|
||||
|
||||
|
||||
|
||||
#endif // BEEP_H
|
Reference in New Issue
Block a user