Skip to content

Commit 00be2d5

Browse files
author
Kristifor
committed
Implementing firmware deployer fix.
1 parent e64cf91 commit 00be2d5

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

Data/ContractService.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ public static async Task<List<Token>> GetNetworkTokens(int networkId)
221221

222222
var tokens = new List<Token>();
223223

224-
225-
226-
227224
var getNetworkData = MauiProgram.NetworkSettings.FirstOrDefault(x => x.Id == networkId && x.IsProduction == MauiProgram.IsDevelopment);
228225

229226
if(getNetworkData != null)
@@ -246,9 +243,6 @@ public static async Task<List<Token>> GetNetworkTokens(int networkId)
246243
});
247244
}
248245

249-
250-
251-
252246
tokens = await GetListedTokens(listedTokenData, tokens, getNetworkData);
253247

254248
if (!File.Exists($"{MauiProgram.DefaultPath}/LocalTokens.json"))

Data/HardwareService.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using System.Security.Cryptography;
1515
using SYNCWallet.Models;
1616
using SYNCWallet.Services.Implementation;
17+
using System.Net;
1718

1819
namespace NFTLock.Data
1920
{
@@ -40,16 +41,31 @@ public string DeviceConnected()
4041
return current;
4142
}
4243

43-
public void CreateNewDevice(string port)
44+
public async void CreateNewDevice(string port)
4445
{
4546
string[] hexFileContents;
46-
47+
string userName = Environment.UserName;
48+
4749
try
48-
{
50+
{
51+
if (!File.Exists(@$"C:\Users\{userName}\Downloads\wallet.ino.standard.hex"))
52+
{
53+
using (WebClient wc = new WebClient())
54+
{
55+
56+
wc.DownloadFile(
57+
// Param1 = Link of file
58+
new System.Uri("https://raw.githubusercontent.com/KristiforMilchev/LInksync-Cold-Storage-Wallet/main/HardwareCode/ColdStorage/wallet.ino.standard.hex"),
59+
// Param2 = Path to save
60+
@$"C:\Users\{userName}\Downloads\wallet.ino.standard.hex"
61+
);
62+
}
63+
}
64+
4965
var uploader = new ArduinoSketchUploader(
5066
new ArduinoSketchUploaderOptions()
5167
{
52-
FileName = @$"{MauiProgram.DefaultPath}\HardwareCode\ColdStorage\wallet.ino.standard.hex",
68+
FileName = @$"C:\Users\{userName}\Downloads\wallet.ino.standard.hex",
5369
PortName = port,
5470
ArduinoModel = ArduinoModel.UnoR3
5571
});
@@ -59,6 +75,7 @@ public void CreateNewDevice(string port)
5975
catch (Exception e)
6076
{
6177
Debug.WriteLine(e.ToString());
78+
6279
}
6380
}
6481

SYNCWallet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<ApplicationTitle>SYNCWallet</ApplicationTitle>
1717
<!-- App Identifier -->
1818
<ApplicationId>Collaborativesoft</ApplicationId>
19-
<ApplicationIdGuid>15E612FC-7344-4F59-B4E9-6E53C73CB66A</ApplicationIdGuid>
19+
<ApplicationIdGuid>1138A4C6-A499-4A14-B8CC-1C9AE4A9EDA1</ApplicationIdGuid>
2020

2121

2222

0 commit comments

Comments
 (0)