-
Notifications
You must be signed in to change notification settings - Fork 10
/
librtlsdr_registryAndNames.h
89 lines (77 loc) · 2.56 KB
/
librtlsdr_registryAndNames.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#pragma once
// NB. This is meant to be included in librtlsdr.h as part of the
// rtlsdr class. It's broken out this way for over all clarity.
typedef uint8_t usbportnums[ MAX_USB_PATH ];
protected: // Static functions Dongle array handling
STATIC void FillDongleArraysAndComboBox
( CDongleArray * da
, CComboBox * combo
, LPCTSTR selected
);
STATIC bool GetDongleIdString ( CString& string
, int devindex
);
STATIC int FindDongleByIdString ( LPCTSTR source );
protected: // Static functions Registry handling
STATIC void WriteRegistry ( void );
STATIC uint32_t WriteSingleRegistry ( int index );
STATIC void WriteRegLastCatalogTime ( void );
STATIC void ReadRegistry ( void );
STATIC void mergeToMaster ( Dongle& tempd );
STATIC const rtlsdr_dongle_t *
find_known_device ( uint16_t vid
, uint16_t pid
);
STATIC const char*
find_requested_dongle_name
( libusb_context *ctx
, uint32_t index
);
STATIC int open_requested_device ( libusb_context *ctx
, uint32_t index
, libusb_device_handle **ldevh
, bool devindex
);
STATIC int GetDongleIndexFromNames ( const char * manufact
, const char * product
, const char * serial
);
STATIC int GetDongleIndexFromNames ( const CString & manufact
, const CString & product
, const CString & serial
);
STATIC int GetDongleIndexFromDongle( const Dongle dongle );
protected: // Class functions
int GetEepromStrings ( const eepromdata& data
, CString* manf
, CString* prod
, CString* sern
);
int GetEepromStrings ( uint8_t *data
, int datalen
, char* manf
, char* prod
, char* sern
);
int FullEepromParse ( const eepromdata& data
, Dongle& tdongle
);
int SafeFindDongle ( const Dongle& tdongle );
STATIC int FindInMasterDB ( Dongle* dng
, bool exact
);
STATIC int FindGuessInMasterDB ( Dongle* dng );
private:
int GetEepromString ( const eepromdata& data
, int pos
, CString* string
);
int GetEepromString ( const uint8_t *data
, int datalen
, int pos
, char* string
);
protected: // Static Registry/Dongle array
static time_t lastCatalog;
static bool noCatalog;
static bool goodCatalog;