Handle device found callback
[platform/core/connectivity/ua-plugin-wifi-location.git] / include / wifi-location-plugin.h
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * @author: Abhay Agarwal <ay.agarwal@samsung.com>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License")
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef __WIFI_LOCATION_PLUGIN_H__
21 #define __WIFI_LOCATION_PLUGIN_H__
22
23 #include <ua-plugin.h>
24 #include "wifi-location.h"
25
26 #include "log.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #define PLUGIN_ID UAS_PLUGIN_ID_WIFI_LOCATION
33 #define UAS_DEVICE_ID_MAX_LEN 50
34 #define MAC_ADDRESS_MAX_LEN 18
35
36 typedef struct {
37         int user_id; /**< User id */
38         int os; /**< OS type */
39         char device_id[UAS_DEVICE_ID_MAX_LEN]; /**< Mobile ID */
40         char mac_addr[MAC_ADDRESS_MAX_LEN]; /**< Mac address */
41         gboolean presence_reported; /**< Presence reported or not */
42         gboolean discriminant; /**< Weather to check or not */
43         int distance_mm; /** Distance of the device */
44 } uas_wifi_location_info_t;
45
46 int _wifi_location_plugin_initialize(void);
47
48 int _wifi_location_plugin_deinitialize(void);
49
50 gboolean _wifi_location_plugin_add_device(gpointer data);
51
52 int _wifi_location_plugin_start_scan(int scan_mode);
53
54 int _wifi_location_plugin_stop_scan(void);
55
56 void _wifi_location_plugin_handle_device_added(int status,
57                 uas_wifi_location_info_t *wifi_location_info);
58
59 void _wifi_location_plugin_handle_device_found(
60                         const char *address, int distance_mm);
61
62 #ifdef __cplusplus
63 }
64 #endif
65 #endif /* __WIFI_LOCATION_PLUGIN_H__*/