1 /*
2  * Copyright (C) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef OHOS_AP_DEFINE_H
16 #define OHOS_AP_DEFINE_H
17 
18 #include <any>
19 #include <string>
20 
21 #include "ap_macro.h"
22 
23 namespace OHOS {
24 namespace Wifi {
25 const int MAX_SSID_LENGTH = 32;
26 const int MAX_PSK_LENGTH = 63;
27 const int MAC_LENGTH = 17;
28 const int MAX_IP_LENGTH = 39;
29 const std::string GETTING_INFO = "Unknown";
30 
31 /* *****************************ApService********************************** */
32 
33 /* *****************************ApMonitor********************************** */
34 
35 /* *********************************StateMachine*************************** */
36 
37 /* Internal communication message of the state machine. */
38 enum class ApStatemachineEvent {
39     CMD_START_HOTSPOT,               /* start */
40     CMD_STOP_HOTSPOT,                /* stop */
41     CMD_FAIL,                        /* failed */
42     CMD_STATION_JOIN,                /* new station */
43     CMD_STATION_LEAVE,               /* station leave */
44     CMD_SET_HOTSPOT_CONFIG,          /* set configure */
45     CMD_ADD_BLOCK_LIST,              /* add block station */
46     CMD_DEL_BLOCK_LIST,              /* del block station */
47     CMD_DISCONNECT_STATION,          /* disconnect station */
48     CMD_UPDATE_HOTSPOTCONFIG_RESULT, /* Update hotspot configuration result */
49     CMD_SET_IDLE_TIMEOUT,            /* Set ap idle timeout */
50     CMD_UPDATE_COUNTRY_CODE,         /* update wifi conuntry code */
51     CMD_HOTSPOT_CHANNEL_CHANGED,     /* hotspot channel changed */
52     CMD_ASSOCIATED_STATIONS_CHANGED, /* associated stations changed */
53                                      /* (asynchronous result) */
54 };
55 
56 using HandlerApMethod = void(ApStatemachineEvent, int, int, const std::any &);
57 }
58 } // namespace OHOS
59 #endif /* OHOS_AP_DEFINE_H */
60