17#ifndef _PIXY2_PROTOCOL_H_
18#define _PIXY2_PROTOCOL_H_
33#define PIXY2_REQUEST_GET_VERSION 0xe
35#define PIXY2_REQUEST_SET_LED 0x14
37#define PIXY2_REQUEST_SET_LAMP 0x16
39#define PIXY2_REQUEST_GET_MAIN_FEATURES 0x30
56#define PIXY2_REPLY_GET_VERSION 0xf
58#define PIXY2_REPLY_SET_LED 0x1
60#define PIXY2_REPLY_SET_LAMP 0x1
62#define PIXY2_REPLY_GET_MAIN_FEATURES 0x31
64#define PIXY2_REPLY_ERROR 0x3
89#define PIXY2_CHECKSUM_ERROR -3
91#define PIXY2_TIMEOUT -4
93#define PIXY2_BUTTON_OVERRIDE -5
95#define PIXY2_PROG_CHANGING -6
109#define PIXY2_REQUEST_SYNC0_NO_CHECKSUM 0xae
111#define PIXY2_REQUEST_SYNC1_NO_CHECKSUM 0xc1
113#define PIXY2_REQUEST_SYNC0_CHECKSUM 0xaf
115#define PIXY2_REQUEST_SYNC1_CHECKSUM 0xc1
118#define PIXY2_REPLY_SYNC0 0xaf
120#define PIXY2_REPLY_SYNC1 0xc1
130#define PIXY2_REQUEST_SYNC0(checksum) \
132 PIXY2_REQUEST_SYNC0_CHECKSUM : PIXY2_REQUEST_SYNC0_NO_CHECKSUM)
142#define PIXY2_REQUEST_SYNC1(checksum) \
144 PIXY2_REQUEST_SYNC1_CHECKSUM : PIXY2_REQUEST_SYNC1_NO_CHECKSUM)
int pixy2_to_errno(int32_t result)
Convert a Pixy2 status code to errno-like code.
Definition pixy2_protocol.c:32
int pixy2_protocol_transceive(struct pixy2_transport *t, struct pixy2_message *req, struct pixy2_message *reply)
Send a request, wait for its reply and validate it.
Definition pixy2_protocol.c:54
Pixy2 transport layer API.
Definition pixy2_transport.h:66
Pixy2 transport layer structure.
Definition pixy2_transport.h:83