liblightify
Lightify Class Reference

#include <liblightify++.hpp>

Public Member Functions

 Lightify (const char *host, unsigned int port=4000)
 
virtual ~Lightify ()
 
int Open (void)
 
int Close (void)
 
int ScanNodes (void)
 
int ScanGroups (void)
 
struct lightify_ctxGetCtx (void)
 
int TurnAllOnOff (bool onoff)
 
Lightify_NodeGetNode (long long mac)
 
Lightify_NodeGetNodeAtPosX (int x) const
 
Lightify_GroupGetGroupAtPosX (int pos) const
 
const struct lightify_ctxGetLightifyContext (void) const
 
int IsOpen (void) const
 
int SetHostname (const char *host, unsigned int port=4000)
 
int GetNodesCount (void)
 
int GetGroupsCount (void)
 

Detailed Description

Lightify-Class to encapsulate the library context and offer access to the management functionality.

Note
throws std::bad_alloc on out of memory, when exceptions enabled. (see LIGHTIFY_ALLOW_THROW)

Definition at line 304 of file liblightify++.hpp.

Constructor & Destructor Documentation

◆ Lightify()

Lightify ( const char *  host,
unsigned int  port = 4000 
)
inline

Default Constructor Throws invalid_argument if port is >0xffff.

Definition at line 308 of file liblightify++.hpp.

◆ ~Lightify()

virtual ~Lightify ( )
inlinevirtual

Definition at line 329 of file liblightify++.hpp.

Member Function Documentation

◆ Close()

int Close ( void  )
inline

Close the (previously) opened socket.

Definition at line 394 of file liblightify++.hpp.

◆ GetCtx()

struct lightify_ctx* GetCtx ( void  )
inline

Get direct access to the lighitfy context

Warning
advanced use – improper use can confuse the C++ Wrapper and create inconsitent state.

Definition at line 483 of file liblightify++.hpp.

◆ GetGroupAtPosX()

Lightify_Group* GetGroupAtPosX ( int  pos) const
inline

Get Group at Pos X

Returns
pointer or NULL

Definition at line 520 of file liblightify++.hpp.

◆ GetGroupsCount()

int GetGroupsCount ( void  )
inline

Definition at line 567 of file liblightify++.hpp.

◆ GetLightifyContext()

const struct lightify_ctx* GetLightifyContext ( void  ) const
inline

Get the library context – for direct library access.

Warning
dangerous! Avoid calls that might change e.g memory location of the node structures, like scan for nodes etc.

Definition at line 529 of file liblightify++.hpp.

◆ GetNode()

Lightify_Node* GetNode ( long long  mac)
inline

Get the node object for a given MAC address

Definition at line 494 of file liblightify++.hpp.

◆ GetNodeAtPosX()

Lightify_Node* GetNodeAtPosX ( int  x) const
inline

Get node at Pos X

Returns
pointer or NULL

Definition at line 508 of file liblightify++.hpp.

◆ GetNodesCount()

int GetNodesCount ( void  )
inline

Definition at line 563 of file liblightify++.hpp.

◆ IsOpen()

int IsOpen ( void  ) const
inline

Have the connection been opened?

Note
this only checks for an valid file descriptor
Returns
true, yes

Definition at line 538 of file liblightify++.hpp.

◆ Open()

int Open ( void  )
inline

Open socket / prepare communication returns 0 on success, negative on error.

Definition at line 339 of file liblightify++.hpp.

◆ ScanGroups()

int ScanGroups ( void  )
inline

Scan for known groups and generate a Group object for every returned group.

Note
Scanning will invalidate all previous objects.
Returns
number of detected groups, negative on error.

Definition at line 448 of file liblightify++.hpp.

◆ ScanNodes()

int ScanNodes ( void  )
inline

Scan for nodes

Note
: This invalidates all previously known node information!

Definition at line 410 of file liblightify++.hpp.

◆ SetHostname()

int SetHostname ( const char *  host,
unsigned int  port = 4000 
)
inline

Set a hostname / port combination

Parameters
hoststring used as host (hostname of IP)
portto be used, default 4000
Returns
negative on error, otherwise on success. (Error causes are invalid parameters like host=NULL or port>0xffff and out of memory situations.)

Definition at line 552 of file liblightify++.hpp.

◆ TurnAllOnOff()

int TurnAllOnOff ( bool  onoff)
inline

Actions that can be broadcasted.

Definition at line 488 of file liblightify++.hpp.


The documentation for this class was generated from the following file: