summaryrefslogtreecommitdiff
path: root/include/wifi-plugin.h
blob: 4f61ff86bfdc10aee4b0d36a0b646429621e6f75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef __WIFI_PLUGIN_H__
#define __WIFI_PLUGIN_H__

#include <log.h>
#include <stdbool.h>
#include <ua-plugin.h>

#ifdef __cplusplus
extern "C" {
#endif

#define UAS_DEVICE_ID_MAX_LEN 50 /** Max device ID length */
#define MAC_ADDRESS_STRING_SIZE 18 /**< Max MAC address string length */
#define IP_ADDRESS_STRING_SIZE 16 /* Max IPv4 address string length */

typedef enum {
	WIFI_PRESENCE_STATUS_ABSENCE, /**< ABSENCE detected */
	WIFI_PRESENCE_STATUS_PRESENCE, /**< PRESENCE detected */
} wifi_presence_status_e;

typedef struct {
	int user_id; /**< User ID which is saved in DB */
	int os; /**< Operating system type eg) Tizen, Android and iOS */
	char mobile_id[UAS_DEVICE_ID_MAX_LEN]; /**< MObile ID which is saved in DB */
	char mac_addr[MAC_ADDRESS_STRING_SIZE]; /**< MAC address which is saved in DB */
	char ip_addr[IP_ADDRESS_STRING_SIZE]; /**< IP address which is saved in DB */
	int mobile_flag; /**< The order of the target dev. */
	gboolean new_device; /**< Is newly added device ?*/
	unsigned int supported_techs; /**< Operating system type of the target dev. */
	wifi_presence_status_e presence; /**< Detected type (see. wifi_presence_status_e) */
	gboolean discriminant; /**< Weather to check or not */
} uas_wifi_info_t;

void __check_device_found(char *sbuf, char*ip_sbuf);

int __check_mobilelist(void);

void __check_mobile_list_finish(bool is_check);
#ifdef __cplusplus
}
#endif
#endif /* __WIFI_PLUGIN_H__*/