2 * Copyright (c) 2020 Project CHIP Authors
3 * Copyright (c) 2019 Google LLC.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
30 #include "BoltLockManager.h"
32 #include <ti/drivers/apps/Button.h>
38 static void AppTaskMain(void * pvParameter);
40 void PostLockActionRequest(int32_t aActor, BoltLockManager::Action_t aAction);
41 void PostEvent(const AppEvent * event);
44 friend AppTask & GetAppTask(void);
48 // should this be done by BoltLock Manager? I don't want to unravel this spaghetti quite yet
49 static void ActionInitiated(BoltLockManager::Action_t aAction, int32_t aActor);
50 static void ActionCompleted(BoltLockManager::Action_t aAction);
52 void DispatchEvent(AppEvent * event);
54 static void ButtonLeftEventHandler(Button_Handle handle, Button_EventMask events);
55 static void ButtonRightEventHandler(Button_Handle handle, Button_EventMask events);
56 static void TimerEventHandler(void * p_context);
60 kFunction_NoneSelected = 0,
61 kFunction_SoftwareUpdate = 0,
62 kFunction_FactoryReset,
68 bool mFunctionTimerActive;
70 static AppTask sAppTask;
73 inline AppTask & GetAppTask(void)
75 return AppTask::sAppTask;