[Linux] Implement renaming airpods (#88)

* [Linux] Implement rename airpods

* [Linux] Get airpods name from airpods metadata

* [Linux] Rename AirPods: Ui improvements

---------

Co-authored-by: Tim Gromeyer <tim.gromeyer@trans4mation.de>
This commit is contained in:
Tim Gromeyer
2025-03-28 07:04:17 +01:00
committed by GitHub
parent 5a71d9630d
commit 543362da69
3 changed files with 143 additions and 0 deletions

View File

@@ -74,11 +74,26 @@ namespace AirPodsPackets
}
}
namespace Rename
{
static QByteArray getPacket(const QString &newName)
{
QByteArray nameBytes = newName.toUtf8(); // Convert name to UTF-8
quint8 size = static_cast<char>(nameBytes.size()); // Name length (1 byte)
QByteArray packet = QByteArray::fromHex("040004001A0001"); // Header
packet.append(size); // Append size byte
packet.append('\0'); // Append null byte
packet.append(nameBytes); // Append name bytes
return packet;
}
}
// Parsing Headers
namespace Parse
{
static const QByteArray EAR_DETECTION = QByteArray::fromHex("040004000600");
static const QByteArray BATTERY_STATUS = QByteArray::fromHex("040004000400");
static const QByteArray METADATA = QByteArray::fromHex("040004001d");
}
}