• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2008 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 _TIWLAN_EVENT_LISTENER_H__
18 #define _TIWLAN_EVENT_LISTENER_H__
19 
20 #include <sysutils/SocketListener.h>
21 
22 struct wpa_ctrl;
23 class SocketClient;
24 class ITiwlanEventHandler;
25 class TiwlanEventFactory;
26 
27 class TiwlanEventListener: public SocketListener {
28 
29 public:
30     TiwlanEventListener(int sock);
~TiwlanEventListener()31     virtual ~TiwlanEventListener() {}
32 
33 protected:
34     virtual bool onDataAvailable(SocketClient *c);
35 };
36 
37 // TODO: Move all this crap into a factory
38 #define TI_DRIVER_MSG_PORT 9001
39 
40 #define IPC_EVENT_LINK_SPEED  2
41 #define IPC_EVENT_LOW_SNR     13
42 #define IPC_EVENT_LOW_RSSI    14
43 
44 struct ipc_ev_data {
45     uint32_t event_type;
46     void     *event_id;
47     uint32_t process_id;
48     uint32_t delivery_type;
49     uint32_t user_param;
50     void     *event_callback;
51     uint32_t bufferSize;
52     uint8_t  buffer[2048];
53 };
54 
55 #endif
56