mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-23 01:29:19 +01:00
Show bluetooth address in correct order.
(It would be nice if `std::ranges::reverse_view` worked properly with clang 15)
This commit is contained in:
parent
c7abd7a42a
commit
6a3096e36d
@ -258,14 +258,16 @@ void PairingDialog::WorkerThread()
|
|||||||
char nameBuffer[HCI_MAX_NAME_LENGTH] = {};
|
char nameBuffer[HCI_MAX_NAME_LENGTH] = {};
|
||||||
|
|
||||||
// Get device name and compare. Would use product and vendor id from SDP, but many third-party Wiimotes don't store them
|
// Get device name and compare. Would use product and vendor id from SDP, but many third-party Wiimotes don't store them
|
||||||
auto& addr = info->bdaddr;
|
const auto& addr = info->bdaddr;
|
||||||
if (hci_read_remote_name(hostDesc, &addr, HCI_MAX_NAME_LENGTH, nameBuffer,
|
if (hci_read_remote_name(hostDesc, &addr, HCI_MAX_NAME_LENGTH, nameBuffer,
|
||||||
2000) != 0 || !isWiimoteName(nameBuffer))
|
2000) != 0 || !isWiimoteName(nameBuffer))
|
||||||
{
|
{
|
||||||
UpdateCallback(PairingState::SearchFailed);
|
UpdateCallback(PairingState::SearchFailed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cemuLog_log(LogType::Force, "Pairing Dialog: Found '{}' with address {:02x}", nameBuffer, fmt::join(addr.b, ":"));
|
const auto& b = addr.b;
|
||||||
|
cemuLog_log(LogType::Force, "Pairing Dialog: Found '{}' with address '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'",
|
||||||
|
nameBuffer, b[5], b[4], b[3], b[2], b[1], b[0]);
|
||||||
|
|
||||||
UpdateCallback(PairingState::Finished);
|
UpdateCallback(PairingState::Finished);
|
||||||
L2CapWiimote::AddCandidateAddress(addr);
|
L2CapWiimote::AddCandidateAddress(addr);
|
||||||
|
@ -68,8 +68,9 @@ std::vector<WiimoteDevicePtr> L2CapWiimote::get_devices()
|
|||||||
sendAddr.l2_bdaddr = addr;
|
sendAddr.l2_bdaddr = addr;
|
||||||
|
|
||||||
if (!AttemptConnect(sendFd, sendAddr) || !AttemptSetNonBlock(sendFd)) {
|
if (!AttemptConnect(sendFd, sendAddr) || !AttemptSetNonBlock(sendFd)) {
|
||||||
cemuLog_logDebug(LogType::Force,"Failed to connect send socket to '{:02x}': {}",
|
const auto& b = addr.b;
|
||||||
fmt::join(addr.b, ":"), strerror(errno));
|
cemuLog_logDebug(LogType::Force,"Failed to connect send socket to '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}': {}",
|
||||||
|
b[5], b[4], b[3], b[2], b[1], b[0], strerror(errno));
|
||||||
close(sendFd);
|
close(sendFd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -87,8 +88,9 @@ std::vector<WiimoteDevicePtr> L2CapWiimote::get_devices()
|
|||||||
recvAddr.l2_bdaddr = addr;
|
recvAddr.l2_bdaddr = addr;
|
||||||
|
|
||||||
if (!AttemptConnect(recvFd, recvAddr) || !AttemptSetNonBlock(recvFd)) {
|
if (!AttemptConnect(recvFd, recvAddr) || !AttemptSetNonBlock(recvFd)) {
|
||||||
cemuLog_logDebug(LogType::Force,"Failed to connect recv socket to '{:02x}': {}",
|
const auto& b = addr.b;
|
||||||
fmt::join(addr.b, ":"), strerror(errno));
|
cemuLog_logDebug(LogType::Force,"Failed to connect recv socket to '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}': {}",
|
||||||
|
b[5], b[4], b[3], b[2], b[1], b[0], strerror(errno));
|
||||||
close(sendFd);
|
close(sendFd);
|
||||||
close(recvFd);
|
close(recvFd);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user