Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Update NanoSP and X Pids #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Note : Ledger Wallet only supports HIDAPI following version 1.4.14 for HW.1 / Na
Building on Linux and OS X
---------------------------

Build with GNU make (needs libusb 1.0 development APIs for Makefile.libusb or HID API from Signal 11 for Makefile.hidapi, such as the libhidapi-dev package), each command is described below
Build with GNU make (needs libusb 1.0 development APIs for Makefile.libusb or HID API from Signal 11 for Makefile.hidapi, such as the libhidapi-dev package), each command is described below. It may be necessary to install the following packages:
* sudo apt install libhidapi-dev
* sudo apt install libusb-1.0-0-dev
* sudo apt install libconfig-dev

Building on Windows
-------------------
Expand Down
2 changes: 2 additions & 0 deletions bitcoinAmount.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#include <inttypes.h>

extern inline int64_t atoi64(const char* psz);

int parseStringAmount(char *amount, int64_t* result);
void writeHexAmount(int64_t amount, unsigned char *buffer);
void writeHexAmountBE(int64_t amount, unsigned char *buffer);
Expand Down
15 changes: 14 additions & 1 deletion dongleCommHidHidapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#define BTCHIP_HID_BOOTLOADER_PID 0x1807
#define BLUE_PID 0x0000
#define NANOS_PID 0x0001
#define NANOSP_PID 0x5011
#define NANOX_PID 0x4011

#define TIMEOUT 60000
#define SW1_DATA 0x61
Expand Down Expand Up @@ -164,7 +166,18 @@ hid_device* getFirstDongleHidHidapi(unsigned char *ledger) {
if (result != NULL) {
*ledger = 1;
return result;
}
}
result = hid_open(LEDGER_VID, NANOSP_PID, NULL);
if (result != NULL) {
*ledger = 1;
return result;
}
result = hid_open(LEDGER_VID, NANOX_PID, NULL);
if (result != NULL) {
*ledger = 1;
return result;
}

return NULL;
}

Expand Down