Recognize old GD-77 images.
This commit is contained in:
parent
175516fbcf
commit
f4bb02eea2
3
radio.c
3
radio.c
@ -49,6 +49,7 @@ static struct {
|
||||
{ "ZN><:", &radio_rt27d }, // Radtel RT-27D
|
||||
{ "BF-5R", &radio_rd5r }, // Baofeng RD-5R
|
||||
{ "MD-760P", &radio_gd77 }, // Radioddity GD-77
|
||||
{ "MD-760", &radio_gd77_old }, // Radioddity GD-77, older versions up to 2.6.6
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@ -202,6 +203,8 @@ void radio_read_image(const char *filename)
|
||||
device = &radio_rd5r;
|
||||
} else if (memcmp(ident, "MD-760P", 7) == 0) {
|
||||
device = &radio_gd77;
|
||||
} else if (memcmp(ident, "MD-760", 6) == 0) {
|
||||
device = &radio_gd77_old;
|
||||
} else {
|
||||
fprintf(stderr, "%s: Unrecognized header '%.6s'\n",
|
||||
filename, ident);
|
||||
|
1
radio.h
1
radio.h
@ -124,6 +124,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
|
||||
extern radio_device_t radio_gd77_old; // Radioddity GD-77, older versions up to 2.6.6
|
||||
|
||||
//
|
||||
// Radio: memory contents.
|
||||
|
29
rd5r.c
29
rd5r.c
@ -406,12 +406,14 @@ static int rd5r_is_compatible(radio_device_t *radio)
|
||||
return strncmp("BF-5R", (char*)&radio_mem[0], 5) == 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Check whether the memory image is compatible with this device.
|
||||
//
|
||||
static int gd77_is_compatible(radio_device_t *radio)
|
||||
{
|
||||
return strncmp("MD-760P", (char*)&radio_mem[0], 7) == 0;
|
||||
return strncmp("MD-760", (char*)&radio_mem[0], 7) == 0;
|
||||
}
|
||||
|
||||
static int gd77old_is_compatible(radio_device_t *radio)
|
||||
{
|
||||
return strncmp("MD-760", (char*)&radio_mem[0], 6) == 0;
|
||||
}
|
||||
|
||||
//
|
||||
@ -2278,3 +2280,22 @@ radio_device_t radio_gd77 = {
|
||||
rd5r_parse_row,
|
||||
rd5r_update_timestamp,
|
||||
};
|
||||
|
||||
//
|
||||
// Radioddity GD-77, older versions up to 2.6.6
|
||||
//
|
||||
radio_device_t radio_gd77_old = {
|
||||
"Radioddity GD-77 (old)",
|
||||
gd77_download,
|
||||
rd5r_upload,
|
||||
gd77old_is_compatible,
|
||||
rd5r_read_image,
|
||||
rd5r_save_image,
|
||||
rd5r_print_version,
|
||||
rd5r_print_config,
|
||||
rd5r_verify_config,
|
||||
rd5r_parse_parameter,
|
||||
rd5r_parse_header,
|
||||
rd5r_parse_row,
|
||||
rd5r_update_timestamp,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user