Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There was missing first letter in notification #286

Merged
merged 4 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion daemon/src/devices/huamidevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void HuamiDevice::incomingCall(const QString &caller)
qDebug() << Q_FUNC_INFO << caller;
AlertNotificationService *alert = qobject_cast<AlertNotificationService*>(service(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION));
if (alert) {
alert->incomingCall(caller);
alert->incomingCall(QByteArray::fromHex("0301"), caller);
}
}

Expand Down
2 changes: 1 addition & 1 deletion daemon/src/devices/pinetimejfdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void PinetimeJFDevice::incomingCall(const QString &caller)
qDebug() << Q_FUNC_INFO << caller;
AlertNotificationService *alert = qobject_cast<AlertNotificationService*>(service(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION));
if (alert) {
alert->incomingCall(caller);
alert->incomingCall(QByteArray::fromHex("030100"), caller);
}
}

Expand Down
5 changes: 2 additions & 3 deletions daemon/src/services/alertnotificationservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ void AlertNotificationService::sendAlert(const QString &sender, const QString &s
writeValue(UUID_CHARACTERISTIC_ALERT_NOTIFICATION_NEW_ALERT, send);
}

void AlertNotificationService::incomingCall(const QString &caller)
void AlertNotificationService::incomingCall(const QByteArray header, const QString &caller)
{
qDebug() << Q_FUNC_INFO << caller;
QByteArray send = QByteArray::fromHex("0301");
send += caller.toUtf8();
QByteArray send = header + caller.toUtf8();
writeValue(UUID_CHARACTERISTIC_ALERT_NOTIFICATION_NEW_ALERT, send);
}

Expand Down
2 changes: 1 addition & 1 deletion daemon/src/services/alertnotificationservice.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class AlertNotificationService : public QBLEService
};

Q_INVOKABLE void sendAlert(const QString &sender, const QString &subject, const QString &message);
Q_INVOKABLE void incomingCall(const QString &caller);
Q_INVOKABLE void incomingCall(const QByteArray header, const QString &caller);
static int mapSenderToIcon(const QString &sender);

Q_SIGNAL void serviceEvent(const QString &c, uint8_t event);
Expand Down