st sendToDeviceLength while calling setDeviceSendData

This commit is contained in:
Czarek Nakamoto
2024-07-05 08:40:44 +00:00
parent 6fa459b035
commit 5aa1f84d09

View File

@@ -1,4 +1,4 @@
From 942bc24e0f00a3382287cfbded60b0ceaf1297e0 Mon Sep 17 00:00:00 2001
From 07f41c8afda9eafca519d44f5c6c34316f5ebb71 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Wed, 26 Jun 2024 15:04:38 +0200
Subject: [PATCH] add dummy device for ledger
@@ -12,10 +12,10 @@ Subject: [PATCH] add dummy device for ledger
src/device/device_io_dummy.hpp | 74 ++++++++++++++++++
src/device/device_ledger.cpp | 6 +-
src/device/device_ledger.hpp | 7 +-
src/wallet/api/wallet.cpp | 92 +++++++++++++++++++++++
src/wallet/api/wallet.cpp | 93 +++++++++++++++++++++++
src/wallet/api/wallet.h | 18 +++++
src/wallet/api/wallet2_api.h | 12 +++
11 files changed, 355 insertions(+), 21 deletions(-)
11 files changed, 356 insertions(+), 21 deletions(-)
create mode 100644 src/device/device_io_dummy.cpp
create mode 100644 src/device/device_io_dummy.hpp
@@ -414,7 +414,7 @@ index 03058c4f1..506f27c4a 100644
unsigned char buffer_send[BUFFER_SEND_SIZE];
unsigned int length_recv;
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 8bdd75a5a..c44978a71 100644
index 8bdd75a5a..d8661b213 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -49,6 +49,9 @@
@@ -427,7 +427,7 @@ index 8bdd75a5a..c44978a71 100644
using namespace std;
using namespace cryptonote;
@@ -3299,4 +3302,93 @@ uint64_t WalletImpl::getBytesSent()
@@ -3299,4 +3302,94 @@ uint64_t WalletImpl::getBytesSent()
return m_wallet->get_bytes_sent();
}
@@ -514,6 +514,7 @@ index 8bdd75a5a..c44978a71 100644
+ return;
+ #else
+ hw::io::device_io_dummy::sendToDevice = static_cast<unsigned char *>(malloc(len));
+ hw::io::device_io_dummy::sendToDeviceLength = len;
+ memset(hw::io::device_io_dummy::sendToDevice, 0, len);
+ memcpy(hw::io::device_io_dummy::sendToDevice, data, len);
+ hw::io::device_io_dummy::waitsForDeviceSend = false;