mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fixed initial Kickr connection issues
It was because the connector was still searching when asked it to connect to a sensor. We now cancel any search before attempting to connect. But sadly, the connection is dropped and a bunch of error messages popup about firmware.
This commit is contained in:
@@ -178,11 +178,9 @@ Kickr::find()
|
||||
int
|
||||
Kickr::connectKickr()
|
||||
{
|
||||
qDebug()<<"connect";
|
||||
// discover first...
|
||||
if (scanned == false) find();
|
||||
|
||||
qDebug()<<"did we find?"<<devConf->portSpec;
|
||||
// connect
|
||||
bool found = false;
|
||||
WFApi *w = WFApi::getInstance();
|
||||
@@ -195,9 +193,7 @@ qDebug()<<"did we find?"<<devConf->portSpec;
|
||||
}
|
||||
if (found == false) return -1;
|
||||
|
||||
qDebug()<<"found, so call connect"<<i;
|
||||
w->connectDevice(i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,8 @@ static QString toQString(const NSString *nsstr)
|
||||
-(BOOL)connectDevice: (int)n
|
||||
{
|
||||
//NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
|
||||
// just in case there is a discovery in action, lets cancel it...
|
||||
[[WFHardwareConnector sharedConnector] cancelDiscoveryOnNetwork:WF_NETWORKTYPE_BTLE];
|
||||
|
||||
WFDeviceParams* dev = (WFDeviceParams*)[discoveredSensors objectAtIndex:n];
|
||||
WFConnectionParams* params = [[WFConnectionParams alloc] init];
|
||||
|
||||
Reference in New Issue
Block a user