Update d868uv.

This commit is contained in:
Serge 2018-10-16 00:21:59 -07:00
parent 8fc140ba1b
commit 0f258b2a10
4 changed files with 79 additions and 4 deletions

View File

@ -12,5 +12,5 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0073", MODE="666"
# Anytone AT-D868UV
#TODO: Ignore this device in Modem Manager
# ATTRS{idVendor}=="2a03", ENV{ID_MM_DEVICE_IGNORE}="1"'
# Ignore this device in Modem Manager
ATTRS{idVendor}=="28e9" ATTRS{idProduct}=="018a", ENV{ID_MM_DEVICE_IGNORE}="1"

View File

@ -34,7 +34,7 @@
{ 0x00f40000, 0x2000 }, // Channels 3713-3840
{ 0x00f80000, 0x2000 }, // Channels 3841-3968
{ 0x00fc0000, 0x0880 }, // Channels 3969-4000, VFO A, VFO B
{ 0x01000000, 0x1f400 }, // Channel bitmaps?
{ 0x01000000, 0x1f400 }, // Unknown bitmap
{ 0x01080000, 0xc0 }, // Scanlist 1
{ 0x01080200, 0xc0 }, // Scanlist 2
{ 0x01080400, 0xc0 }, // Scanlist 3
@ -309,7 +309,7 @@
{ 0x024c1280, 0x40 }, // Unknown data
{ 0x024c1300, 0x80 }, // Unknown data
{ 0x024c1400, 0x80 }, // Unknown data
{ 0x024c1500, 0x240 }, // Unknown data
{ 0x024c1500, 0x240 }, // Channel bitmap
{ 0x024c1800, 0x500 }, // Zeroes?
{ 0x024c2000, 0x440 }, // Unknown data
{ 0x024c2600, 0x40 }, // Unknown data

View File

@ -34,6 +34,9 @@
#include "radio.h"
#include "util.h"
//
// Sizes of configuration tables.
//
#define NCHAN 4000
#define NCONTACTS 10000
#define NZONES 250
@ -41,6 +44,12 @@
#define NSCANL 250
#define NMESSAGES 100
//
// Offsets in the image file.
//
#define OFFSET_BANK1 0x000040
#define OFFSET_CHAN_BITMAP 0x070a40
//
// Size of memory image.
// Essentialy a sum of all fragments defined ind868um-map.h.
@ -62,6 +71,15 @@ static fragment_t region_map[] = {
#include "d868uv-map.h"
};
//
// Channel data.
//
typedef struct {
// Bytes 0-63
uint8_t data[64];
} channel_t;
//
// Print a generic information about the device.
//
@ -208,6 +226,28 @@ static void d868uv_save_image(radio_device_t *radio, FILE *img)
fwrite(&radio_mem[0], 1, MEMSZ, img);
}
//
// Get channel bank by index.
//
static channel_t *get_bank(int i)
{
return (channel_t*) &radio_mem[OFFSET_BANK1 + i*0x2000];
}
//
// Get channel by index.
//
/*static*/ channel_t *get_channel(int i)
{
channel_t *bank = get_bank(i >> 7);
uint8_t *bitmap = &radio_mem[OFFSET_CHAN_BITMAP];
if ((bitmap[i / 8] >> (i & 7)) & 1)
return &bank[i % 128];
else
return 0;
}
//
// Parse the scalar parameter.
//

35
todo-id.diff Normal file
View File

@ -0,0 +1,35 @@
--- new1.hd 2018-10-15 23:22:12.911010924 -0700
+++ new1-id.hd 2018-10-16 00:05:47.408028203 -0700
@@ -18103,7 +18103,7 @@
000715c0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000715d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
-00071600 01 01 00 00 04 00 00 00 04 01 01 01 00 0f 01 02 |................|
+00071600 01 01 00 00 04 00 01 00 04 01 01 01 00 0f 01 02 |................|
^^
00071610 01 12 0c 13 08 01 01 01 02 05 05 05 05 00 01 00 |................|
00071620 00 00 00 00 00 00 04 01 00 01 01 00 00 01 02 01 |................|
00071630 14 00 01 01 00 00 00 02 01 01 01 08 00 00 00 00 |................|
@@ -18122,8 +18122,8 @@
*
00071b00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
-00071c00 57 45 4c 43 4f 4d 00 00 00 00 00 00 00 00 00 00 |WELCOM..........|
-00071c10 41 4e 59 54 4f 4e 45 00 00 00 00 00 00 00 00 00 |ANYTONE.........|
+00071c00 4b 4b 36 41 42 51 20 41 42 43 44 45 46 47 00 00 |KK6ABQ ABCDEFG..|
+00071c10 53 45 52 47 45 59 20 4b 4c 4d 4e 4f 50 51 00 00 |SERGEY KLMNOPQ..|
00071c20 31 32 33 34 35 36 37 38 00 00 00 00 00 00 00 00 |12345678........|
00071c30 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00071c40 00 00 00 17 00 00 00 71 00 00 00 00 a1 0f a1 0f |.......q........|
@@ -18139,8 +18139,8 @@
00071dd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00071de0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
-00073d00 12 34 56 78 00 4d 79 20 52 61 64 69 6f 00 00 00 |.4Vx.My Radio...|
-00073d10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00073d00 03 11 45 42 00 4b 4b 36 41 42 51 61 62 63 64 65 |..EB.KK6ABQabcde|
+00073d10 66 67 68 69 6a 00 00 00 00 00 00 00 00 00 00 00 |fghij...........|
00073d20 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00075c40 00 ff 00 ff 00 ff 00 ff 00 00 00 00 00 00 00 00 |................|