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

Method onCreate

Tactility/Source/app/chat/ChatApp.cpp:43–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void ChatApp::onCreate(AppContext& appContext) {
44 isFirstLaunch = !settingsFileExists();
45 settings = loadSettings();
46 state.setLocalNickname(settings.nickname);
47 if (!settings.chatChannel.empty()) {
48 state.setCurrentChannel(settings.chatChannel);
49 }
50 enableEspNow();
51
52 receiveSubscription = service::espnow::subscribeReceiver(
53 [this](const esp_now_recv_info_t* receiveInfo, const uint8_t* data, int length) {
54 onReceive(receiveInfo, data, length);
55 }
56 );
57}
58
59void ChatApp::onDestroy(AppContext& appContext) {
60 service::espnow::unsubscribeReceiver(receiveSubscription);

Callers 1

transitionAppToStateMethod · 0.45

Calls 5

settingsFileExistsFunction · 0.85
loadSettingsFunction · 0.85
subscribeReceiverFunction · 0.85
setLocalNicknameMethod · 0.80
setCurrentChannelMethod · 0.80

Tested by

no test coverage detected