OSDN Git Service

Add AIDL defining AP and client interfaces
authorChristopher Wiley <wiley@google.com>
Wed, 8 Jun 2016 22:44:55 +0000 (15:44 -0700)
committerChristopher Wiley <wiley@google.com>
Wed, 8 Jun 2016 22:48:32 +0000 (15:48 -0700)
Right now, we don't actually implement any of these classes.

Bug: 29218284
Test: Compiles, integration, unittests complete

Change-Id: Ib2a507a21f1c7366e7eec0c02494b7edd3bbf3fa

Android.mk
aidl/android/net/wifi/IApInterface.aidl [new file with mode: 0644]
aidl/android/net/wifi/IChip.aidl
aidl/android/net/wifi/IChipCallback.aidl [new file with mode: 0644]
aidl/android/net/wifi/IClientInterface.aidl [new file with mode: 0644]

index a93572b..0e5c28c 100644 (file)
@@ -26,6 +26,10 @@ LOCAL_CPPFLAGS := $(wificond_cpp_flags)
 LOCAL_INIT_RC := wificond.rc
 LOCAL_AIDL_INCLUDES += $(LOCAL_PATH)/aidl
 LOCAL_SRC_FILES := \
+    aidl/android/net/wifi/IApInterface.aidl \
+    aidl/android/net/wifi/IChip.aidl \
+    aidl/android/net/wifi/IChipCallback.aidl \
+    aidl/android/net/wifi/IClientInterface.aidl \
     aidl/android/net/wifi/IWificond.aidl \
     main.cpp \
     server.cpp
diff --git a/aidl/android/net/wifi/IApInterface.aidl b/aidl/android/net/wifi/IApInterface.aidl
new file mode 100644 (file)
index 0000000..f76610c
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.wifi;
+
+// IApInterface represents a network interface configured to act as a
+// WiFi access point.
+interface IApInterface {
+
+}
index deebc97..f4bf3b4 100644 (file)
 
 package android.net.wifi;
 
+import android.net.wifi.IApInterface;
+import android.net.wifi.IChipCallback;
+import android.net.wifi.IClientInterface;
+
 // IChip represents a particular chip attached to the host.  Generally,
 // chips have a set of capabilities which determine the ways they can
 // be configured.  To use the functionality of a chip, request an interface
@@ -23,4 +27,48 @@ package android.net.wifi;
 // configured with multiple interfaces at once.
 interface IChip {
 
+  // Register an object to receive chip status updates.
+  //
+  // Multiple callbacks can be registered simultaneously.
+  // Duplicate registrations of the same callback will be ignored.
+  //
+  // @param callback object to add to the set of registered callbacks.
+  oneway void RegisterCallback(IChipCallback callback);
+
+  // Remove a callback from the set of registered callbacks.
+  //
+  // This must be the same instance as previously registered.
+  // Requests to remove unknown callbacks will be ignored.
+  //
+  // @param callback object to remove from the set of registered callbacks.
+  oneway void UnregisterCallback(IChipCallback callback);
+
+  // Request that the chip be configured to expose a new client interface.
+  //
+  // The success or failure of this request will be indicated to registered
+  // IChipCallback objects.
+  // The returned request id is unique over the lifetime of this instance
+  // of wificond.  Note that a wificond restart may recycle old ids.
+  //
+  // @return request id to be used to match interface requests to creation
+  //         events.
+  int ConfigureClientInterface();
+
+  // Request that the chip be configured to expose a new AP interface.
+  //
+  // The success or failure of this request will be indicated to registered
+  // IChipCallback objects.
+  // The returned request id is unique over the lifetime of this instance
+  // of wificond.  Note that a wificond restart may recycle old ids.
+  //
+  // @return unique request id to be used to match interface requests to
+  //         creation events.
+  int ConfigureApInterface();
+
+  // @return list of the currently configured IClientInterface instances.
+  List<IBinder> GetClientInterfaces();
+
+  // @return list of the currently configured IApInterface instances.
+  List<IBinder> GetApInterfaces();
+
 }
diff --git a/aidl/android/net/wifi/IChipCallback.aidl b/aidl/android/net/wifi/IChipCallback.aidl
new file mode 100644 (file)
index 0000000..089b0bc
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.wifi;
+
+import android.net.wifi.IApInterface;
+import android.net.wifi.IClientInterface;
+
+// A callback for receiving events related to this chip.
+interface IChipCallback {
+
+  // Signals that the provided interface is ready for future commands.
+  oneway void OnClientInterfaceReady(
+      int request_id,
+      IClientInterface network_interface);
+  oneway void OnApInterfaceReady(
+      int request_id,
+      IApInterface network_interface);
+
+  // Signals that an interface torn down or that tear down has started.
+  //
+  // If |is_torn_down| is false, tear down has begun, but has not completed.
+  // If |is_torn_down| is true, no future callbacks will be delivered
+  // via this callback, and the callback is automatically unregistered.
+  //
+  // @param is_torn_down true if the interface is completely gone.
+  oneway void OnClientTeardownEvent(
+      IClientInterface network_interface,
+      boolean is_torn_down);
+  oneway void OnApTeardownEvent(
+      IClientInterface network_interface,
+      boolean is_torn_down);
+
+  const int CONFIGURE_ERROR_UNSUPPORTED_MODE = -1;
+  const int CONFIGURE_ERROR_UNSUPPORTED_CONFIGURATION = -2;
+  const int CONFIGURE_ERROR_CONFLICTING_REQUEST = -3;
+
+  // Signals that an IChip.ConfigureClientInterface() call failed.
+  //
+  // This event indicates that the configuration request failed and no
+  // new interface was created.
+  //
+  // @param error_code one of CONFIGURE_ERROR_* defined above.
+  // @param message a helpful message suitable for logging.
+  oneway void OnInvalidConfigureRequest(
+      int request_id,
+      int error_code,
+      String message);
+
+}
diff --git a/aidl/android/net/wifi/IClientInterface.aidl b/aidl/android/net/wifi/IClientInterface.aidl
new file mode 100644 (file)
index 0000000..24fb08e
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.wifi;
+
+// IClientInterface represents a network interface that can be used to connect
+// to access points and obtain internet connectivity.
+interface IClientInterface {
+
+}