2 * Copyright (C) 2016, 2017 "IoT.bzh"
3 * Author: José Bollo <jose.bollo@iot.bzh>
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
24 struct afb_evt_listener;
25 struct afb_binding_data_v2;
30 * Structure for recording service
37 /* session of the service */
38 struct afb_session *session;
40 /* the apiset for the service */
41 struct afb_apiset *apiset;
43 /* event listener of the service or NULL */
44 struct afb_evt_listener *listener;
46 /* on event callback for the service */
47 void (*on_event)(const char *event, struct json_object *object);
53 extern void afb_svc_destroy(struct afb_svc *svc, struct afb_service *service);
55 extern struct afb_svc *afb_svc_create(
57 struct afb_apiset *apiset,
59 void (*on_event)(const char *event, struct json_object *object),
60 struct afb_service *service);
62 extern int afb_svc_start_v1(struct afb_svc *svc, int (*start)(struct afb_service));
63 extern int afb_svc_start_v2(struct afb_svc *svc, int (*start)());
65 extern void afb_svc_update_hook(struct afb_svc *svc);