Home | History | Annotate | Download | only in wifi_hal
      1 /*
      2  * Copyright (C) 2014 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *     http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef __WIFI_HAL_GSCAN_EVENT_HANDLE_H__
     18 #define __WIFI_HAL_GSCAN_EVENT_HANDLE_H__
     19 
     20 #include "common.h"
     21 #include "cpp_bindings.h"
     22 #include "gscancommand.h"
     23 
     24 #ifdef __cplusplus
     25 extern "C"
     26 {
     27 #endif /* __cplusplus */
     28 
     29 class GScanCommandEventHandler: public WifiVendorCommand
     30 {
     31 private:
     32     // TODO: derive 3 other command event handler classes from this base and separate
     33     // the data member vars
     34     wifi_scan_result *mHotlistApFoundResults;
     35     u32 mHotlistApFoundNumResults;
     36     bool mHotlistApFoundMoreData;
     37     wifi_significant_change_result **mSignificantChangeResults;
     38     u32 mSignificantChangeNumResults;
     39     bool mSignificantChangeMoreData;
     40     GScanCallbackHandler mHandler;
     41     int mRequestId;
     42     /* Needed because mSubcmd gets overwritten in
     43      * WifiVendorCommand::handleEvent()
     44      */
     45     u32 mSubCommandId;
     46 
     47 public:
     48     GScanCommandEventHandler(wifi_handle handle, int id, u32 vendor_id,
     49                                     u32 subcmd, GScanCallbackHandler nHandler);
     50     virtual ~GScanCommandEventHandler();
     51     virtual int create();
     52     virtual int get_request_id();
     53     virtual int handleEvent(WifiEvent &event);
     54 };
     55 
     56 #ifdef __cplusplus
     57 }
     58 #endif /* __cplusplus */
     59 #endif
     60