#define DETECTION_WINDOW_DEFAULT 55 /* 55 seconds */
+static const uas_callbacks_t *uas_cbs = NULL;
+static GSList *dev_list = NULL;
+
+static int init(const uas_callbacks_t *callbacks)
+{
+ FUNC_ENTER;
+ int ret = UAS_STATUS_SUCCESS;
+
+ if (!callbacks)
+ return UAS_STATUS_FAIL;
+
+ retv_if(NULL != uas_cbs, UAS_STATUS_ALREADY_DONE);
+
+ /* TODO: Check wifi location system support */
+
+ /* TODO: Initialize wifi-location */
+
+ uas_cbs = callbacks;
+
+ FUNC_EXIT;
+ return ret;
+}
+
+static int deinit(void)
+{
+ FUNC_ENTER;
+ int ret = UAS_STATUS_SUCCESS;
+
+ if (dev_list) {
+ g_slist_free_full(dev_list, g_free);
+ dev_list = NULL;
+ }
+
+ /* TODO: Deinitialize wifi-location */
+ uas_cbs = NULL;
+
+ FUNC_EXIT;
+ return ret;
+}
+
+static int get_state(int *state)
+{
+ FUNC_ENTER;
+ int ret = UAS_STATUS_SUCCESS;
+
+ retv_if(NULL == uas_cbs, UAS_STATUS_NOT_READY);
+ retv_if(NULL == state, UAS_STATUS_FAIL);
+
+ /* TODO: Get wifi-location state */
+ *state = UAS_STATE_READY;
+
+ FUNC_EXIT;
+ return ret;
+}
+
+static int get_capability(uas_capability_e *capability)
+{
+ FUNC_ENTER;
+
+ retv_if(NULL == uas_cbs, UAS_STATUS_NOT_READY);
+ retv_if(NULL == capability, UAS_STATUS_FAIL);
+
+ *capability = UAS_SUPPORT_USER;
+
+ FUNC_EXIT;
+ return UAS_STATUS_SUCCESS;
+}
+
static uas_api_t wifi_location_api = {
- .init = NULL,
- .deinit = NULL,
- .get_state = NULL,
- .get_capability = NULL,
+ .init = init,
+ .deinit = deinit,
+ .get_state = get_state,
+ .get_capability = get_capability,
.set_registered_devices = NULL,
.add_device = NULL,
.remove_device = NULL,