Add Bluetooth audio/HID/discoverability/alias support, fix SD card hotplug & caller ID matching, and expand ReMEdy J2ME JSRs + 64MB GC
This commit is contained in:
1 parent
456d3fbc42
commit
471916424e
51 files changed
+2961
-305
No files matched your search
@@ -44,12 +44,13 @@ struct BtSendTarget {
|
||||
|
||||
std::vector<BtSendTarget> queryBtSendTargets(bool scanFirst = false) {
|
||||
std::string rfk = runCaptureCmd("/usr/sbin/rfkill list bluetooth 2>/dev/null");
|
||||
if (rfk.find("Soft blocked: yes") != std::string::npos ||
|
||||
if (::access("/run/bluetoothd.pid", F_OK) != 0 ||
|
||||
rfk.find("Soft blocked: yes") != std::string::npos ||
|
||||
rfk.find("Hard blocked: yes") != std::string::npos) {
|
||||
runCaptureCmd("SXMO_OS=alpine doas -n sxmo_bluetoothtoggle.sh on >/dev/null 2>&1");
|
||||
}
|
||||
if (scanFirst) {
|
||||
runCaptureCmd("bluetoothctl --timeout 4 scan on >/dev/null 2>&1");
|
||||
runCaptureCmd("timeout 5 bluetoothctl --timeout 4 scan on >/dev/null 2>&1");
|
||||
}
|
||||
std::unordered_set<std::string> pairedMacs;
|
||||
std::unordered_set<std::string> connectedMacs;
|
||||
@@ -62,14 +63,14 @@ std::vector<BtSendTarget> queryBtSendTargets(bool scanFirst = false) {
|
||||
}
|
||||
}
|
||||
};
|
||||
parseSet(runCaptureCmd("bluetoothctl devices Paired 2>/dev/null || "
|
||||
"bluetoothctl paired-devices 2>/dev/null"),
|
||||
parseSet(runCaptureCmd("timeout 2 bluetoothctl devices Paired 2>/dev/null || "
|
||||
"timeout 2 bluetoothctl paired-devices 2>/dev/null"),
|
||||
pairedMacs);
|
||||
parseSet(runCaptureCmd("bluetoothctl devices Connected 2>/dev/null"),
|
||||
parseSet(runCaptureCmd("timeout 2 bluetoothctl devices Connected 2>/dev/null"),
|
||||
connectedMacs);
|
||||
|
||||
std::vector<BtSendTarget> out;
|
||||
std::string allRaw = runCaptureCmd("bluetoothctl devices 2>/dev/null");
|
||||
std::string allRaw = runCaptureCmd("timeout 2 bluetoothctl devices 2>/dev/null");
|
||||
std::istringstream ss(allRaw);
|
||||
std::string line;
|
||||
while (std::getline(ss, line)) {
|
||||
|
||||
Reference in new issue
Block a user