Go to the documentation of this file.
58 throw std::invalid_argument{
"BLEProthesisInterface::sendRaw( cmd = " + cmd +
59 " ): The UART service is not connected!"};
61 _worker->sendCommand(cmd);
69 throw std::invalid_argument{
"BLEProthesisInterface::sendGrasp( n = " +
std::to_string(n) +
80 throw std::invalid_argument{
82 " , pos = " +
std::to_string(pos) +
" ): The interval for v is [" +
87 throw std::invalid_argument{
89 " , pos = " +
std::to_string(pos) +
" ): The interval for mxPWM is [0, , " +
94 throw std::invalid_argument{
96 " , pos = " +
std::to_string(pos) +
" ): The interval for pos is [0, " +
99 std::stringstream
str;
100 str <<
'M' << 2 <<
',' <<
v <<
',' << mxPWM <<
',' << pos <<
'\n';
109 throw std::invalid_argument{
111 " , pos = " +
std::to_string(pos) +
" ): The interval for v is [" +
116 throw std::invalid_argument{
118 " , pos = " +
std::to_string(pos) +
" ): The interval for mxPWM is [0, , " +
123 throw std::invalid_argument{
125 " , pos = " +
std::to_string(pos) +
" ): The interval for pos is [0, " +
128 std::stringstream
str;
129 str <<
'M' << 3 <<
',' <<
v <<
',' << mxPWM <<
',' << pos <<
'\n';
153 return "DiscoveringDevices";
155 return "DiscoveringDevicesDone";
157 return "Disconnected";
161 return "ConnectingDone";
163 return "DiscoveringServices";
165 return "DiscoveringServicesDone";
167 return "ConnectingService";
173 return "UNKNOWN VALUE FOR BLEProthesisInterface::State: " +
std::to_string(
static_cast<int>(
s));
static constexpr std::uint64_t getMaxG()
void verboseReceive(bool b=true)
static constexpr std::uint64_t getMaxV()
static constexpr std::uint64_t getMaxPosThumb()
static constexpr std::uint64_t getMinV()
std::int64_t getFingerPWM() const
std::int64_t getThumbPos() const
@ DiscoveringServicesDone
BLEProthesisInterface(const std::string &mac, SensorValueProtocol protocol=SensorValueProtocol::mx_pos_pwm)
void verboseSend(bool b=true)
static constexpr std::uint64_t getMaxPosFingers()
void sendThumbPWM(std::uint64_t v, std::uint64_t maxPWM, std::uint64_t pos)
std::int64_t getFingerPos() const
double v(double t, double v0, double a0, double j)
std::string to_string(BLEProthesisInterface::State s)
std::int64_t getThumbPWM() const
void sendGrasp(std::uint64_t n)
double s(double t, double s0, double v0, double a0, double j)
void sendRaw(const std::string &cmd)
void sendFingerPWM(std::uint64_t v, std::uint64_t maxPWM, std::uint64_t pos)
static constexpr std::uint64_t getMaxPWM()