liblightify
liblightify.h File Reference
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/time.h>
Include dependency graph for liblightify.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef int(* write_to_socket_fn) (struct lightify_ctx *ctx, unsigned char *msg, size_t size)
 
typedef int(* read_from_socket_fn) (struct lightify_ctx *ctx, unsigned char *msg, size_t size)
 

Enumerations

enum  lightify_node_type {
  LIGHTIFY_ONOFF_PLUG, LIGHTIFY_DIMABLE_LIGHT, LIGHTIFY_COLOUR_LIGHT, LIGHTIFY_EXT_COLOUR_LIGHT,
  LIGHTIFY_CCT_LIGHT, LIGHTIFY_UNKNOWNTYPE = 0xFF00
}
 
enum  lightify_node_online_state { LIGHTIFY_OFFLINE = 0, LIGHTIFY_ONLINE = 2 }
 

Functions

int lightify_new (struct lightify_ctx **ctx, void *reserved)
 
int lightify_free (struct lightify_ctx *ctx)
 
int lightify_set_socket_fn (struct lightify_ctx *ctx, write_to_socket_fn fpw, read_from_socket_fn fpr)
 
int lightify_skt_setfd (struct lightify_ctx *ctx, int socket)
 
int lightify_skt_getfd (struct lightify_ctx *ctx)
 
int lightify_skt_setiotimeout (struct lightify_ctx *ctx, struct timeval tv)
 
struct timeval lightify_skt_getiotimeout (struct lightify_ctx *ctx)
 
int lightify_node_request_scan (struct lightify_ctx *ctx)
 
struct lightify_nodelightify_node_get_from_mac (struct lightify_ctx *ctx, uint64_t mac)
 
struct lightify_nodelightify_node_get_next (struct lightify_ctx *ctx, struct lightify_node *node)
 
struct lightify_nodelightify_node_get_previous (struct lightify_ctx *ctx, struct lightify_node *node)
 
int lightify_set_log_fn (struct lightify_ctx *ctx, void(*log_fn)(struct lightify_ctx *ctx, int priority, const char *file, int line, const char *fn, const char *format, va_list args))
 
int lightify_get_log_priority (struct lightify_ctx *ctx)
 
int lightify_set_log_priority (struct lightify_ctx *ctx, int priority)
 
void * lightify_get_userdata (struct lightify_ctx *ctx)
 
int lightify_set_userdata (struct lightify_ctx *ctx, void *userdata)
 
const char * lightify_node_get_name (struct lightify_node *node)
 
uint64_t lightify_node_get_nodeadr (struct lightify_node *node)
 
uint16_t lightify_node_get_zoneadr (struct lightify_node *node)
 
uint16_t lightify_node_get_grpadr (struct lightify_node *node)
 
enum lightify_node_type lightify_node_get_lamptype (struct lightify_node *node)
 
int lightify_node_get_red (struct lightify_node *node)
 
int lightify_node_get_green (struct lightify_node *node)
 
int lightify_node_get_blue (struct lightify_node *node)
 
int lightify_node_get_white (struct lightify_node *node)
 
int lightify_node_get_cct (struct lightify_node *node)
 
int lightify_node_get_brightness (struct lightify_node *node)
 
int lightify_node_is_on (struct lightify_node *node)
 
int lightify_node_is_stale (struct lightify_node *node)
 
int lightify_node_get_onlinestate (struct lightify_node *node)
 
int lightify_node_request_onoff (struct lightify_ctx *ctx, struct lightify_node *node, int onoff)
 
int lightify_node_request_cct (struct lightify_ctx *ctx, struct lightify_node *node, unsigned int cct, unsigned int fadetime)
 
int lightify_node_request_rgbw (struct lightify_ctx *ctx, struct lightify_node *node, unsigned int r, unsigned int g, unsigned int b, unsigned int w, unsigned int fadetime)
 
int lightify_node_request_brightness (struct lightify_ctx *ctx, struct lightify_node *node, unsigned int level, unsigned int fadetime)
 
int lightify_node_request_update (struct lightify_ctx *ctx, struct lightify_node *node)
 
struct lightify_grouplightify_group_get_next (struct lightify_ctx *ctx, struct lightify_group *current)
 
struct lightify_grouplightify_group_get_previous (struct lightify_ctx *ctx, struct lightify_group *current)
 
const char * lightify_group_get_name (struct lightify_group *grp)
 
int lightify_group_get_id (struct lightify_group *grp)
 
int lightify_group_request_scan (struct lightify_ctx *ctx)
 
struct lightify_nodelightify_group_get_next_node (struct lightify_group *grp, struct lightify_node *lastnode)
 
int lightify_group_request_onoff (struct lightify_ctx *ctx, struct lightify_group *group, int onoff)
 
int lightify_group_request_cct (struct lightify_ctx *ctx, struct lightify_group *group, unsigned int cct, unsigned int fadetime)
 
int lightify_group_request_rgbw (struct lightify_ctx *ctx, struct lightify_group *group, unsigned int r, unsigned int g, unsigned int b, unsigned int w, unsigned int fadetime)
 
int lightify_group_request_brightness (struct lightify_ctx *ctx, struct lightify_group *group, unsigned int level, unsigned int fadetime)