mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-14 01:03:01 -07:00
Multiple USB-CDC changes (attempt 6) (#439)
- Fix reporting of string descriptors. - Add note about ModemManager matching on the manufacturer string.
This commit is contained in:
parent
bb04ef216d
commit
05b6b11785
1 changed files with 19 additions and 14 deletions
|
@ -44,6 +44,11 @@
|
||||||
#define AT91C_EP_OUT_SIZE 0x40
|
#define AT91C_EP_OUT_SIZE 0x40
|
||||||
#define AT91C_EP_IN_SIZE 0x40
|
#define AT91C_EP_IN_SIZE 0x40
|
||||||
|
|
||||||
|
// Language must always be 0.
|
||||||
|
#define STR_LANGUAGE_CODES 0x00
|
||||||
|
#define STR_MANUFACTURER 0x01
|
||||||
|
#define STR_PRODUCT 0x02
|
||||||
|
|
||||||
static const char devDescriptor[] = {
|
static const char devDescriptor[] = {
|
||||||
/* Device descriptor */
|
/* Device descriptor */
|
||||||
0x12, // bLength
|
0x12, // bLength
|
||||||
|
@ -56,8 +61,8 @@ static const char devDescriptor[] = {
|
||||||
0xc4,0x9a, // Vendor ID (0x9ac4 = J. Westhues)
|
0xc4,0x9a, // Vendor ID (0x9ac4 = J. Westhues)
|
||||||
0x8f,0x4b, // Product ID (0x4b8f = Proxmark-3 RFID Instrument)
|
0x8f,0x4b, // Product ID (0x4b8f = Proxmark-3 RFID Instrument)
|
||||||
0x01,0x00, // Device release number (0001)
|
0x01,0x00, // Device release number (0001)
|
||||||
0x01, // iManufacturer
|
STR_MANUFACTURER, // iManufacturer
|
||||||
0x02, // iProduct
|
STR_PRODUCT, // iProduct
|
||||||
0x00, // iSerialNumber
|
0x00, // iSerialNumber
|
||||||
0x01 // bNumConfigs
|
0x01 // bNumConfigs
|
||||||
};
|
};
|
||||||
|
@ -157,7 +162,9 @@ static const char StrDescLanguageCodes[] = {
|
||||||
0x03, // Type is string
|
0x03, // Type is string
|
||||||
0x09, 0x04 // supported language Code 0 = 0x0409 (English)
|
0x09, 0x04 // supported language Code 0 = 0x0409 (English)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Note: ModemManager (Linux) ignores Proxmark3 devices by matching the
|
||||||
|
// manufacturer string "proxmark.org". Don't change this.
|
||||||
static const char StrDescManufacturer[] = {
|
static const char StrDescManufacturer[] = {
|
||||||
26, // Length
|
26, // Length
|
||||||
0x03, // Type is string
|
0x03, // Type is string
|
||||||
|
@ -182,20 +189,18 @@ static const char StrDescProduct[] = {
|
||||||
'M', 0x00,
|
'M', 0x00,
|
||||||
'3', 0x00
|
'3', 0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* const pStrings[] =
|
|
||||||
{
|
|
||||||
StrDescLanguageCodes,
|
|
||||||
StrDescManufacturer,
|
|
||||||
StrDescProduct
|
|
||||||
};
|
|
||||||
|
|
||||||
const char* getStringDescriptor(uint8_t idx)
|
const char* getStringDescriptor(uint8_t idx)
|
||||||
{
|
{
|
||||||
if(idx >= (sizeof(pStrings) / sizeof(pStrings[0]))) {
|
switch (idx) {
|
||||||
return(NULL);
|
case STR_LANGUAGE_CODES:
|
||||||
} else {
|
return StrDescLanguageCodes;
|
||||||
return(pStrings[idx]);
|
case STR_MANUFACTURER:
|
||||||
|
return StrDescManufacturer;
|
||||||
|
case STR_PRODUCT:
|
||||||
|
return StrDescProduct;
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue