summaryrefslogtreecommitdiff
path: root/tizen/src/ecs/ecs.h
blob: 3458dfaaa5c3c9dac51a8697110850e83419ee00 (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
/*
 * Emulator Control Server
 *
 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
 *
 * Contact:
 *  Chulho Song     <ch81.song@samsung.com>
 *  Jinhyung Choi   <jinh0.choi@samsung.com>
 *  MunKyu Im       <munkyu.im@samsung.com>
 *  Daiyoung Kim    <daiyoung777.kim@samsung.com>
 *  YeongKyoon Lee  <yeongkyoon.lee@samsung.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * Contributors:
 * - S-Core Co., Ltd
 *
 */

#ifndef __ECS_H__
#define __ECS_H__

#include "ecs_internal.h"

#define HOST_LISTEN_ADDR        "127.0.0.1"

#define COMMANDS_TYPE           "type"
#define COMMANDS_DATA           "data"

#define COMMAND_TYPE_INJECTOR   "injector"
#define COMMAND_TYPE_CONTROL    "control"
#define COMMAND_TYPE_MONITOR    "monitor"
#define COMMAND_TYPE_DEVICE     "device"
#define COMMAND_TYPE_TETHERING  "eventcast"

#define MSG_TYPE_SENSOR         "sensor"
#define MSG_TYPE_LOCATION       "location"
#define MSG_TYPE_NFC            "nfc"
#define MSG_TYPE_SIMUL_NFC      "simul_nfc"
#define MSG_TYPE_SDCARD         "sdcard"
#define MSG_TYPE_GUEST          "guest"
#define MSG_TYPE_GUESTIP        "guest_ip"
#define MSG_TYPE_HDS            "hds"
#define MSG_TYPE_PACKAGE        "package"
#define MSG_TYPE_SYSTEM         "system"
#define MSG_TYPE_CAP            "cap"

#define MSG_GROUP_STATUS        15

#define NFC_MAX_BUF_SIZE  4096

typedef struct nfc_msg_info {
    unsigned char client_id;
    unsigned char client_type;
    uint32_t use;
    unsigned char buf[NFC_MAX_BUF_SIZE];
} nfc_msg_info;

int start_ecs(void);
bool is_ecs_running(void);

bool send_msg_to_guest(const char *cmd, int group, int action,
                       char *data, int data_len);

/* System request */
enum ecs_system_action {
    ECS_SYSTEM_ACTION_FORCE_CLOSE,
    ECS_SYSTEM_ACTION_REBOOT
};

void send_shutdown_request(int action);

void make_send_device_ntf(char *cmd, int group, int action, char *data);

bool send_injector_ntf(const char *data, const int len);
bool send_monitor_ntf(const char *data, const int len);
bool send_device_ntf(const char *data, const int len);
bool send_nfc_ntf(struct nfc_msg_info *msg);

/* Suspend-resume */
#define SUSPEND_LOCK   1
#define SUSPEND_UNLOCK 0
int ecs_get_suspend_state(void);
void ecs_set_suspend_state(int state);
void ecs_suspend_lock_state(int state);

/* Device capabilities check */
const char* ecs_get_device_capabilities(void);
void ecs_set_device_capabilities(const char* cap);

#endif /* __ECS_H__ */