Kickr linker fixups, still crashes

.. on CBCentralManager delegate didUpdateState. Not
sure if this is internal to the WF API or if QT is
getting upset at unexpected events.
This commit is contained in:
Mark Liversedge
2013-01-20 12:44:08 +00:00
parent fced16d6e2
commit e140f7f8f1
2 changed files with 37 additions and 11 deletions

View File

@@ -63,13 +63,21 @@ static QString toQString(const NSString *nsstr)
@synthesize sharedConnector;
//**********************************************************************
// METHODS
//**********************************************************************
// initialise by getting the WF API singleton
-(id)init
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
// initialise
self.sharedConnector = [WFHardwareConnector sharedConnector];
[self.sharedConnector setDelegate:self];
[pool drain];
return self;
}
@@ -78,43 +86,53 @@ static QString toQString(const NSString *nsstr)
// State of BTLE support and hardware
-(BOOL)hasBTLESupport { return [self.sharedConnector hasBTLESupport]; }
// By default BTLE is disabled
-(BOOL)isBTLEEnabled { return [self.sharedConnector isBTLEEnabled]; }
-(BOOL)enableBTLE:(BOOL)bEnable inBondingMode:(BOOL)bBondingMode {
return [self.sharedConnector enableBTLE:bEnable inBondingMode:bBondingMode];
}
// ready to scan
-(BOOL)isCommunicationHWReady { return [self.sharedConnector isCommunicationHWReady]; }
// scan
-(BOOL)discoverDevicesOfType:(WFSensorType_t)eSensorType onNetwork:(WFNetworkType_t)eNetworkType searchTimeout:(NSTimeInterval)timeout
{
return [self.sharedConnector discoverDevicesOfType:eSensorType onNetwork:eNetworkType searchTimeout:timeout];
}
//**********************************************************************
// EVENTS / SIGNALS
//**********************************************************************
// WFHardwareConnectorDelegate Functions
- (void)hardwareConnector:(WFHardwareConnector*)hwConnector connectedSensor:(WFSensorConnection*)connectionInfo
-(void)hardwareConnector:(WFHardwareConnector*)hwConnector connectedSensor:(WFSensorConnection*)connectionInfo
{
qtw->connectedSensor(connectionInfo);
}
- (void)hardwareConnector:(WFHardwareConnector*)hwConnector didDiscoverDevices:(NSSet*)connectionParams searchCompleted:(BOOL)bCompleted
-(void)hardwareConnector:(WFHardwareConnector*)hwConnector didDiscoverDevices:(NSSet*)connectionParams searchCompleted:(BOOL)bCompleted
{
qtw->didDiscoverDevices(); //XXX convert array
}
- (void)hardwareConnector:(WFHardwareConnector*)hwConnector disconnectedSensor:(WFSensorConnection*)connectionInfo
-(void)hardwareConnector:(WFHardwareConnector*)hwConnector disconnectedSensor:(WFSensorConnection*)connectionInfo
{
qtw->disconnectedSensor(connectionInfo);
}
- (void)hardwareConnector:(WFHardwareConnector*)hwConnector stateChanged:(WFHardwareConnectorState_t)currentState
-(void)hardwareConnector:(WFHardwareConnector*)hwConnector stateChanged:(WFHardwareConnectorState_t)currentState
{
qtw->stateChanged();
}
- (void)hardwareConnectorHasData
-(void)hardwareConnectorHasData
{
qtw->hasData();
}
- (void) hardwareConnector:(WFHardwareConnector*)hwConnector hasFirmwareUpdateAvailableForConnection:(WFSensorConnection*)connectionInfo required:(BOOL)required withWahooUtilityAppURL:(NSURL *)wahooUtilityAppURL
-(void) hardwareConnector:(WFHardwareConnector*)hwConnector hasFirmwareUpdateAvailableForConnection:(WFSensorConnection*)connectionInfo required:(BOOL)required withWahooUtilityAppURL:(NSURL *)wahooUtilityAppURL
{
qtw->hasFirmwareUpdateAvalableForConnection(); //XXX do what?
}
@@ -145,7 +163,10 @@ WFApi::~WFApi()
[wf release];
}
// Methods
//**********************************************************************
// METHODS
//**********************************************************************
QString WFApi::apiVersion() { return toQString([wf apiVersion]); }
bool WFApi::isBTLEEnabled() { return [wf isBTLEEnabled]; }
bool WFApi::hasBTLESupport() { return [wf hasBTLESupport]; }
@@ -161,7 +182,10 @@ WFApi::discoverDevicesOfType(int eSensorType, int eNetworkType, int timeout)
return [wf discoverDevicesOfType:WF_SENSORTYPE_BIKE_POWER onNetwork:WF_NETWORKTYPE_BTLE searchTimeout:15.00];
}
// slots
//**********************************************************************
// SLOTS
//**********************************************************************
void
WFApi::connectedSensor(void*)
{

View File

@@ -9,7 +9,7 @@ TARGET = GoldenCheetah
DEPENDPATH += .
INCLUDEPATH += ../qwt/src ../qxt/src $${LIBZ_INCLUDE}
QT += xml sql network webkit script
QT += xml sql network webkit script svg
LIBS += ../qwt/lib/libqwt.a
LIBS += -lm $${LIBZ_LIBS}
@@ -135,7 +135,7 @@ LIBS += -lm $${LIBZ_LIBS}
# Lion fullscreen playback
# search box for title bar
macx {
LIBS += -lobjc -framework Carbon -framework IOKit -framework AppKit -framework QTKit
LIBS += -lobjc -framework IOKit -framework AppKit -framework QTKit
HEADERS += QtMacVideoWindow.h \
LionFullScreen.h \
QtMacSegmentedButton.h \
@@ -159,7 +159,9 @@ macx {
!isEmpty(HAVE_WFAPI) {
DEFINES += GC_HAVE_WFAPI
LIBS += -framework WFConnector -framework IOBluetooth
LIBS += -framework WFConnector
LIBS += -framework IOBluetooth -framework Foundation
LIBS += -lstdc++ -all_load
# We have an abstraction layer for the Wahoo Fitness API
# At present this only works on Mac -- since support for