summaryrefslogtreecommitdiff
path: root/popup-wifidirect/include/wfd-app.h
blob: 1299a0554635713bb0b55ba0503181a63b87e41a (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
 * Copyright 2012  Samsung Electronics Co., Ltd
 *
 * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
 * 
 * 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.
 */

/*
 * This file declares wifi direct popup application functions.
 *
 * @file    wfd-app.h
 * @author  Sungsik Jang (sungsik.jang@samsung.com)
 * @version 0.1
 */


#ifndef __WFD_SYS_POPAPP_MAIN_H__
#define __WFD_SYS_POPAPP_MAIN_H__

#include <appcore-efl.h>
#include <Ecore_X.h>
#include <Elementary.h>
#include <appsvc.h>
#include <aul.h>

#define PACKAGE "wifi-direct-popup"
#define EDJ_NAME RESDIR"/edje/wifi-direct-popup.edj"
#define LOCALEDIR "/opt/apps/org.tizen.wifi-direct-popup/res/locale"
#define WFD_POP_STR_MAX_LEN		128

enum
{
    WFD_POP_TIMER_3 = 3,
    WFD_POP_TIMER_10 = 10,
    WFD_POP_TIMER_30 = 30,
    WFD_POP_TIMER_120 = 120,
};

enum
{
    WFD_POP_APRV_CONNECTION_WPS_PUSHBUTTON_REQ,
    WFD_POP_APRV_CONNECTION_WPS_DISPLAY_REQ,
    WFD_POP_APRV_CONNECTION_WPS_KEYPAD_REQ,

    WFD_POP_PROG_CONNECT,
    WFD_POP_PROG_DISCONNECT,
    WFD_POP_PROG_CONNECT_CANCEL,
    WFD_POP_PROG_CONNECT_WITH_PIN,
    WFD_POP_PROG_CONNECT_WITH_KEYPAD,
    WFD_POP_NOTI_CONNECTED,
    WFD_POP_NOTI_DISCONNECTED,

    WFD_POP_FAIL_INIT,
    WFD_POP_FAIL_CONNECT,
    WFD_POP_INCORRECT_PIN,

};

enum
{
    WFD_POP_RESP_OK,
    WFD_POP_RESP_CANCEL,
    WFD_POP_RESP_APRV_CONNECT_PBC_YES = 1,
    WFD_POP_RESP_APRV_CONNECT_DISPLAY_YES,
    WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES,
    WFD_POP_RESP_APRV_CONNECT_NO,
    WFD_POP_RESP_PROG_CONNECT_CANCEL,
    WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK,
    WFD_POP_RESP_APRV_ENTER_PIN_YES,
    WFD_POP_RESP_APRV_ENTER_PIN_NO,
};

typedef struct
{
    int type;
    char text[WFD_POP_STR_MAX_LEN];
    char label1[WFD_POP_STR_MAX_LEN];
    char label2[WFD_POP_STR_MAX_LEN];
    int timeout;
    int resp_data1;
    int resp_data2;
    int data;
} wfd_popup_t;

typedef struct
{
    char ssid[32];
    char mac_address[18];
} wfd_device_info_t;

typedef struct
{
    Evas_Object *win;
    Evas_Object *popup;
    Evas_Object *pin_entry;
    wfd_popup_t *popup_data;
    uint popup_timeout_handle;
    char pin_number[32];
    char peer_mac[18];
    char peer_name[32];
    wfd_device_info_t *discovered_peers;
    int discovered_peer_count;
} wfd_appdata_t;


extern wfd_appdata_t *wfd_get_appdata();
extern void wfd_destroy_popup();
extern void wfd_prepare_popup(int type, void *userdata);

#endif                          /* __WFD_SYS_POPAPP_MAIN_H__ */