Skip to content

C Client classes

Åke Hedman edited this page Jun 3, 2021 · 7 revisions

VSCP C++ Client classes

The client classes is a common C++ interface to VSCP over different transport mediums.

Files

Common methods

vscp client common methods

int connect(void)

Connect to remote server

int disconnect(void)

Disconnect from remote server.

bool isConnected(void)

Check if connected.

int send(vscpEvent &ev)

Send event to remote server.

int send(vscpEventEx &ex)

Send event ex to remote server.

int receive(vscpEvent &ev)

Receive one event if one is available.

int receive(vscpEventEx &ex)

Receive one event ex if one is available.

int setfilter(vscpEventFilter &filter)

Set filter for incoming traffic.

int getcount(uint16_t *pcount)

Get number of events waiting to be received.

int clear(void)

Clear the input queue

int getversion(uint8_t *pmajor, uint8_t *pminor, uint8_t *prelease, uint8_t *pbuild)

Get interface version.

int getwcyd(uint64_t &wcyd)

Get WCYD (What Can You Do) from remote host.

virtual int setCallback(LPFNDLL_EV_CALLBACK evcallback, void *pData=nullptr);

Set callback that will receive incoming events.

int setCallback(LPFNDLL_EX_CALLBACK m_excallback, void *pData=nullptr)

Sett callback that will receive incoming events (ex)

void setConnectionTimeout(uint32_t timeout)

Set connection timeout in milliseconds.

Get connection timeout

Get connection timeout in milliseconds.

void setResponseTimeout(uint32_t timeout)

Set response time in milliseconds.

uint32_t getResponseTimeout(void)

Get response time in milliseconds.

bool isEvCallback(void)

Check if an event callback is defined.

bool isExCallback(void)

Check if an event ex callback is defined.

std::string getConfigAsJson(void)

Get current configuration on JSON format.

bool initFromJson(const std::string& config)

Set configuration from JSON.

connType getType(void)

Get connection type.

void setName(const std::string& name)

Set name for communication object

std::string getName(void)

Get current name for communication object.

Clone this wiki locally