iwd_dbus watches net.connman.iwd name ownership, calls GetManagedObjects, and dispatches InterfacesAdded/Removed to a callback consumer. iwd_manager owns hashes of Iwd_Device and Iwd_Network keyed by object path; sub-objects subscribe to their PropertiesChanged signals via Eldbus and ping the manager so listeners can refresh. Aggregated state (off/idle/scanning/ connecting/connected) is recomputed from the active station. iwd_device exposes Powered toggle plus Station Scan/Disconnect. iwd_network calls Network.Connect() (the iwd Agent will be wired in next) and Forget via the referenced KnownNetwork object. Builds against EFL 1.28 / Enlightenment 0.27. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
#ifndef IWD_MANAGER_H
|
|
#define IWD_MANAGER_H
|
|
|
|
#include <Eldbus.h>
|
|
#include <Eina.h>
|
|
|
|
typedef enum {
|
|
IWD_STATE_OFF,
|
|
IWD_STATE_IDLE,
|
|
IWD_STATE_SCANNING,
|
|
IWD_STATE_CONNECTING,
|
|
IWD_STATE_CONNECTED,
|
|
IWD_STATE_ERROR,
|
|
} Iwd_State;
|
|
|
|
typedef struct _Iwd_Manager Iwd_Manager;
|
|
|
|
Iwd_Manager *iwd_manager_new (Eldbus_Connection *conn);
|
|
void iwd_manager_free(Iwd_Manager *m);
|
|
|
|
Iwd_State iwd_manager_state (const Iwd_Manager *m);
|
|
|
|
/* Hash<path, Iwd_Device*> */
|
|
const Eina_Hash *iwd_manager_devices (const Iwd_Manager *m);
|
|
/* Hash<path, Iwd_Network*> */
|
|
const Eina_Hash *iwd_manager_networks(const Iwd_Manager *m);
|
|
|
|
void iwd_manager_scan_request (Iwd_Manager *m);
|
|
void iwd_manager_set_powered (Iwd_Manager *m, Eina_Bool on);
|
|
|
|
typedef void (*Iwd_Manager_Cb)(void *data, Iwd_Manager *m);
|
|
void iwd_manager_listener_add (Iwd_Manager *m, Iwd_Manager_Cb cb, void *data);
|
|
void iwd_manager_listener_del (Iwd_Manager *m, Iwd_Manager_Cb cb, void *data);
|
|
|
|
/* Internal: invoked by sub-objects when their state changes. */
|
|
void iwd_manager_notify (Iwd_Manager *m);
|
|
|
|
#endif
|