AtxNet

Class

class AtxNet;

Synopsis

The Altronix AtxNet C++ binding is a header only wrapper around the linq_network API that provides a simple RAII interface to the C library.

Members

listen

Listen for incoming connections

linq_network_socket listen(const char* str);

connect

Connect to remote AtxNet node

linq_network_socket connect(const char* str);

close

Close a AtxNet connection

void close(linq_network_socket s);

poll

Process Network IO

E_LINQ_ERROR poll(uint32_t ms);

send

Send a request to a device connected to AtxNet

void send(
   std::string serial
   std::string method,
   std::string path,
   std::string data,
   std::function<void(Response&)> fn);

void send(
   std::string serial,
   std::string method,
   std::string path,
   std::function<void(Response&)> fn);

get

Send a get request to a device connected to AtxNet

void get(
   std::string serial,
   std::string path,
   std::function<void(Response&)> fn);

post

Send a post request to a device connected to AtxNet

void post(
   std::string serial,
   std::string path,
   std::string data,
   std::function<void(Response&)> fn);

del

Send a delete request to a device connected to AtxNet

void del(
   std::string serial,
   std::string path,
   std::function<void(Response&)> fn);

device_count

Number of devices connected to AtxNet node

uint32_t device_count();

node_count

Number of nodes connected to AtxNet node

uint32_t node_count();

on_heartbeat

Install function to be called every heartbeat event on the network

AtxNet& on_heartbeat(std::function<void(const char*, Device&)> fn);

on_alert

Install function to be called every alert event on the network

AtxNet& on_alert(std::function<void(linq_network_alert_s*, linq_network_email_s*, Device&)> fn);

on_error

Install function to be called every error event on the network

AtxNet& on_error(std::function<void(E_LINQ_ERROR, const char*, const char*)> fn);

on_ctrlc

Install function to be called when AtxNet is shutting down

AtxNet& on_alert(std::function<void()> fn);