From 628ec2de5f92f9d3a16df58c8a625290f3e48e02 Mon Sep 17 00:00:00 2001 From: Allen Hill Date: Mon, 4 May 2026 11:47:34 -0700 Subject: [PATCH] Replace use of numeric literals with appropriate enums --- src/avclandrv.c | 2 +- src/avclandrv.h | 1 + src/sniffer.c | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/avclandrv.c b/src/avclandrv.c index 77869b0..edc346c 100644 --- a/src/avclandrv.c +++ b/src/avclandrv.c @@ -82,7 +82,7 @@ - The broadcast bit is `1` (floating, no effort) for normal communication - For acknowledge bits, the receiver extends the logical '0' of the sync period to the length of a normal bit `0`. Hence, a NAK (bit `1`) is - equivalent to no response. + literally the absence of an ACK. No acknowledge bits are sent for broadcast frames. diff --git a/src/avclandrv.h b/src/avclandrv.h index 957a447..4fe5088 100644 --- a/src/avclandrv.h +++ b/src/avclandrv.h @@ -53,6 +53,7 @@ typedef enum { } commands; typedef enum { + dev_LAN = 0x00, dev_COMM_CTRL = 0x01, dev_COMM_v1 = 0x11, dev_COMM_v2 = 0x12, diff --git a/src/sniffer.c b/src/sniffer.c index 9b8a2be..e7de01e 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -142,8 +142,8 @@ int main() { case 'b': case 'B': // Beep data_tmp[0] = 0x00; - data_tmp[1] = 0x63; - data_tmp[2] = 0x29; + data_tmp[1] = dev_CD_CHANGER; + data_tmp[2] = dev_BEEP_SPEAKERS; data_tmp[3] = 0x60; data_tmp[4] = 0x01; msg.length = 5; @@ -155,10 +155,10 @@ int main() { case 'p': CD_Mode = stPlay; data_tmp[0] = 0x00; - data_tmp[1] = 0x01; - data_tmp[2] = 0x11; - data_tmp[3] = 0x50; - data_tmp[4] = 0x63; + data_tmp[1] = dev_COMM_CTRL; + data_tmp[2] = dev_COMM_v1; + data_tmp[3] = Insertion; + data_tmp[4] = dev_CD_CHANGER; msg.length = 5; msg.broadcast = UNICAST; msg.controller_addr = DEVICE_ADDR; @@ -226,7 +226,7 @@ int main() { } } } // switch (readkey) - } // if (RS232_RxCharEnd) + } // if (RS232_RxCharEnd) } return 0; }