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

Method connect

Tactility/Source/app/wifimanage/View.cpp:70–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68// region Secondary updates
69
70void View::connect(lv_event_t* event) {
71 LOGGER.debug("connect()");
72 auto* widget = lv_event_get_current_target_obj(event);
73 auto index = reinterpret_cast<size_t>(lv_obj_get_user_data(widget));
74 auto* self = static_cast<View*>(lv_event_get_user_data(event));
75 auto ap_records = self->state->getApRecords();
76
77 if (index < ap_records.size()) {
78 LOGGER.info("Clicked {}/{}", index, ap_records.size() - 1);
79 auto& ssid = ap_records[index].ssid;
80 LOGGER.info("Clicked AP: {}", ssid);
81 std::string connection_target = service::wifi::getConnectionTarget();
82 if (connection_target == ssid) {
83 self->bindings->onDisconnect();
84 } else {
85 self->bindings->onConnectSsid(ssid);
86 }
87 } else {
88 LOGGER.warn("Clicked AP: record {}/{} does not exist", index, ap_records.size() - 1);
89 }
90}
91
92void View::showDetails(lv_event_t* event) {
93 LOGGER.debug("showDetails()");

Callers 1

bluetooth_connectFunction · 0.80

Calls 5

debugMethod · 0.80
getApRecordsMethod · 0.80
infoMethod · 0.80
warnMethod · 0.80
getConnectionTargetFunction · 0.50

Tested by

no test coverage detected