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_DEFINE_H 16 #define OHOS_DEFINE_H 17 18 #ifndef OHOS_ARCH_LITE 19 #include "system_ability_definition.h" 20 #endif 21 22 /* The response message ID of callback */ 23 #define WIFI_CBK_MSG_STATE_CHANGE 0x1001 24 #define WIFI_CBK_MSG_CONNECTION_CHANGE 0x1002 25 #define WIFI_CBK_MSG_RSSI_CHANGE 0x1003 26 #define WIFI_CBK_MSG_STREAM_DIRECTION 0x1004 27 #define WIFI_CBK_MSG_WPS_STATE_CHANGE 0x1005 28 #define WIFI_CBK_MSG_DEVICE_CONFIG_CHANGE 0x1006 29 #define WIFI_CBK_MSG_SEMI_STATE_CHANGE 0x1007 30 #define WIFI_CBK_MSG_MAX_INVALID_STA 0x1FFF /* STA invalid value */ 31 32 #define WIFI_CBK_MSG_SCAN_STATE_CHANGE 0x2001 33 34 #define WIFI_CBK_MSG_HOTSPOT_STATE_CHANGE 0x3001 35 #define WIFI_CBK_MSG_HOTSPOT_STATE_JOIN 0x3002 36 #define WIFI_CBK_MSG_HOTSPOT_STATE_LEAVE 0x3003 37 #define WIFI_CBK_MSG_MAX_INVALID_HOTSPOT 0x3FFF /* HOTSPOT invalid value */ 38 39 #define WIFI_CBK_MSG_P2P_STATE_CHANGE 0x4001 40 #define WIFI_CBK_MSG_PERSISTENT_GROUPS_CHANGE 0x4002 /* Persistent Group Updated */ 41 #define WIFI_CBK_MSG_THIS_DEVICE_CHANGE 0x4003 42 #define WIFI_CBK_MSG_PEER_CHANGE 0x4004 43 #define WIFI_CBK_MSG_SERVICE_CHANGE 0x4005 44 #define WIFI_CBK_MSG_CONNECT_CHANGE 0x4006 45 #define WIFI_CBK_MSG_DISCOVERY_CHANGE 0x4007 46 #define WIFI_CBK_MSG_P2P_ACTION_RESULT 0x4008 47 #define WIFI_CBK_MSG_CFG_CHANGE 0x4009 48 #define WIFI_CBK_MSG_P2P_GC_JOIN_GROUP 0x4010 49 #define WIFI_CBK_MSG_P2P_GC_LEAVE_GROUP 0x4011 50 #define WIFI_CBK_MSG_PRIVATE_PEER_CHANGE 0x4012 51 #define WIFI_CBK_MSG_P2P_CHR_ERRCODE_REPORT 0x4013 52 #define WIFI_CBK_MSG_MAX_INVALID_P2P 0x4FFF /* P2P invalid value */ 53 54 /* -----------Callback event name define-------------- */ 55 #define EVENT_STA_POWER_STATE_CHANGE "wifiStateChange" 56 #define EVENT_STA_CONN_STATE_CHANGE "wifiConnectionChange" 57 #define EVENT_STA_RSSI_STATE_CHANGE "wifiRssiChange" 58 #define EVENT_STA_WPS_STATE_CHANGE "wifiWpsStateChange" 59 #define EVENT_STREAM_CHANGE "streamChange" 60 #define EVENT_STA_DEVICE_CONFIG_CHANGE "deviceConfigChange" 61 #define EVENT_STA_SCAN_STATE_CHANGE "wifiScanStateChange" /* STA*/ 62 63 #define EVENT_HOTSPOT_STATE_CHANGE "hotspotStateChange" 64 #define EVENT_HOTSPOT_STA_JOIN "hotspotStaJoin" 65 #define EVENT_HOTSPOT_STA_LEAVE "hotspotStaLeave" /* AP */ 66 67 #define EVENT_P2P_STATE_CHANGE "p2pStateChange" 68 #define EVENT_P2P_PERSISTENT_GROUP_CHANGE "p2pPersistentGroupChange" 69 #define EVENT_P2P_DEVICE_STATE_CHANGE "p2pDeviceChange" 70 #define EVENT_P2P_PEER_DEVICE_CHANGE "p2pPeerDeviceChange" 71 #define EVENT_P2P_SERVICES_CHANGE "p2pServicesChange" 72 #define EVENT_P2P_CONN_STATE_CHANGE "p2pConnectionChange" 73 #define EVENT_P2P_DISCOVERY_CHANGE "p2pDiscoveryChange" 74 #define EVENT_P2P_ACTION_RESULT "p2pActionResult" 75 #define EVENT_P2P_CONFIG_CHANGE "p2pConfigChange" 76 #define EVENT_P2P_GC_JOIN_GROUP "p2pGcJoinGroup" 77 #define EVENT_P2P_GC_LEAVE_GROUP "p2pGcLeaveGroup" 78 #define EVENT_P2P_PRIVATE_PEER_DEVICE_CHANGE "p2pPrivatePeerDeviceChange" 79 #define EVENT_P2P_CHR_ERRCODE_REPORT "p2pChrErrCodeReport" /* P2P */ 80 81 /* -----------Feature service name-------------- */ 82 #define WIFI_SERVICE_STA "StaService" /* STA */ 83 #define WIFI_SERVICE_SELFCURE "SelfCureService" /* SELFCURE */ 84 #define WIFI_SERVICE_WIFIPRO "WifiProService" /* WIFIPRO */ 85 #define WIFI_SERVICE_AP "ApService" /* AP */ 86 #define WIFI_SERVICE_P2P "P2pService" /* P2P */ 87 #define WIFI_SERVICE_SCAN "ScanService" /* SCAN */ 88 #define WIFI_SERVICE_AWARE "AwareService" /* AWARE */ 89 #define WIFI_SERVICE_ENHANCE "EnhanceService" /* ENHANCE */ 90 /* ---------Feature service ability id */ 91 #ifdef OHOS_ARCH_LITE 92 #define WIFI_DEVICE_ABILITY_ID 1120 93 #define WIFI_HOTSPOT_ABILITY_ID 1121 94 #define WIFI_P2P_ABILITY_ID 1123 95 #define WIFI_SCAN_ABILITY_ID 1124 96 #else 97 #define WIFI_DEVICE_ABILITY_ID OHOS::WIFI_DEVICE_SYS_ABILITY_ID /* 1120 */ 98 #define WIFI_HOTSPOT_ABILITY_ID OHOS::WIFI_HOTSPOT_SYS_ABILITY_ID /* 1121 */ 99 #define WIFI_P2P_ABILITY_ID OHOS::WIFI_P2P_SYS_ABILITY_ID /* 1123 */ 100 #define WIFI_SCAN_ABILITY_ID OHOS::WIFI_SCAN_SYS_ABILITY_ID /* 1124 */ 101 #endif 102 103 #define MODE_STATE_SCREEN (1) 104 #define MODE_STATE_AIR_PLANE (2) 105 #define MODE_STATE_APP_RUN (3) 106 #define MODE_STATE_POWER_SAVING (4) 107 #define MODE_STATE_FREEZE (5) 108 #define MODE_STATE_NO_CHARGER_PLUG (6) 109 110 #define MODE_STATE_EXPAND (1) 111 #define MODE_STATE_FOLDED (2) 112 #define MODE_STATE_HALF_FOLD (3) 113 114 #define MODE_STATE_DEFAULT (-1) 115 /* Begin apf filter */ 116 #define MODE_STATE_OPEN (1) 117 #define MODE_STATE_CLOSE (2) 118 /* End apf filter */ 119 #define WIFI_STATE_DISABLED (0) 120 #define WIFI_STATE_ENABLED (1) 121 #define WIFI_STATE_SEMI_ENABLED (2) 122 #define INTERFACEDESCRIPTORL1 u"ohos.wifi.IWifiDeviceService" 123 #define DECLARE_INTERFACE_DESCRIPTOR_L1_LENGTH (sizeof(INTERFACEDESCRIPTORL1)/sizeof(uint16_t)) 124 #define DECLARE_INTERFACE_DESCRIPTOR_L1 ((uint16_t*)&INTERFACEDESCRIPTORL1[0]) 125 126 /* Multilink */ 127 #define INSTID_WLAN0 (0) 128 #define INSTID_WLAN1 (1) 129 #ifndef STA_INSTANCE_MAX_NUM 130 #define STA_INSTANCE_MAX_NUM (2) 131 #endif 132 133 #define WIFI_OEMINFO_MAC (1) 134 135 #endif