Skip to content

OllieDay/liborvibo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

liborvibo

Library for controlling Orvibo Smart Wi-Fi Plug

Installation

$ git clone https://github.com/OllieDay/liborvibo.git
$ cd liborvibo
$ mkdir build && cd build
$ cmake ..
$ make install clean

Usage

Include the header file:

#include <orvibo.h>

Define an event handler to receive notifications:

void event_handler(struct orvibo_socket *socket, enum orvibo_event event);

Create a socket from its MAC address:

struct orvibo_socket *socket = orvibo_socket_create("ac:cf:00:00:00:00");

Start the client:

orvibo_start(event_handler);

Discover the socket:

orvibo_socket_discover(socket);

Get info on the socket:

const char *mac = orvibo_socket_mac(socket);
const char *ip = orvibo_socket_ip(socket);
bool subscribed = orvibo_socket_subscribed(socket);
enum orvibo_state state = orvibo_socket_state(socket);

Subscribe the socket:

orvibo_socket_subscribe(socket);

Switch the socket off and on:

orvibo_socket_off(socket);
orvibo_socket_on(socket);

Unsubscribe the socket:

orvibo_socket_unsubscribe(socket);

Stop the client:

orvibo_stop();

Destroy the socket:

orvibo_socket_destroy(socket);

About

Library for controlling Orvibo Smart Wi-Fi Plug

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published