-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
63 changed files
with
2,637 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Copyright (c) 2018 m2049r | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef XMRWALLET_LEDGER_H | ||
#define XMRWALLET_LEDGER_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
#define SCARD_S_SUCCESS ((LONG)0x00000000) /**< No error was encountered. */ | ||
#define SCARD_E_INSUFFICIENT_BUFFER ((LONG)0x80100008) /**< The data buffer to receive returned data is too small for the returned data. */ | ||
#define SCARD_E_NO_READERS_AVAILABLE ((LONG)0x8010002E) /**< Cannot find a smart card reader. */ | ||
|
||
typedef long LONG; | ||
typedef unsigned long DWORD; | ||
typedef DWORD *LPDWORD; | ||
typedef unsigned char BYTE; | ||
typedef BYTE *LPBYTE; | ||
typedef const BYTE *LPCBYTE; | ||
|
||
typedef char CHAR; | ||
typedef CHAR *LPSTR; | ||
|
||
int LedgerFind(char *buffer, size_t len); | ||
LONG LedgerExchange(LPCBYTE pbSendBuffer, DWORD cbSendLength, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif //XMRWALLET_LEDGER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
******************************************************************************* | ||
* BTChip Bitcoin Hardware Wallet Java API | ||
* (c) 2014 BTChip - 1BTChip7VfTnrPra5jqci7ejnMguuHogTn | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
******************************************************************************** | ||
*/ | ||
|
||
package com.btchip; | ||
|
||
public class BTChipException extends Exception { | ||
|
||
private static final long serialVersionUID = 5512803003827126405L; | ||
|
||
public BTChipException(String reason) { | ||
super(reason); | ||
} | ||
|
||
public BTChipException(String reason, Throwable cause) { | ||
super(reason, cause); | ||
} | ||
|
||
public BTChipException(String reason, int sw) { | ||
super(reason); | ||
this.sw = sw; | ||
} | ||
|
||
public int getSW() { | ||
return sw; | ||
} | ||
|
||
public String toString() { | ||
if (sw == 0) { | ||
return "BTChip Exception : " + getMessage(); | ||
} else { | ||
return "BTChip Exception : " + getMessage() + " " + Integer.toHexString(sw); | ||
} | ||
} | ||
|
||
private int sw; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
******************************************************************************* | ||
* BTChip Bitcoin Hardware Wallet Java API | ||
* (c) 2014 BTChip - 1BTChip7VfTnrPra5jqci7ejnMguuHogTn | ||
* (c) 2018 m2049r | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
******************************************************************************** | ||
*/ | ||
|
||
package com.btchip.comm; | ||
|
||
import com.btchip.BTChipException; | ||
|
||
public interface BTChipTransport { | ||
public byte[] exchange(byte[] command); | ||
|
||
public void close(); | ||
|
||
public void setDebug(boolean debugFlag); | ||
} |
Oops, something went wrong.