whyclwt
2022-05-18 ab72c6e114d7c4e83564194367ba623ca23bf09d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef RS485_PACK_H
#define RS485_PACK_H
 
 
#include "Driver/uart_driver.h"
#include "Common/app_define.h"
 
 
#define   RS485_Pack_DEV_PORT     "/dev/ttymxc2"
 
 
 
class RS485_Pack : public Uart_Driver
{
    Q_OBJECT
 
public:
    RS485_Pack(const char *dev);
    virtual void run();
 
    void setPackCommParam(const quint8 devaddr,const quint16 packtype);
 
    bool packComm_OK;
 
    void lock_RS485();
    void unlock_RS485();
 
    void pausePackComm();
    void remsumPackComm();
 
    void setCertificationPackEn(void);
 
private:
    int fd;
 
    bool pausePackCommEn;
 
    bool certificationEn;
 
    bool RS485_RUN_EN;
 
    quint8 dev_addr;
    quint16 battPackType;
 
    QMutex RS485_mutex;
 
    void certificationPack(void);
 
signals:
    void sendPackDataSignal(PACK_DATA);
 
 
};
 
 
 
 
 
 
#endif // RS485_PACK_H