X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fdevice.h;h=a82d08db3b58583a8df455c8d15b8209bbfba496;hb=4dd2ab274860714b88a2c8c84dee7f024760067e;hp=acf90c7850bf7df0aeefd11b8a8b7e78c5787171;hpb=423d4b077a9ce6539ac623d6dd289409be26894f;p=framework%2Fconnectivity%2Fconnman.git diff --git a/include/device.h b/include/device.h index acf90c7..a82d08d 100644 --- a/include/device.h +++ b/include/device.h @@ -2,7 +2,7 @@ * * Connection Manager * - * Copyright (C) 2007-2009 Intel Corporation. All rights reserved. + * Copyright (C) 2007-2010 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -41,74 +41,63 @@ enum connman_device_type { CONNMAN_DEVICE_TYPE_WIFI = 2, CONNMAN_DEVICE_TYPE_WIMAX = 3, CONNMAN_DEVICE_TYPE_BLUETOOTH = 4, - CONNMAN_DEVICE_TYPE_GPS = 5, - CONNMAN_DEVICE_TYPE_HSO = 15, - CONNMAN_DEVICE_TYPE_NOZOMI = 16, - CONNMAN_DEVICE_TYPE_HUAWEI = 17, - CONNMAN_DEVICE_TYPE_NOVATEL = 18, + CONNMAN_DEVICE_TYPE_CELLULAR = 5, + CONNMAN_DEVICE_TYPE_GPS = 6, + CONNMAN_DEVICE_TYPE_GADGET = 7, CONNMAN_DEVICE_TYPE_VENDOR = 10000, }; -enum connman_device_mode { - CONNMAN_DEVICE_MODE_UNKNOWN = 0, - CONNMAN_DEVICE_MODE_NETWORK_SINGLE = 1, - CONNMAN_DEVICE_MODE_NETWORK_MULTIPLE = 2, - CONNMAN_DEVICE_MODE_TRANSPORT_IP = 3, -}; +#define CONNMAN_DEVICE_PRIORITY_LOW -100 +#define CONNMAN_DEVICE_PRIORITY_DEFAULT 0 +#define CONNMAN_DEVICE_PRIORITY_HIGH 100 struct connman_device; -extern struct connman_device *connman_device_create(const char *node, +struct connman_device *connman_device_create(const char *node, enum connman_device_type type); -extern struct connman_device *connman_device_ref(struct connman_device *device); -extern void connman_device_unref(struct connman_device *device); - -extern enum connman_device_type connman_device_get_type(struct connman_device *device); -extern const char *connman_device_get_name(struct connman_device *device); -extern const char *connman_device_get_path(struct connman_device *device); -extern void connman_device_set_index(struct connman_device *device, - int index); -extern int connman_device_get_index(struct connman_device *device); -extern void connman_device_set_interface(struct connman_device *device, - const char *interface); -extern const char *connman_device_get_interface(struct connman_device *device); - -extern void connman_device_set_ident(struct connman_device *device, - const char *ident); - -extern void connman_device_set_mode(struct connman_device *device, - enum connman_device_mode mode); -extern enum connman_device_mode connman_device_get_mode(struct connman_device *device); -extern void connman_device_set_secondary(struct connman_device *device, - connman_bool_t secondary); -extern connman_bool_t connman_device_get_secondary(struct connman_device *device); - -extern int connman_device_set_powered(struct connman_device *device, +struct connman_device *connman_device_ref(struct connman_device *device); +void connman_device_unref(struct connman_device *device); + +enum connman_device_type connman_device_get_type(struct connman_device *device); +void connman_device_set_index(struct connman_device *device, int index); +int connman_device_get_index(struct connman_device *device); +void connman_device_set_interface(struct connman_device *device, + const char *interface); + +void connman_device_set_ident(struct connman_device *device, + const char *ident); +const char *connman_device_get_ident(struct connman_device *device); + +int connman_device_set_powered(struct connman_device *device, connman_bool_t powered); -extern int connman_device_set_carrier(struct connman_device *device, - connman_bool_t carrier); -extern int connman_device_set_scanning(struct connman_device *device, +int connman_device_set_scanning(struct connman_device *device, connman_bool_t scanning); -extern int connman_device_set_disconnected(struct connman_device *device, +void connman_device_reset_scanning(struct connman_device *device); + +int connman_device_set_disconnected(struct connman_device *device, connman_bool_t disconnected); +connman_bool_t connman_device_get_disconnected(struct connman_device *device); -extern int connman_device_set_string(struct connman_device *device, +int connman_device_set_string(struct connman_device *device, const char *key, const char *value); -extern const char *connman_device_get_string(struct connman_device *device, +const char *connman_device_get_string(struct connman_device *device, const char *key); -extern int connman_device_add_network(struct connman_device *device, +int connman_device_add_network(struct connman_device *device, struct connman_network *network); -extern struct connman_network *connman_device_get_network(struct connman_device *device, +struct connman_network *connman_device_get_network(struct connman_device *device, const char *identifier); -extern int connman_device_remove_network(struct connman_device *device, +int connman_device_remove_network(struct connman_device *device, const char *identifier); +void connman_device_remove_all_networks(struct connman_device *device); + +void connman_device_schedule_scan(struct connman_device *device); -extern int connman_device_register(struct connman_device *device); -extern void connman_device_unregister(struct connman_device *device); +int connman_device_register(struct connman_device *device); +void connman_device_unregister(struct connman_device *device); -extern void *connman_device_get_data(struct connman_device *device); -extern void connman_device_set_data(struct connman_device *device, void *data); +void *connman_device_get_data(struct connman_device *device); +void connman_device_set_data(struct connman_device *device, void *data); struct connman_device_driver { const char *name; @@ -118,15 +107,11 @@ struct connman_device_driver { void (*remove) (struct connman_device *device); int (*enable) (struct connman_device *device); int (*disable) (struct connman_device *device); - int (*connect) (struct connman_device *device); - int (*disconnect) (struct connman_device *device); int (*scan) (struct connman_device *device); - int (*join) (struct connman_device *device, - struct connman_network *network); }; -extern int connman_device_driver_register(struct connman_device_driver *driver); -extern void connman_device_driver_unregister(struct connman_device_driver *driver); +int connman_device_driver_register(struct connman_device_driver *driver); +void connman_device_driver_unregister(struct connman_device_driver *driver); #ifdef __cplusplus }