Skip to content

Commit

Permalink
fix wrong characteristic used in setIds function
Browse files Browse the repository at this point in the history
  • Loading branch information
StefWe authored and FlorentRevest committed Mar 22, 2020
1 parent 16a9d8b commit 89d4b17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/weatherservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ bool WeatherService::setCity(QString city)

bool WeatherService::setIds(QList<short> l)
{
if(m_service && m_cityChrc.isValid()) {
if(m_service && m_idsChrc.isValid()) {
QByteArray data(10, 0);

for(int i = 0; i < l.length() && i < 5; i++) {
data[2*i] = (quint8)(l[i] >> 8);
data[(2*i)+1] = (quint8)(l[i]);
}

m_service->writeCharacteristic(m_cityChrc, data, QLowEnergyService::WriteWithoutResponse);
m_service->writeCharacteristic(m_idsChrc, data, QLowEnergyService::WriteWithoutResponse);
return true;
} else
return false;
Expand Down

0 comments on commit 89d4b17

Please sign in to comment.