LAPTOP-SNT8I5JK\Boounion
2025-10-13 047c7cbd047e11fba8d7872e69a11a13e463aec4
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
#pragma once
#include <functional>
#include "IMessage.h"
 
 
enum class ACTIVESTATE
{
    NOT_CONNECTED = 0,
    NOT_SELECTED = 1,
    SELECTED = 2
};
 
typedef std::function<void(void* pFrom, ACTIVESTATE state)> ONACTIVESTATECHANGED;
typedef std::function<void(void* pFrom, const char* pszData, int size)> ONRECVRAWDATA;
typedef std::function<void(void* pFrom, IMessage* pMessage)> ONRECVDATAMSG;
typedef std::function<void(void* pFrom, IMessage* pMessage)> ONRECVSYSMSG;
typedef std::function<void(void* pFrom, int error)> ONDATAERROR;
typedef struct _ActiveListener
{
    ONACTIVESTATECHANGED    funStateChanged;
    ONRECVRAWDATA            funRecvRawData;
    ONRECVDATAMSG            funRecvDataMessage;
    ONRECVSYSMSG            funRecvSysMessage;
    ONDATAERROR                funError;
} ActiveListener;
 
 
class IActive
{
public:
    virtual void setListener(ActiveListener listener) = 0;
    virtual void setTimeout3(int timeout) = 0;
    virtual void setTimeout5(int timeout) = 0;
    virtual void setTimeout6(int timeout) = 0;
    virtual void setTimeout7(int timeout) = 0;
    virtual void setTimeout8(int timeout) = 0;
    virtual int sendMessage(IMessage* pMessage) = 0;
    virtual ACTIVESTATE getState() = 0;
    virtual int connect() = 0;
    virtual int disconnect() = 0;
};