MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / disconnect

Function disconnect

Tactility/Source/bluetooth/Bluetooth.cpp:436–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434}
435
436void disconnect(const std::array<uint8_t, 6>& addr, int profileId) {
437 LOGGER.info("disconnect(profile={})", profileId);
438 if (profileId == BT_PROFILE_HID_HOST) {
439 hidHostDisconnect();
440 } else if (profileId == BT_PROFILE_HID_DEVICE) {
441 if (Device* dev = bluetooth_hid_device_get_device()) {
442 bluetooth_hid_device_stop(dev);
443 }
444 } else {
445 Device* dev = device_find_first_active_by_type(&BLUETOOTH_TYPE);
446 if (dev == nullptr) return;
447 bluetooth_disconnect(dev, addr.data(), (BtProfileId)profileId);
448 }
449}
450
451bool isProfileSupported(int profileId) {
452 return profileId == BT_PROFILE_HID_HOST ||

Callers 7

onDisconnectFunction · 0.50
onDisconnectPeerFunction · 0.50
onPressDisconnectMethod · 0.50
onResultMethod · 0.50
onPressDisconnectMethod · 0.50
onResultMethod · 0.50
tt_wifi_disconnectFunction · 0.50

Calls 6

bluetooth_disconnectFunction · 0.85
infoMethod · 0.80
hidHostDisconnectFunction · 0.70

Tested by

no test coverage detected