summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2017-08-14 19:45:43 +0530
committerNiraj Kumar Goit <niraj.g@samsung.com>2017-08-16 17:01:22 +0530
commitcf6aa0ecbb0b0fe5c06bd5fc87eaa58e2ab47573 (patch)
tree54898c6d015c6fb9743d16b45076329b8b47482a /src/device.c
parentb5fc09779a7aa3173b926e901e954d7246832b46 (diff)
downloadconnman-cf6aa0ecbb0b0fe5c06bd5fc87eaa58e2ab47573.tar.gz
connman-cf6aa0ecbb0b0fe5c06bd5fc87eaa58e2ab47573.tar.bz2
connman-cf6aa0ecbb0b0fe5c06bd5fc87eaa58e2ab47573.zip
[connman]Added DBus method for wifi Specific AP Scan.submit/tizen/20170817.042132accepted/tizen/unified/20170818.000126
Change-Id: Ib8f446164242caeb7fbc29c2917eff4b8a5b8bf7 Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Diffstat (limited to 'src/device.c')
-rwxr-xr-xsrc/device.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index aff0fa93..acd68da4 100755
--- a/src/device.c
+++ b/src/device.c
@@ -1077,6 +1077,73 @@ void connman_device_regdom_notify(struct connman_device *device,
__connman_technology_notify_regdom_by_device(device, result, alpha2);
}
+#if defined TIZEN_EXT
+static int device_specific_scan(enum connman_service_type type,
+ struct connman_device *device,
+ int scan_type, GSList *specific_scan_list)
+{
+ if (!device->driver || !device->driver->specific_scan)
+ return -EOPNOTSUPP;
+
+ if (!device->powered)
+ return -ENOLINK;
+
+ return device->driver->specific_scan(type, device, scan_type,
+ specific_scan_list, NULL);
+}
+
+int __connman_device_request_specific_scan(enum connman_service_type type,
+ int scan_type, GSList *specific_scan_list)
+{
+ bool success = false;
+ int last_err = -ENOSYS;
+ GSList *list;
+ int err;
+
+ switch (type) {
+ case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_ETHERNET:
+ case CONNMAN_SERVICE_TYPE_BLUETOOTH:
+ case CONNMAN_SERVICE_TYPE_CELLULAR:
+ case CONNMAN_SERVICE_TYPE_GPS:
+ case CONNMAN_SERVICE_TYPE_VPN:
+ case CONNMAN_SERVICE_TYPE_GADGET:
+ return -EOPNOTSUPP;
+ case CONNMAN_SERVICE_TYPE_WIFI:
+ case CONNMAN_SERVICE_TYPE_P2P:
+ break;
+ }
+
+ for (list = device_list; list; list = list->next) {
+ struct connman_device *device = list->data;
+ enum connman_service_type service_type =
+ __connman_device_get_service_type(device);
+
+ if (service_type != CONNMAN_SERVICE_TYPE_UNKNOWN) {
+ if (type == CONNMAN_SERVICE_TYPE_P2P) {
+ if (service_type != CONNMAN_SERVICE_TYPE_WIFI)
+ continue;
+ } else if (service_type != type)
+ continue;
+ }
+
+ err = device_specific_scan(type, device, scan_type, specific_scan_list);
+ if (err == 0 || err == -EALREADY || err == -EINPROGRESS) {
+ success = true;
+ } else {
+ last_err = err;
+ DBG("device %p err %d", device, err);
+ }
+ }
+
+ if (success)
+ return 0;
+
+ return last_err;
+}
+#endif
+
int __connman_device_request_scan(enum connman_service_type type)
{
bool success = false;