#pragma once
|
#include <functional>
|
#include "IMessage.h"
|
|
|
enum STATE
|
{
|
NOT_CONNECTED = 0,
|
NOT_SELECTED = 1,
|
SELECTED = 2
|
};
|
|
typedef std::function<void(void* pFrom, STATE state)> ONSTATECHANGED;
|
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 _PassiveListener
|
{
|
ONSTATECHANGED funStateChanged;
|
ONRECVRAWDATA funRecvRawData;
|
ONRECVDATAMSG funRecvDataMessage;
|
ONRECVSYSMSG funRecvSysMessage;
|
ONDATAERROR funError;
|
} PassiveListener;
|
|
|
class IPassive
|
{
|
public:
|
virtual void setListener(PassiveListener 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 STATE getState() = 0;
|
};
|