4 * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef __RESOURCE_ADAPTOR_H__
21 #define __RESOURCE_ADAPTOR_H__
24 #define API __attribute__ ((visibility("default")))
35 #include "service_adaptor_errors.h"
38 * @file resource_adaptor.h
48 * \#include <resource_adaptor.h>
55 * @brief Handle of Resource Plugin
57 typedef struct resource_plugin_s *resource_plugin_h;
60 * @brief Describes infromation about SmartThings Service
61 * @key access token, ...
63 typedef struct _resource_plugin_smartthings_service_s
65 int (*smartthings_get_resource)(resource_plugin_h plugin, char **resource_uri, void *user_data);
66 } resource_plugin_smartthings_service_s;
67 typedef struct resource_plugin_smartthings_service_s *resource_plugin_smartthings_service_h;
70 * @brief Describes infromation about Resource Plugin
72 typedef struct _resource_plugin_s
77 resource_plugin_smartthings_service_h smartthings;
84 * @brief Describes infromation about Resource Adaptor
86 typedef struct _resource_adaptor_s
88 GList *plugins; // resource_plugin_h
93 typedef struct resource_adaptor_s *resource_adaptor_h;
96 * @brief Describes infromation about Resource Adaptor Listener
98 typedef struct _resource_adaptor_listener_s
100 void (*login_cb)(char *uri, void *user_data);
101 } resource_adaptor_listener_s;
102 typedef struct resource_adaptor_listener_s *resource_adaptor_listener_h;
104 resource_adaptor_h resource_adaptor_create();
105 service_adaptor_error_e resource_adaptor_destroy(resource_adaptor_h resource);
106 service_adaptor_error_e resource_adaptor_start(resource_adaptor_h resource);
107 service_adaptor_error_e resource_adaptor_stop(resource_adaptor_h resource);
108 service_adaptor_error_e resource_adaptor_register_listener(resource_adaptor_h resource, resource_adaptor_listener_h listener);
109 service_adaptor_error_e resource_adaptor_unregister_listener(resource_adaptor_h resource, resource_adaptor_listener_h listener);
119 #endif /* __RESOURCE_ADAPTOR_H__ */