Establish the Lua dissector action/device/etc tables as authoritative

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Allen Hill
2026-07-06 16:53:13 -07:00
parent e92d61adca
commit b538e07577
9 changed files with 632 additions and 37 deletions
+15 -12
View File
@@ -31,7 +31,8 @@ enum AVCLAN_ENUM_CLASS Action : uint8_t {
// LAN related
List_Functions_Req = 0x00,
List_Functions_Resp = 0x10,
Restart_Lan = 0x01,
Lan_Init = 0x01,
Lan_Init_Complete = 0x58,
// Lan_Startup_Complete = 0x58,
Lancheck_End_Req = 0x08,
Lancheck_End_Resp = 0x18,
@@ -50,7 +51,7 @@ enum AVCLAN_ENUM_CLASS Action : uint8_t {
Disable_Function_Req = 0x43,
Disable_Function_Resp = 0x53,
Current_Function = 0x45,
Advertise_Function = 0x45,
General_Query = 0x46,
// Events
@@ -60,6 +61,7 @@ enum AVCLAN_ENUM_CLASS Action : uint8_t {
// Physical interface
Backlight_Adjust = 0x59,
Beep = 0x60,
Screen_Press = 0x78,
Eject = 0x80,
Disc_Up = 0x90,
Disc_Down = 0x91,
@@ -69,6 +71,7 @@ enum AVCLAN_ENUM_CLASS Action : uint8_t {
Track_Rewind = 0x99,
Pwrvol_Knob_Righthand_Turn = 0x9c,
Pwrvol_Knob_Lefthand_Turn = 0x9d,
Tape_Not_Ready = 0x9f,
CD_Enable_Repeat = 0xa0,
CD_Disable_Repeat = 0xa1,
CD_Enable_Disk_Repeat = 0xa3,
@@ -83,21 +86,21 @@ enum AVCLAN_ENUM_CLASS Action : uint8_t {
CD_Disable_Disk_Random = 0xb4,
// Requests and Response pairs
Initial_Report_Request = 0xe0,
Initial_Report_Response = 0xf0,
Initial_Report_Req = 0xe0,
Initial_Report_Resp = 0xf0,
Playback_Request = 0xe2,
Playback_Report = 0xf2,
Playback_Req = 0xe2,
Playback_Resp = 0xf2,
Loading_Request2 = 0xe4,
Loading_Response2 = 0xf4,
Loading_Req = 0xe4,
Loading_Resp = 0xf4,
Request_Track_Name = 0xed,
Report_Track_Name = 0xfd,
Track_Name_Req = 0xed,
Track_Name_Resp = 0xfd,
// Reports
Status_Report = 0xf1, // Typically unprompted, sent to Device::STATUS
Loading_Status_Report = 0xf3, // Typically unprompted, sent to Device::STATUS
Playback_Status = 0xf1, // Typically unprompted, sent to Device::STATUS
Loading_Status = 0xf3, // Typically unprompted, sent to Device::STATUS
Report_TOC = 0xf9,
};
+10 -10
View File
@@ -19,7 +19,7 @@ using namespace avclan;
constexpr uint8_t cdloading_resp[] = {
to_underlying(Device::CD_CHANGER),
to_underlying(Device::STATUS),
to_underlying(Action::Loading_Status_Report),
to_underlying(Action::Loading_Status),
0x00,
0x01,
0x00,
@@ -116,14 +116,14 @@ void CDChanger::handle(const Frame *in, Frame *out) {
}
break;
}
case Initial_Report_Request: {
case Initial_Report_Req: {
out->is_unicast = true;
// No knowledge/understanding of field meaning/interpretation
const uint8_t cdinitreport_resp[] = {
0x00,
to_underlying(Device::CD_CHANGER),
to_underlying(from),
to_underlying(Initial_Report_Response),
to_underlying(Initial_Report_Resp),
0x01,
0x31,
0x10,
@@ -134,22 +134,22 @@ void CDChanger::handle(const Frame *in, Frame *out) {
out->reaction = r_SendOnly;
break;
}
case Playback_Request:
case Playback_Req:
out->data[0] = 0x00;
out->data[1] = to_underlying(Device::CD_CHANGER);
out->data[2] = to_underlying(from);
out->data[3] = to_underlying(Playback_Report);
out->data[3] = to_underlying(Playback_Resp);
out->length = WIRE_SIZE + 4;
serialize(&out->data[4]);
out->is_unicast = true;
out->reaction = r_SendOnly;
break;
case Loading_Request2:
case Loading_Req:
out->data[0] = 0x00;
out->length = sizeof(cdloading_resp) + 1;
memcpy(&out->data[1], cdloading_resp, sizeof(cdloading_resp));
out->data[2] = to_underlying(from);
out->data[3] = to_underlying(Loading_Response2);
out->data[3] = to_underlying(Loading_Resp);
out->is_unicast = true;
out->reaction = r_SendOnly;
break;
@@ -276,7 +276,7 @@ void CDChanger::react(Frame *out, detail::Error::Send err) {
case r_Ejection: {
const uint8_t play[] = {0x00,
to_underlying(Device::COMM_CTRL),
to_underlying(Device::COMM_v1),
to_underlying(Device::COMMUNICATION_V1),
to_underlying(Action::Insertion),
to_underlying(Device::CD_CHANGER),
0x01};
@@ -291,7 +291,7 @@ void CDChanger::react(Frame *out, detail::Error::Send err) {
out->length = sizeof(cdloading_resp) + 1;
memcpy(out->data, cdloading_resp, sizeof(cdloading_resp));
out->data[1] = to_underlying(Device::STATUS);
out->data[2] = to_underlying(Action::Loading_Status_Report);
out->data[2] = to_underlying(Action::Loading_Status);
out->reaction = r_SendOnly;
break;
case r_TrackChange:
@@ -411,7 +411,7 @@ void CDChanger::generateStatus(Frame *status, bool is_unicast,
*data++ = 0x00;
*data++ = to_underlying(Device::CD_CHANGER);
*data++ = to_underlying(to);
*data++ = to_underlying(Action::Status_Report);
*data++ = to_underlying(Action::Playback_Status);
serialize(data);
}
+19 -4
View File
@@ -14,20 +14,35 @@ namespace avclan {
enum class Device : uint8_t {
LAN = 0x00,
COMM_CTRL = 0x01,
COMM_v1 = 0x11,
COMM_v2 = 0x12,
SW = 0x21,
COMMUNICATION_V1 = 0x11,
COMMUNICATION_V2 = 0x12,
SW_AUDIO = 0x21,
SW_NAME = 0x23,
SW_CONVERTING = 0x24,
CMD_SW = 0x25,
STATUS = 0x31,
INFO_DISPLAY2 = 0x32,
BEEP_HU = 0x28,
BEEP_SPEAKERS = 0x29,
FRONT_PSNG_MONITOR = 0x34,
CD_CHANGER2 = 0x43,
BLUETOOTH_TEL = 0x55,
INFO_DRAWING = 0x56,
NAV_ECU = 0x58,
CAMERA = 0x5C,
CLIMATE_DRAWING = 0x5D,
AUDIO_DRAWING = 0x5E,
TRIP_INFO_DRAWING = 0x5F,
TUNER = 0x60,
TAPE_DECK = 0x61,
CD = 0x62,
CD_SINGLE = 0x62,
CD_CHANGER = 0x63,
AUDIO_AMP = 0x74,
GPS = 0x80,
VOICE_CTRL = 0x85,
XM_TUNER = 0xC0,
CLIMATE_CTRL_DEV = 0xE0,
TRIP_INFO = 0xE5,
};
template <class T>
+8 -8
View File
@@ -87,19 +87,19 @@ public:
out->data[3] = to_underlying(Lancheck_End_Resp);
out->reaction = 1;
break;
case PACK3(COMM_v1, COMM_CTRL, to_underlying(Current_Function)):
case PACK3(COMM_v2, COMM_CTRL, to_underlying(Current_Function)):
case PACK3(COMMUNICATION_V1, COMM_CTRL, to_underlying(Advertise_Function)):
case PACK3(COMMUNICATION_V2, COMM_CTRL, to_underlying(Advertise_Function)):
((Devs::id == static_cast<Device>(b3)
? std::get<Devs>(devices_).enable(out),
0 : 0),
...);
break;
case PACK3(COMM_v1, COMM_CTRL, to_underlying(Ping_Req)):
case PACK3(COMM_v2, COMM_CTRL, to_underlying(Ping_Req)): {
case PACK3(COMMUNICATION_V1, COMM_CTRL, to_underlying(Ping_Req)):
case PACK3(COMMUNICATION_V2, COMM_CTRL, to_underlying(Ping_Req)): {
out->is_unicast = true;
const uint8_t ping_resp[] = {0x00,
to_underlying(COMM_CTRL),
to_underlying(COMM_v1),
to_underlying(COMMUNICATION_V1),
to_underlying(Ping_Resp),
0xFF,
b3};
@@ -108,13 +108,13 @@ public:
out->reaction = 1;
break;
}
case PACK3(COMM_v1, COMM_CTRL, to_underlying(List_Functions_Req)):
case PACK3(COMM_v2, COMM_CTRL, to_underlying(List_Functions_Req)): {
case PACK3(COMMUNICATION_V1, COMM_CTRL, to_underlying(List_Functions_Req)):
case PACK3(COMMUNICATION_V2, COMM_CTRL, to_underlying(List_Functions_Req)): {
controller_ = in->controller_addr;
out->peripheral_addr = controller_;
out->is_unicast = true;
const uint8_t list_functions_resp[] = {
0x00, to_underlying(COMM_CTRL), to_underlying(COMM_v1),
0x00, to_underlying(COMM_CTRL), to_underlying(COMMUNICATION_V1),
to_underlying(List_Functions_Resp), to_underlying(CD_CHANGER)};
out->length = sizeof(list_functions_resp);
memcpy(out->data, list_functions_resp, sizeof(list_functions_resp));