Skip to content

Commit f7a9dda

Browse files
committed
Added connect function
1 parent 90cc4f3 commit f7a9dda

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

BmwDeepObd/BmwRpcCoding.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,36 @@ public async Task<bool> RpcClientConnect(string loadUrl, bool enableIpV6, Cancel
633633
}
634634
}
635635

636+
public async Task<bool> ConnectVehicle()
637+
{
638+
try
639+
{
640+
string istaFolder;
641+
lock (StatusLock)
642+
{
643+
istaFolder = _statusData.IstaFolder;
644+
}
645+
646+
bool result = await _psdzRpcClient.RpcService.ConnectVehicle(istaFolder, string.Empty, false).ConfigureAwait(false);
647+
if (result)
648+
{
649+
await RpcClientTaskStarted().ConfigureAwait(false);
650+
}
651+
else
652+
{
653+
_ediabasProxyClient?.EdiabasLogFormat(EdiabasNet.EdLogLevel.Ifh, "ConnectVehicle failed");
654+
}
655+
return result;
656+
}
657+
catch (Exception ex)
658+
{
659+
_ediabasProxyClient?.EdiabasLogFormat(EdiabasNet.EdLogLevel.Ifh, "ConnectVehicle: Exception={0}",
660+
EdiabasNet.GetExceptionText(ex, false, false));
661+
return false;
662+
}
663+
664+
}
665+
636666
public async Task DisposeRpcClient()
637667
{
638668
try

0 commit comments

Comments
 (0)