Skip to content

Commit

Permalink
Revert "adding android zwift ride protocol"
Browse files Browse the repository at this point in the history
This reverts commit e66db6b.
  • Loading branch information
cagnulein committed Jul 31, 2024
1 parent cf719a5 commit 91989a1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 166 deletions.
114 changes: 0 additions & 114 deletions src/devices/zwiftridecontroller/zwiftridecontroller.proto

This file was deleted.

51 changes: 1 addition & 50 deletions src/virtualdevices/virtualbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,39 +381,6 @@ virtualbike::virtualbike(bluetoothdevice *t, bool noWriteResistance, bool noHear
serviceDataChanged.addCharacteristic(charData);
}

// zwift ride controller
if(1) {
QBluetoothUuid _syncRxChar(QStringLiteral("00000003-19CA-4651-86E5-FA29DCDD09D1"));
QBluetoothUuid _syncTxChar(QStringLiteral("00000004-19CA-4651-86E5-FA29DCDD09D1"));
QBluetoothUuid _asyncChar(QStringLiteral("00000002-19CA-4651-86E5-FA29DCDD09D1"));

QLowEnergyCharacteristicData charDataASyncChar;
charDataASyncChar.setUuid(_asyncChar);
charDataASyncChar.setValue(QByteArray(2, 0));
charDataASyncChar.setProperties(QLowEnergyCharacteristic::Notify);
const QLowEnergyDescriptorData clientConfigAsyncChar(QBluetoothUuid::ClientCharacteristicConfiguration,
QByteArray(2, 0));
charDataASyncChar.addDescriptor(clientConfigAsyncChar);

QLowEnergyCharacteristicData charDataSyncTxChar;
charDataASyncChar.setUuid(_syncTxChar);
charDataASyncChar.setValue(QByteArray(1, 0));
charDataASyncChar.setProperties(QLowEnergyCharacteristic::Indicate);
const QLowEnergyDescriptorData clientConfigSyncTxChar(QBluetoothUuid::ClientCharacteristicConfiguration,
QByteArray(1, 0));
charDataASyncChar.addDescriptor(clientConfigAsyncChar);

QLowEnergyCharacteristicData charDataSyncRxChar;
charDataASyncChar.setUuid(_syncRxChar);
charDataASyncChar.setProperties(QLowEnergyCharacteristic::Write | QLowEnergyCharacteristic::WriteNoResponse);

serviceDataZwiftController.setType(QLowEnergyServiceData::ServiceTypePrimary);
serviceDataZwiftController.setUuid(QBluetoothUuid(QStringLiteral("00000001-19ca-4651-86e5-fa29dcdd09d1")));
serviceDataZwiftController.addCharacteristic(charDataASyncChar);
serviceDataZwiftController.addCharacteristic(charDataSyncTxChar);
serviceDataZwiftController.addCharacteristic(charDataSyncRxChar);
}

//! [Start Advertising]
leController = QLowEnergyController::createPeripheral();
Q_ASSERT(leController);
Expand Down Expand Up @@ -446,13 +413,6 @@ virtualbike::virtualbike(bluetoothdevice *t, bool noWriteResistance, bool noHear

if (!this->noHeartService || heart_only) {
serviceHR = leController->addService(serviceDataHR);
QThread::msleep(100);
}

// zwift ride
if(1) {
serviceZwiftController = leController->addService(serviceDataZwiftController);
QThread::msleep(100);
}

if (!echelon && !ifit) {
Expand Down Expand Up @@ -1070,17 +1030,8 @@ void virtualbike::reconnect() {
if (battery)
serviceBattery = leController->addService(serviceDataBattery);

if (!this->noHeartService || heart_only) {
if (!this->noHeartService || heart_only)
serviceHR = leController->addService(serviceDataHR);
QThread::msleep(100);
}

// zwift ride
if(1) {
serviceZwiftController = leController->addService(serviceDataZwiftController);
QThread::msleep(100);
}

#endif

QLowEnergyAdvertisingParameters pars;
Expand Down
2 changes: 0 additions & 2 deletions src/virtualdevices/virtualbike.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ class virtualbike : public virtualdevice {
QLowEnergyService *serviceFIT = nullptr;
QLowEnergyService *service = nullptr;
QLowEnergyService *serviceChanged = nullptr;
QLowEnergyService *serviceZwiftController = nullptr;
QLowEnergyAdvertisingData advertisingData;
QLowEnergyServiceData serviceDataHR;
QLowEnergyServiceData serviceDataBattery;
QLowEnergyServiceData serviceDataFIT;
QLowEnergyServiceData serviceData;
QLowEnergyServiceData serviceDataChanged;
QLowEnergyServiceData serviceEchelon;
QLowEnergyServiceData serviceDataZwiftController;
QTimer bikeTimer;
bluetoothdevice *Bike;
CharacteristicWriteProcessor2AD9 *writeP2AD9 = 0;
Expand Down

0 comments on commit 91989a1

Please sign in to comment.