Fixing bluetooth under QT6/OpenSUSE Tumbleweed
It looks like this has never worked under QT6, the implementation was inconsistent with the QT5 behaviour. Given that the QT5 behaviour works with the shipped Android app, I've tweaked the QT6 to be functionally equivalent to the QT5 implementations. https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/600#note_1018493 @diamnew if you are able to build and test this; that would be a great help.
This commit is contained in:
parent
be39c9317d
commit
8b9235b64e
1 changed files with 9 additions and 9 deletions
|
@ -133,7 +133,7 @@ bool ConnectionMultiplexer::tryParseMessage()
|
||||||
message_uuid_raw.data[i] = header[3 + i];
|
message_uuid_raw.data[i] = header[3 + i];
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
message_uuid_raw = qFromBigEndian<quint128>(&header.data()[3]);
|
message_uuid_raw = qFromLittleEndian<quint128>(&header.data()[3]);
|
||||||
#endif
|
#endif
|
||||||
QBluetoothUuid message_uuid = QBluetoothUuid(message_uuid_raw);
|
QBluetoothUuid message_uuid = QBluetoothUuid(message_uuid_raw);
|
||||||
|
|
||||||
|
@ -236,8 +236,8 @@ QBluetoothUuid ConnectionMultiplexer::newChannel()
|
||||||
message[0] = MESSAGE_OPEN_CHANNEL;
|
message[0] = MESSAGE_OPEN_CHANNEL;
|
||||||
qToBigEndian<uint16_t>(0, &message.data()[1]);
|
qToBigEndian<uint16_t>(0, &message.data()[1]);
|
||||||
|
|
||||||
const auto channelBytes = new_id.toByteArray();
|
const auto channelBytes = new_id.toBytes();
|
||||||
message.append(channelBytes.constData(), 16);
|
message.append((const char *)&channelBytes, 16);
|
||||||
to_write_bytes.append(message);
|
to_write_bytes.append(message);
|
||||||
|
|
||||||
// Add the channel ourselves
|
// Add the channel ourselves
|
||||||
|
@ -345,8 +345,8 @@ void ConnectionMultiplexer::channelCanRead(QBluetoothUuid channelId)
|
||||||
QByteArray message(3, (char)0);
|
QByteArray message(3, (char)0);
|
||||||
message[0] = MESSAGE_READ;
|
message[0] = MESSAGE_READ;
|
||||||
qToBigEndian<uint16_t>(2, &message.data()[1]);
|
qToBigEndian<uint16_t>(2, &message.data()[1]);
|
||||||
const auto channelBytes = channelId.toByteArray();
|
const auto channelBytes = channelId.toBytes();
|
||||||
message.append(channelBytes.constData(), 16);
|
message.append((const char *)&channelBytes, 16);
|
||||||
message.append(2, 0);
|
message.append(2, 0);
|
||||||
qToBigEndian<int16_t>(read_amount, &message.data()[19]);
|
qToBigEndian<int16_t>(read_amount, &message.data()[19]);
|
||||||
to_write_bytes.append(message);
|
to_write_bytes.append(message);
|
||||||
|
@ -375,8 +375,8 @@ void ConnectionMultiplexer::channelCanWrite(QBluetoothUuid channelId)
|
||||||
message[0] = MESSAGE_WRITE;
|
message[0] = MESSAGE_WRITE;
|
||||||
qToBigEndian<uint16_t>(amount, &message.data()[1]);
|
qToBigEndian<uint16_t>(amount, &message.data()[1]);
|
||||||
|
|
||||||
const auto channelBytes = channelId.toByteArray();
|
const auto channelBytes = channelId.toBytes();
|
||||||
message.append(channelBytes.constData(), 16);
|
message.append((const char *)&channelBytes, 16);
|
||||||
message.append(data);
|
message.append(data);
|
||||||
to_write_bytes.append(message);
|
to_write_bytes.append(message);
|
||||||
// Try to send it immediately
|
// Try to send it immediately
|
||||||
|
@ -413,8 +413,8 @@ void ConnectionMultiplexer::closeChannel(QBluetoothUuid channelId)
|
||||||
message[0] = MESSAGE_CLOSE_CHANNEL;
|
message[0] = MESSAGE_CLOSE_CHANNEL;
|
||||||
qToBigEndian<uint16_t>(0, &message.data()[1]);
|
qToBigEndian<uint16_t>(0, &message.data()[1]);
|
||||||
|
|
||||||
const auto channelBytes = channelId.toByteArray();
|
const auto channelBytes = channelId.toBytes();
|
||||||
message.append(channelBytes.constData(), 16);
|
message.append((const char *)&channelBytes, 16);
|
||||||
to_write_bytes.append(message);
|
to_write_bytes.append(message);
|
||||||
// Try to send it immediately
|
// Try to send it immediately
|
||||||
bytesWritten();
|
bytesWritten();
|
||||||
|
|
Loading…
Reference in a new issue