summaryrefslogtreecommitdiffstats
path: root/src/af-steering-wheel-binding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/af-steering-wheel-binding.c')
-rw-r--r--src/af-steering-wheel-binding.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/af-steering-wheel-binding.c b/src/af-steering-wheel-binding.c
index 908bf71..8b75175 100644
--- a/src/af-steering-wheel-binding.c
+++ b/src/af-steering-wheel-binding.c
@@ -131,7 +131,7 @@ static int connection(struct wheel_conf *conf)
/**
* get method.
*/
-static void get(struct afb_req req)
+static void get(afb_req_t req)
{
}
@@ -161,7 +161,7 @@ static void _listup_properties(struct prop_info_t *property_info)
}
}
-static void list(struct afb_req req)
+static void list(afb_req_t req)
{
if (tmplists != NULL)
{
@@ -171,19 +171,19 @@ static void list(struct afb_req req)
if (tmplists == NULL)
{
ERRMSG("not enough memory");
- afb_req_fail(req,"not enough memory", NULL);
+ afb_req_reply(req, NULL, "not enough memory", NULL);
return;
}
(void)canid_walker(_listup_properties);
- afb_req_success(req, tmplists, NULL);
+ afb_req_reply(req, tmplists, NULL, NULL);
}
/**
* subscribe method.
*/
-static int subscribe_all(struct afb_req req, struct json_object *apply);
+static int subscribe_all(afb_req_t req, struct json_object *apply);
-static int subscribe_signal(struct afb_req req, const char *name, struct json_object *apply)
+static int subscribe_signal(afb_req_t req, const char *name, struct json_object *apply)
{
struct bind_event_t *event;
@@ -218,7 +218,7 @@ static int subscribe_signal(struct afb_req req, const char *name, struct json_o
return 0;
}
-static int subscribe_all(struct afb_req req, struct json_object *apply)
+static int subscribe_all(afb_req_t req, struct json_object *apply)
{
int i;
int nProp;
@@ -230,7 +230,7 @@ static int subscribe_all(struct afb_req req, struct json_object *apply)
return err;
}
-static void subscribe(struct afb_req req)
+static void subscribe(afb_req_t req)
{
struct json_object *apply;
int err = 0;
@@ -240,7 +240,7 @@ static void subscribe(struct afb_req req)
if (event == NULL)
{
ERRMSG("Unknwon subscrive event args");
- afb_req_fail(req, "error", NULL);
+ afb_req_reply(req, NULL, "error", NULL);
return;
}
apply = json_object_new_object();
@@ -248,12 +248,12 @@ static void subscribe(struct afb_req req)
if (!err)
{
- afb_req_success(req, apply, NULL);
+ afb_req_reply(req, apply, NULL, NULL);
}
else
{
json_object_put(apply);
- afb_req_fail(req, "error", NULL);
+ afb_req_reply(req, NULL, "error", NULL);
}
}
@@ -261,9 +261,9 @@ static void subscribe(struct afb_req req)
* unsubscribe method.
*/
-static int unsubscribe_all(struct afb_req req);
+static int unsubscribe_all(afb_req_t req);
-static int unsubscribe_signal(struct afb_req req, const char *name)
+static int unsubscribe_signal(afb_req_t req, const char *name)
{
struct bind_event_t *event;
if(strcmp(name, "*") == 0)
@@ -286,7 +286,7 @@ static int unsubscribe_signal(struct afb_req req, const char *name)
return 0;
}
-static int unsubscribe_all(struct afb_req req)
+static int unsubscribe_all(afb_req_t req)
{
int i;
int nProp;
@@ -300,7 +300,7 @@ static int unsubscribe_all(struct afb_req req)
return err;
}
-static void unsubscribe(struct afb_req req)
+static void unsubscribe(afb_req_t req)
{
struct json_object *args, *val;
int n,i;
@@ -327,9 +327,9 @@ static void unsubscribe(struct afb_req req)
}
if (!err)
- afb_req_success(req, NULL, NULL);
+ afb_req_reply(req, NULL, NULL, NULL);
else
- afb_req_fail(req, "error", NULL);
+ afb_req_reply(req, NULL, "error", NULL);
}
/*
@@ -400,7 +400,7 @@ static int init()
/*
* array of the verbs exported to afb-daemon
*/
-static const struct afb_verb_v2 binding_verbs[] =
+static const afb_verb_t binding_verbs[] =
{
/* VERB'S NAME SESSION MANAGEMENT FUNCTION TO CALL Authorization */
{ .verb= "get", .session= AFB_SESSION_NONE, .callback= get, .info = "get", .auth = NULL },
@@ -414,7 +414,7 @@ static const struct afb_verb_v2 binding_verbs[] =
/*
* description of the binding for afb-daemon
*/
-const struct afb_binding_v2 afbBindingV2 =
+const afb_binding_t afbBindingExport =
{
.api = "steering-wheel",
.specification = NULL,