1 /* 2 * Copyright (c) 2021 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 16 #ifndef HDI_SAMPLE_CLIENT_C_INF_H 17 #define HDI_SAMPLE_CLIENT_C_INF_H 18 19 #include <osal_mem.h> 20 #include "wifi_hal.h" 21 #include "wifi_hal_ap_feature.h" 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif /* __cplusplus */ 26 struct HdfSBuf; 27 28 struct WlanFeatureInfo { 29 char *ifName; 30 int32_t wlanType; 31 }; 32 33 struct IWifiInterface { 34 struct HdfRemoteService *remote; 35 36 int32_t (*construct)(struct IWifiInterface *self); 37 int32_t (*destruct)(struct IWifiInterface *self); 38 int32_t (*start)(struct IWifiInterface *self); 39 int32_t (*stop)(struct IWifiInterface *self); 40 int32_t (*getSupportFeature)(struct IWifiInterface *self, uint8_t *supType); 41 int32_t (*getSupportCombo)(struct IWifiInterface *self, uint64_t *combo); 42 int32_t (*createFeature)(struct IWifiInterface *self, const int32_t type, struct WlanFeatureInfo **ifeature); 43 int32_t (*getFeatureByIfName)(struct IWifiInterface *self, const char *ifName, struct WlanFeatureInfo **ifeature); 44 int32_t (*registerEventCallback)(struct IWifiInterface *self, CallbackFunc cbFunc); 45 int32_t (*unregisterEventCallback)(struct IWifiInterface *self); 46 int32_t (*destroyFeature)(struct IWifiInterface *self, struct WlanFeatureInfo *ifeature); 47 int32_t (*resetDriver)(struct IWifiInterface *self, const uint8_t chipId); 48 int32_t (*getAsscociatedStas)(struct IWifiInterface *self, const struct WlanFeatureInfo *ifeature, 49 struct StaInfo *staInfo, uint32_t count, uint32_t *num); 50 int32_t (*setCountryCode)(struct IWifiInterface *self, const struct WlanFeatureInfo *ifeature, const char *code, 51 uint32_t len); 52 int32_t (*getNetworkIfaceName)(struct IWifiInterface *self, struct WlanFeatureInfo *ifeature); 53 int32_t (*getFeatureType)(struct IWifiInterface *self, struct WlanFeatureInfo *ifeature); 54 int32_t (*setMacAddress)(struct IWifiInterface *self, const struct WlanFeatureInfo *ifeature, unsigned char *mac, 55 uint8_t len); 56 int32_t (*getDeviceMacAddress)(struct IWifiInterface *self, const struct WlanFeatureInfo *ifeature, 57 unsigned char *mac, uint8_t len); 58 int32_t (*getFreqsWithBand)(struct IWifiInterface *self, const struct WlanFeatureInfo *ifeature, int32_t band, 59 int32_t *freqs, uint32_t count, uint32_t *num); 60 int32_t (*setTxPower)(struct IWifiInterface *self, const struct WlanFeatureInfo *ifeature, int32_t power); 61 int32_t (*getChipId)(struct IWifiInterface *self, const struct WlanFeatureInfo *ifeature, uint8_t *chipId); 62 int32_t (*getIfNamesByChipId)(struct IWifiInterface *self, const uint8_t chipId, char **ifNames, uint32_t *num); 63 int32_t (*setScanningMacAddress)(struct IWifiInterface *self, const struct WlanFeatureInfo *ifeature, 64 unsigned char *scanMac, uint8_t len); 65 int32_t (*getNetDevInfo)(struct IWifiInterface *self, struct NetDeviceInfoResult *netDeviceInfoResult); 66 int32_t (*startScan)(struct IWifiInterface *self, const struct WlanFeatureInfo *ifeature, WifiScan *scan); 67 }; 68 69 struct IWifiInterface *HdIWifiInterfaceGet(const char *serviceName); 70 71 void HdIWifiInterfaceRelease(struct IWifiInterface *instance); 72 73 int32_t CallbackWlanProxy(uint32_t eventId, void *data, const char *ifName); 74 75 #ifdef __cplusplus 76 } 77 #endif /* __cplusplus */ 78 79 #endif // HDI_SAMPLE_CLIENT_C_INF_H