1 /* 2 * Copyright (c) 2020 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 HAL_WIFIAWARE_H 17 #define HAL_WIFIAWARE_H 18 19 #ifdef __cplusplus 20 #if __cplusplus 21 extern "C" { 22 #endif 23 #endif /* __cplusplus */ 24 25 enum { 26 HAL_WIFI_SDP_PUBLISH = 0x01, 27 HAL_WIFI_SDP_SUBSCRIBE = 0x02, 28 HAL_WIFI_SDP_BUTT 29 }; 30 31 typedef int (*HalRecvCallback)(unsigned char* macAddr, unsigned char peerHandle, unsigned char localHandle, 32 unsigned char* msg, unsigned char len); 33 34 int HalWifiSdpInit(const char* ifname); 35 36 unsigned int HalCipherHashSha256(const char* input, unsigned int inputLen, unsigned char* hash, unsigned hashLen); 37 38 int HalWifiSdpStartService(const char* svcName, unsigned char localHandle, HalRecvCallback recvCB, unsigned char role); 39 40 int HalWifiSdpSend(unsigned char* macAddr, unsigned char peerHandle, unsigned char localHandle, 41 unsigned char* msg, int len); 42 43 int HalWifiSdpStopService(unsigned char localHandle, unsigned char role); 44 45 int HalWifiSdpDeinit(void); 46 47 int HalWifiSdpAdjustTxPower(const char *ifname, signed char power); 48 49 int HalWifiSdpRestoreTxPower(const char *ifname); 50 51 int HalWifiSdpBeaconSwitch(const char *ifname, unsigned char enable); 52 53 int HalWifiSdpSetRetryTimes(unsigned int retries); 54 55 int HalWifiSdpGetSyncMode(void); 56 57 #ifdef __cplusplus 58 #if __cplusplus 59 } 60 #endif 61 #endif /* __cplusplus */ 62 63 #endif // HAL_WIFIAWARE_H