2 * Copyright (C) 2015, 2016 "IoT.bzh"
3 * Author "Fulup Ar Foll"
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.
23 #include <json-c/json.h>
25 #include <afb/afb-binding.h>
27 extern const struct afb_binding_interface *interface;
32 struct afb_event event;
36 /* searchs the event of tag */
37 struct event *event_get(const char *tag);
39 /* deletes the event of tag */
40 int event_del(const char *tag);
42 /* creates the event of tag */
43 int event_add(const char *tag, const char *name);
45 int event_subscribe(struct afb_req request, const char *tag);
47 int event_unsubscribe(struct afb_req request, const char *tag);
49 int event_push(struct json_object *args, const char *tag);
51 void pingSample (struct afb_req request);
53 void pingFail (struct afb_req request);
55 void pingNull (struct afb_req request);
57 void pingBug (struct afb_req request);
59 void pingEvent(struct afb_req request);
61 // For samples https://linuxprograms.wordpress.com/2010/05/20/json-c-libjson-tutorial/
62 void pingJson (struct afb_req request);
64 void subcallcb (void *prequest, int iserror, json_object *object);
66 void subcall (struct afb_req request);
68 void eventadd (struct afb_req request);
70 void eventdel (struct afb_req request);
72 void eventsub (struct afb_req request);
74 void eventunsub (struct afb_req request);
76 void eventpush (struct afb_req request);