From 34a3616180f2d40e778cb1ed8446e8171468cd49 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Wed, 26 Jun 2024 15:18:55 +0200 Subject: add dummy device to monero codebase --- .../monero_libwallet2_api_c.exp | 11 +++++- .../src/main/cpp/wallet2_api_c.cpp | 44 ++++++++++++++++++++++ .../src/main/cpp/wallet2_api_c.h | 10 +++++ 3 files changed, 64 insertions(+), 1 deletion(-) (limited to 'monero_libwallet2_api_c') diff --git a/monero_libwallet2_api_c/monero_libwallet2_api_c.exp b/monero_libwallet2_api_c/monero_libwallet2_api_c.exp index 829dd4f..843130d 100644 --- a/monero_libwallet2_api_c/monero_libwallet2_api_c.exp +++ b/monero_libwallet2_api_c/monero_libwallet2_api_c.exp @@ -286,4 +286,13 @@ _MONERO_Wallet_submitTransactionUR _MONERO_Wallet_exportOutputsUR _MONERO_Wallet_exportKeyImagesUR _MONERO_Wallet_importKeyImagesUR -_MONERO_Wallet_importOutputsUR \ No newline at end of file +_MONERO_Wallet_importOutputsUR +_MONERO_Wallet_getStateIsConnected +_MONERO_Wallet_getSendToDevice +_MONERO_Wallet_getSendToDeviceLength +_MONERO_Wallet_getReceivedFromDevice +_MONERO_Wallet_getReceivedFromDeviceLength +_MONERO_Wallet_getWaitsForDeviceSend +_MONERO_Wallet_getWaitsForDeviceReceive +_MONERO_Wallet_setDeviceReceivedData +_MONERO_Wallet_setDeviceSendData \ No newline at end of file diff --git a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp index 0111333..8e12e23 100644 --- a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp +++ b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp @@ -1608,6 +1608,50 @@ uint64_t MONERO_Wallet_getBytesSent(void* wallet_ptr) { return wallet->getBytesSent(); } +bool MONERO_Wallet_getStateIsConnected(void* wallet_ptr) { + Monero::Wallet *wallet = reinterpret_cast(wallet_ptr); + return wallet->getStateIsConnected(); +} + +unsigned char* MONERO_Wallet_getSendToDevice(void* wallet_ptr) { + Monero::Wallet *wallet = reinterpret_cast(wallet_ptr); + return wallet->getSendToDevice(); +} + +size_t MONERO_Wallet_getSendToDeviceLength(void* wallet_ptr) { + Monero::Wallet *wallet = reinterpret_cast(wallet_ptr); + return wallet->getSendToDeviceLength(); +} + +unsigned char* MONERO_Wallet_getReceivedFromDevice(void* wallet_ptr) { + Monero::Wallet *wallet = reinterpret_cast(wallet_ptr); + return wallet->getReceivedFromDevice(); +} + +size_t MONERO_Wallet_getReceivedFromDeviceLength(void* wallet_ptr) { + Monero::Wallet *wallet = reinterpret_cast(wallet_ptr); + return wallet->getReceivedFromDeviceLength(); +} + +bool MONERO_Wallet_getWaitsForDeviceSend(void* wallet_ptr) { + Monero::Wallet *wallet = reinterpret_cast(wallet_ptr); + return wallet->getWaitsForDeviceSend(); +} + +bool MONERO_Wallet_getWaitsForDeviceReceive(void* wallet_ptr) { + Monero::Wallet *wallet = reinterpret_cast(wallet_ptr); + return wallet->getWaitsForDeviceReceive(); +} + +void MONERO_Wallet_setDeviceReceivedData(void* wallet_ptr, unsigned char* data, size_t len) { + Monero::Wallet *wallet = reinterpret_cast(wallet_ptr); + return wallet->setDeviceReceivedData(data, len); +} + +void MONERO_Wallet_setDeviceSendData(void* wallet_ptr, unsigned char* data, size_t len) { + Monero::Wallet *wallet = reinterpret_cast(wallet_ptr); + return wallet->setDeviceSendData(data, len); +} void* MONERO_WalletManager_createWallet(void* wm_ptr, const char* path, const char* password, const char* language, int networkType) { Monero::WalletManager *wm = reinterpret_cast(wm_ptr); diff --git a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h index c4f68ac..e714889 100644 --- a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h +++ b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h @@ -832,6 +832,16 @@ extern ADDAPI bool MONERO_Wallet_reconnectDevice(void* wallet_ptr); extern ADDAPI uint64_t MONERO_Wallet_getBytesReceived(void* wallet_ptr); // virtual uint64_t getBytesSent() = 0; extern ADDAPI uint64_t MONERO_Wallet_getBytesSent(void* wallet_ptr); + // HIDAPI_DUMMY +extern ADDAPI bool MONERO_Wallet_getStateIsConnected(void* wallet_ptr); +extern ADDAPI unsigned char* MONERO_Wallet_getSendToDevice(void* wallet_ptr); +extern ADDAPI size_t MONERO_Wallet_getSendToDeviceLength(void* wallet_ptr); +extern ADDAPI unsigned char* MONERO_Wallet_getReceivedFromDevice(void* wallet_ptr); +extern ADDAPI size_t MONERO_Wallet_getReceivedFromDeviceLength(void* wallet_ptr); +extern ADDAPI bool MONERO_Wallet_getWaitsForDeviceSend(void* wallet_ptr); +extern ADDAPI bool MONERO_Wallet_getWaitsForDeviceReceive(void* wallet_ptr); +extern ADDAPI void MONERO_Wallet_setDeviceReceivedData(void* wallet_ptr, unsigned char* data, size_t len); +extern ADDAPI void MONERO_Wallet_setDeviceSendData(void* wallet_ptr, unsigned char* data, size_t len); // }; // struct WalletManager -- cgit v1.2.3