Skip to content
Snippets Groups Projects
Commit 6516c707 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Clean up BLEProthesisInterface

parent fe3f01b1
No related branches found
No related tags found
No related merge requests found
...@@ -149,3 +149,32 @@ void BLEProthesisInterface::sendFingerPWM(uint64_t v, uint64_t mxPWM, uint64_t p ...@@ -149,3 +149,32 @@ void BLEProthesisInterface::sendFingerPWM(uint64_t v, uint64_t mxPWM, uint64_t p
str << 'M' << 3 << ',' << v << ',' << mxPWM << ',' << pos << '\n'; str << 'M' << 3 << ',' << v << ',' << mxPWM << ',' << pos << '\n';
sendRaw(str.str()); sendRaw(str.str());
} }
std::string to_string(BLEProthesisInterface::State s)
{
switch (s)
{
case BLEProthesisInterface::State::Created:
return "Created";
case BLEProthesisInterface::State::DiscoveringDevices:
return "DiscoveringDevices";
case BLEProthesisInterface::State::DiscoveringDevicesDone:
return "DiscoveringDevicesDone";
case BLEProthesisInterface::State::Disconnected:
return "Disconnected";
case BLEProthesisInterface::State::Connecting:
return "Connecting";
case BLEProthesisInterface::State::ConnectingDone:
return "ConnectingDone";
case BLEProthesisInterface::State::DiscoveringServices:
return "DiscoveringServices";
case BLEProthesisInterface::State::DiscoveringServicesDone:
return "DiscoveringServicesDone";
case BLEProthesisInterface::State::ConnectingService:
return "ConnectingService";
case BLEProthesisInterface::State::Running:
return "Running";
case BLEProthesisInterface::State::Killed:
return "Killed";
}
return "UNKNOWN VALUE FOR BLEProthesisInterface::State: " + std::to_string(static_cast<int>(s));
}
...@@ -74,100 +74,4 @@ public: ...@@ -74,100 +74,4 @@ public:
} }
}; };
inline std::string to_string(BLEProthesisInterface::State s) std::string to_string(BLEProthesisInterface::State s);
{
switch (s)
{
case BLEProthesisInterface::State::Created:
return "Created";
case BLEProthesisInterface::State::DiscoveringDevices:
return "DiscoveringDevices";
case BLEProthesisInterface::State::DiscoveringDevicesDone:
return "DiscoveringDevicesDone";
case BLEProthesisInterface::State::Disconnected:
return "Disconnected";
case BLEProthesisInterface::State::Connecting:
return "Connecting";
case BLEProthesisInterface::State::ConnectingDone:
return "ConnectingDone";
case BLEProthesisInterface::State::DiscoveringServices:
return "DiscoveringServices";
case BLEProthesisInterface::State::DiscoveringServicesDone:
return "DiscoveringServicesDone";
case BLEProthesisInterface::State::ConnectingService:
return "ConnectingService";
case BLEProthesisInterface::State::Running:
return "Running";
case BLEProthesisInterface::State::Killed:
return "Killed";
}
return "UNKNOWN VALUE FOR BLEProthesisInterface::State: " + std::to_string(static_cast<int>(s));
}
//#include <QBluetoothDeviceDiscoveryAgent>
//#include <QBluetoothDeviceInfo>
//#include <QBluetoothSocket>
//#include <QLowEnergyController>
//class BLEProthesisInterface : public QObject
//{
// Q_OBJECT
//public:
// explicit BLEProthesisInterface(const QString& mac, QObject *parent = 0);
// ~BLEProthesisInterface();
//// void startClient(const QBluetoothServiceInfo &remoteService);
//// void stopClient();
//private:
// void removeAll();
//public slots:
//// void sendMessage(const QString &message);
// void reset(QString mac);
//signals:
//// void messageReceived(const QString &sender, const QString &message);
//// void connected(const QString &name);
//// void disconnected();
//private slots:
// void deviceDiscovered(const QBluetoothDeviceInfo &info);
// void deviceDiscoverFinished();
// void discoveryFinished();
//// void readSocket();
// void connected();
// void disconnected()
// {
// }
// void stateChanged(QLowEnergyController::ControllerState state);
// void serviceDiscovered(const QBluetoothUuid &newService);
// void controllerError(QLowEnergyController::Error error);
// void serviceCharacteristicChanged(const QLowEnergyCharacteristic& cha, const QByteArray& arr)
// {
// }
// void serviceDescriptorWritten(const QLowEnergyDescriptor& des, const QByteArray& arr)
// {
// }
// void serviceStateChanged(const QLowEnergyService::ServiceState& state);
//private:
// QBluetoothDeviceDiscoveryAgent* _discoveryAgent{nullptr};
// QString _mac;
// QBluetoothSocket* _socket{nullptr};
// QLowEnergyController* _leController{nullptr};
// QLowEnergyService* _service{nullptr};
// bool _connected{false};
// bool _reconnect{true};
// bool _serviceUp{false};
//};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment