mirror of
https://gitee.com/openharmony/communication_wifi.git
synced 2025-01-17 05:03:05 +00:00
fix
Signed-off-by: fengye <fengye10@huawei.com>
This commit is contained in:
parent
036fe6a988
commit
52fb2892b7
@ -27,6 +27,20 @@ WifiDeviceCallBackStub::WifiDeviceCallBackStub() : callback_(nullptr), mRemoteDi
|
||||
WifiDeviceCallBackStub::~WifiDeviceCallBackStub()
|
||||
{}
|
||||
|
||||
int WifiDeviceCallBackStub::OnRemoteInterfaceToken(IpcIo *data)
|
||||
{
|
||||
size_t length;
|
||||
uint16_t* interfaceRead = nullptr;
|
||||
interfaceRead = ReadInterfaceToken(data, &length);
|
||||
for (size_t i = 0; i < length; i++) {
|
||||
if (i >= DECLARE_INTERFACE_DESCRIPTOR_L1_LENGTH || interfaceRead[i] != DECLARE_INTERFACE_DESCRIPTOR_L1[i]) {
|
||||
WIFI_LOGE("Sta stub token verification error: %{public}d", code);
|
||||
return WIFI_OPT_FAILED;
|
||||
}
|
||||
}
|
||||
return WIFI_OPT_SUCCESS;
|
||||
}
|
||||
|
||||
int WifiDeviceCallBackStub::OnRemoteRequest(uint32_t code, IpcIo *data)
|
||||
{
|
||||
int ret = WIFI_OPT_FAILED;
|
||||
@ -37,16 +51,9 @@ int WifiDeviceCallBackStub::OnRemoteRequest(uint32_t code, IpcIo *data)
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t length;
|
||||
uint16_t* interfaceRead = nullptr;
|
||||
interfaceRead = ReadInterfaceToken(data, &length);
|
||||
for (size_t i = 0; i < length; i++) {
|
||||
if (i >= DECLARE_INTERFACE_DESCRIPTOR_L1_LENGTH || interfaceRead[i] != DECLARE_INTERFACE_DESCRIPTOR_L1[i]) {
|
||||
WIFI_LOGE("Sta stub token verification error: %{public}d", code);
|
||||
return WIFI_OPT_FAILED;
|
||||
}
|
||||
if (OnRemoteInterfaceToken(data) == WIFI_OPT_FAILED) {
|
||||
return WIFI_OPT_FAILED;
|
||||
}
|
||||
|
||||
int exception = WIFI_OPT_FAILED;
|
||||
(void)ReadInt32(data, &exception);
|
||||
if (exception) {
|
||||
|
@ -38,6 +38,7 @@ public:
|
||||
void SetRemoteDied(bool val);
|
||||
|
||||
private:
|
||||
int OnRemoteInterfaceToken(IpcIo *data);
|
||||
int RemoteOnWifiStateChanged(uint32_t code, IpcIo *data);
|
||||
int RemoteOnWifiConnectionChanged(uint32_t code, IpcIo *data);
|
||||
int RemoteOnWifiRssiChanged(uint32_t code, IpcIo *data);
|
||||
|
@ -52,7 +52,7 @@ int WifiScanStub::OnRemoteRequest(uint32_t code, IpcIo *req, IpcIo *reply)
|
||||
WIFI_LOGE("req:%{public}d, reply:%{public}d", req == nullptr, reply == nullptr);
|
||||
return ERR_FAILED;
|
||||
}
|
||||
if(CheckInterfaceToken(req) == WIFI_OPT_FAILED) {
|
||||
if (CheckInterfaceToken(req) == WIFI_OPT_FAILED) {
|
||||
return WIFI_OPT_FAILED;
|
||||
}
|
||||
int exception = ERR_FAILED;
|
||||
|
Loading…
x
Reference in New Issue
Block a user