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

Function getRadioState

Tactility/Source/bluetooth/Bluetooth.cpp:339–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339RadioState getRadioState() {
340 Device* dev = device_find_first_active_by_type(&BLUETOOTH_TYPE);
341 if (dev == nullptr) return RadioState::Off;
342 BtRadioState state = BT_RADIO_STATE_OFF;
343 bluetooth_get_radio_state(dev, &state);
344 switch (state) {
345 case BT_RADIO_STATE_OFF: return RadioState::Off;
346 case BT_RADIO_STATE_ON_PENDING: return RadioState::OnPending;
347 case BT_RADIO_STATE_ON: return RadioState::On;
348 case BT_RADIO_STATE_OFF_PENDING: return RadioState::OffPending;
349 }
350 return RadioState::Off;
351}
352
353std::vector<PeerRecord> getScanResults() {
354 auto lock = scan_cache_mutex.asScopedLock();

Callers 12

hidHostConnectFunction · 0.70
onWifiEventMethod · 0.50
onShowMethod · 0.50
updateViewStateMethod · 0.50
onBtEventMethod · 0.50
onShowMethod · 0.50
onPressDisconnectMethod · 0.50
updateConnectButtonMethod · 0.50
updateBusySpinnerMethod · 0.50
onResultMethod · 0.50
refreshMethod · 0.50
tt_wifi_get_radio_stateFunction · 0.50

Calls 2

Tested by

no test coverage detected