Add device capability and get authenticated device list
[platform/core/system/edge-orchestration.git] / libedge-orchestration / inc / orchestration_client.h
1 /*******************************************************************************
2  * Copyright 2019 Samsung Electronics All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  *******************************************************************************/
17
18 #ifndef __ORCHESTRATION_CLIENT_H__
19 #define __ORCHESTRATION_CLIENT_H__
20
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif
25
26 #include <stdbool.h>
27
28 typedef enum
29 {
30     ORCH_CLIENT_ERROR_NONE = 0,
31     ORCH_CLIENT_ERROR_INVALID_PARAMETER,
32     ORCH_CLIENT_ERROR_FAULT,
33 } orchestration_client_state_e;
34
35 typedef enum
36 {
37     ORCHESTRATION_SERVICE_STATUS_STARTED = 0,
38     ORCHESTRATION_SERVICE_STATUS_COMPLETED,
39     ORCHESTRATION_SERVICE_STATUS_FAILED,
40     ORCHESTRATION_SERVICE_STATUS_UNDEFINED_ERROR,
41 } orchestration_service_status_e;
42
43 #define MAX_SVC_INFO_NUM 3
44 typedef struct
45 {
46     char *exec_type;
47     char *exec_parameter;
48 } service_info_s;
49
50 typedef struct
51 {
52     int count;
53     service_info_s services[MAX_SVC_INFO_NUM];
54 } orchestration_service_info_s;
55
56 typedef struct
57 {
58     char **ipaddr;
59     int num_ip;
60     char *message;
61 } orchestration_devicelist_s;
62
63 typedef struct
64 {
65     char *capability;
66     char *message;
67 } orchestration_device_capability_s;
68
69 typedef void (*orchestration_changed_service_status_cb)(orchestration_service_status_e staus, void *user_data);
70
71 orchestration_client_state_e orchestration_get_devicelist(char *service_name,
72                                                 char *exec_type,
73                                                 orchestration_devicelist_s** deviceList);
74
75 orchestration_client_state_e orchestration_read_capability(char *ip, orchestration_device_capability_s **device_capability);
76
77 orchestration_client_state_e orchestration_write_capability(char *capability);
78
79 orchestration_client_state_e orchestration_request_service(char *app_name,
80                                                 bool self_select,
81                                                 orchestration_service_info_s service_info,
82                                                 orchestration_changed_service_status_cb cb,
83                                                 void *user_data);
84
85 orchestration_client_state_e orchestration_request_service_on_device(char *app_name,
86                                                 bool self_select,
87                                                 orchestration_service_info_s service_info,
88                                                 char *ip,
89                                                 orchestration_changed_service_status_cb cb,
90                                                 void *user_data);
91
92 #ifdef __cplusplus
93 }
94 #endif
95
96 #endif /* __ORCHESTRATION_CLIENT_H__ */
97