From ea3ddc2ce693e47f2887df9d0bcd38b5d7689154 Mon Sep 17 00:00:00 2001 From: Serge Vakulenko Date: Fri, 26 Jul 2019 19:45:29 -0700 Subject: [PATCH] Process DM-1801 images. --- gd77.c | 20 ++++++++++++++++++++ hid-windows.c | 2 +- radio.c | 3 +++ radio.h | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gd77.c b/gd77.c index 4f5e91a..9acb0ed 100644 --- a/gd77.c +++ b/gd77.c @@ -2342,3 +2342,23 @@ radio_device_t radio_gd77 = { gd77_update_timestamp, //TODO: gd77_write_csv, }; + +// +// Baofeng DM-1801 +// +radio_device_t radio_dm1801 = { + "Baofeng DM-1801", + gd77_download, + gd77_upload, + gd77_is_compatible, + gd77_read_image, + gd77_save_image, + gd77_print_version, + gd77_print_config, + gd77_verify_config, + gd77_parse_parameter, + gd77_parse_header, + gd77_parse_row, + gd77_update_timestamp, + //TODO: gd77_write_csv, +}; diff --git a/hid-windows.c b/hid-windows.c index 88c4ea2..045b853 100644 --- a/hid-windows.c +++ b/hid-windows.c @@ -35,7 +35,7 @@ #include #include "util.h" -HANDLE dev = INVALID_HANDLE_VALUE;; // HID device +HANDLE dev = INVALID_HANDLE_VALUE; // HID device static unsigned char receive_buf[42]; // receive buffer // diff --git a/radio.c b/radio.c index 782d4d6..8e2251f 100644 --- a/radio.c +++ b/radio.c @@ -48,6 +48,7 @@ static struct { { "BF-5R", &radio_rd5r }, // Baofeng RD-5R, TD-5R { "DM-1701", &radio_rt84 }, // Baofeng DM-1701, Retevis RT84 { "MD-760P", &radio_gd77 }, // Radioddity GD-77, version 3.1.1 and later + { "DM-1801", &radio_dm1801 }, // Baofeng DM-1801 { "D868UVE", &radio_d868uv }, // Anytone AT-D868UV { "D878UV", &radio_d878uv }, // Anytone AT-D878UV { "D6X2UV", &radio_dmr6x2 }, // BTECH DMR-6x2 @@ -230,6 +231,8 @@ void radio_read_image(const char *filename) fseek(img, 0, SEEK_SET); if (memcmp(ident, "BF-5R", 5) == 0) { device = &radio_rd5r; + } else if (memcmp(ident, "1801", 4) == 0) { + device = &radio_dm1801; } else if (memcmp(ident, "MD-760P", 7) == 0) { device = &radio_gd77; } else if (memcmp(ident, "MD-760", 6) == 0) { diff --git a/radio.h b/radio.h index e52f653..0af4baf 100644 --- a/radio.h +++ b/radio.h @@ -125,6 +125,7 @@ extern radio_device_t radio_dp880; // Zastone DP880 extern radio_device_t radio_rt27d; // Radtel RT-27D extern radio_device_t radio_rd5r; // Baofeng RD-5R extern radio_device_t radio_gd77; // Radioddity GD-77, version 3.1.1 and later +extern radio_device_t radio_dm1801; // Baofeng DM-1801 extern radio_device_t radio_d868uv; // Anytone AT-D868UV extern radio_device_t radio_d878uv; // Anytone AT-D878UV extern radio_device_t radio_dmr6x2; // BTECH DMR-6x2