* Author: José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author: José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
/* predeclaration of websocket callbacks */
static void aws_on_hangup_cb(void *closure, struct afb_wsj1 *wsj1);
static void aws_on_call_cb(void *closure, const char *api, const char *verb, struct afb_wsj1_msg *msg);
/* predeclaration of websocket callbacks */
static void aws_on_hangup_cb(void *closure, struct afb_wsj1 *wsj1);
static void aws_on_call_cb(void *closure, const char *api, const char *verb, struct afb_wsj1_msg *msg);
-static void aws_on_push_cb(void *closure, const char *event, int eventid, struct json_object *object);
+static void aws_on_push_cb(void *closure, const char *event, uint16_t eventid, struct json_object *object);
static void aws_on_broadcast_cb(void *closure, const char *event, struct json_object *object, const uuid_binary_t uuid, uint8_t hop);
/* predeclaration of wsreq callbacks */
static void aws_on_broadcast_cb(void *closure, const char *event, struct json_object *object, const uuid_binary_t uuid, uint8_t hop);
/* predeclaration of wsreq callbacks */
- afb_context_init(&wsreq->xreq.context, ws->session, ws->token);
- if (!wsreq->xreq.context.invalidated)
- wsreq->xreq.context.validated = 1;
+ afb_context_init(&wsreq->xreq.context, ws->session, ws->token, ws->cred);
wsreq->xreq.request.called_api = api;
wsreq->xreq.request.called_verb = verb;
wsreq->xreq.json = afb_wsj1_msg_object_j(wsreq->msgj1);
wsreq->xreq.request.called_api = api;
wsreq->xreq.request.called_verb = verb;
wsreq->xreq.json = afb_wsj1_msg_object_j(wsreq->msgj1);
afb_wsj1_send_event_j(aws->wsj1, event, afb_msg_json_event(event, object));
}
afb_wsj1_send_event_j(aws->wsj1, event, afb_msg_json_event(event, object));
}
-static void aws_on_push_cb(void *closure, const char *event, int eventid, struct json_object *object)
+static void aws_on_push_cb(void *closure, const char *event, uint16_t eventid, struct json_object *object)
}
static int wsreq_unsubscribe(struct afb_xreq *xreq, struct afb_event_x2 *event)
{
struct afb_wsreq *wsreq = CONTAINER_OF_XREQ(struct afb_wsreq, xreq);
}
static int wsreq_unsubscribe(struct afb_xreq *xreq, struct afb_event_x2 *event)
{
struct afb_wsreq *wsreq = CONTAINER_OF_XREQ(struct afb_wsreq, xreq);