pixma: define some magic values

pixma-axis-driver^2
Ondrej Zary 2020-07-31 13:51:39 +02:00
rodzic d651e44192
commit 2f16465384
2 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -135,7 +135,7 @@ static ssize_t axis_send_wimp(int udp_socket, struct sockaddr_in *addr, uint8_t
ssize_t ret;
header->type = cmd;
header->magic = 0x03;
header->magic = WIMP_HEADER_MAGIC;
header->zero = 0x00;
memcpy(packet + sizeof(struct axis_wimp_header), data, len);
ret = sendto(udp_socket, packet, sizeof(struct axis_wimp_header) + len, 0, addr, sizeof(struct sockaddr_in));
@ -154,11 +154,11 @@ static ssize_t axis_wimp_get(int udp_socket, struct sockaddr_in *addr, uint8_t c
struct axis_wimp_header *reply = (void *)data_out;
struct axis_wimp_get_reply *str = (void *)(data_out + sizeof(struct axis_wimp_header));
wimp_get.port = htole16(ntohs(addr->sin_port)), /* network order -> LE */
wimp_get.magic = 0x02,
wimp_get.port = htole16(ntohs(addr->sin_port)); /* network order -> LE */
wimp_get.magic = WIMP_GET_MAGIC;
wimp_get.zero = 0;
wimp_get.cmd = cmd,
wimp_get.idx = idx,
wimp_get.cmd = cmd;
wimp_get.idx = idx;
ret = axis_send_wimp(udp_socket, addr, WIMP_SERVER_STATUS, &wimp_get, sizeof(wimp_get));
if (ret)
return ret;

Wyświetl plik

@ -10,6 +10,7 @@
#define AXIS_WIMP_PORT 10260 /* UDP port for discovery */
#define WIMP_HEADER_MAGIC 0x03
#define WIMP_SERVER_INFO 0x24
#define WIMP_SERVER_STATUS 0x30
#define WIMP_REPLY (1 << 0)
@ -19,6 +20,7 @@ struct axis_wimp_header {
uint8_t zero;
} __attribute__((__packed__));
#define WIMP_GET_MAGIC 0x02
#define WIMP_GET_NAME 0x02
#define WIMP_GET_STATUS 0x03
struct axis_wimp_get {