3 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2019 Google LLC.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
23 #include "BoltLockManager.h"
25 #include <platform/CHIPDeviceLayer.h>
34 void PostLockActionRequest(int32_t aActor, BoltLockManager::Action_t aAction);
35 void PostEvent(AppEvent * event);
36 void UpdateClusterState();
39 friend AppTask & GetAppTask(void);
43 static void ActionInitiated(BoltLockManager::Action_t aAction, int32_t aActor);
44 static void ActionCompleted(BoltLockManager::Action_t aAction, int32_t aActor);
46 void CancelTimer(void);
48 void DispatchEvent(AppEvent * event);
50 static void FunctionTimerEventHandler(AppEvent * aEvent);
51 static void FunctionHandler(AppEvent * aEvent);
52 static void StartThreadHandler(AppEvent * aEvent);
53 static void LockActionEventHandler(AppEvent * aEvent);
54 static void StartBLEAdvertisementHandler(AppEvent * aEvent);
56 static void ThreadProvisioningHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
58 static void ButtonEventHandler(uint32_t buttons_state, uint32_t has_changed);
59 static void TimerEventHandler(k_timer * timer);
61 void StartTimer(uint32_t aTimeoutInMs);
63 #ifdef CONFIG_CHIP_NFC_COMMISSIONING
69 kFunction_NoneSelected = 0,
70 kFunction_SoftwareUpdate = 0,
71 kFunction_FactoryReset,
77 bool mFunctionTimerActive;
78 static AppTask sAppTask;
81 inline AppTask & GetAppTask(void)
83 return AppTask::sAppTask;