29 lines
718 B
C
29 lines
718 B
C
/*
|
|
* lw12.h
|
|
* Copyright (C) 2017 jpk <jpk@dwarf>
|
|
*
|
|
* Distributed under terms of the MIT license.
|
|
*/
|
|
|
|
#ifndef LW12_H
|
|
#define LW12_H
|
|
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
#include <arpa/inet.h>
|
|
|
|
#define LW12_CMD_LENGTH 9
|
|
|
|
#define LIGHTS_ON "\x7e\x04\x04\x01\xff\xff\xff\x00\xef"
|
|
#define LIGHTS_INIT "\x7e\x07\x05\x03\xff\xbf\x40\x00\xef"
|
|
#define LIGHTS_OFF "\x7e\x04\x04\x00\x00\x0f\x00\x00\xef"
|
|
|
|
// set lights "7e070503{red:02x}{green:02x}{blue:02x}00ef"
|
|
#define LIGHT_COLOR "\x7e\x07\x05\x03\x00\x00\x00\x00\xef"
|
|
|
|
int lw12_connect(int *sockfd, struct sockaddr_in *addr, uint16_t port,
|
|
char *hostname);
|
|
int lw12_sendcmd(int sockfd, struct sockaddr_in *addr, char *cmd);
|
|
|
|
#endif /* !LW12_H */
|