summaryrefslogtreecommitdiffstats
path: root/binding/binding.c
diff options
context:
space:
mode:
Diffstat (limited to 'binding/binding.c')
-rw-r--r--binding/binding.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/binding/binding.c b/binding/binding.c
index cebc54a..1d19fdb 100644
--- a/binding/binding.c
+++ b/binding/binding.c
@@ -38,6 +38,7 @@ static int init(afb_api_t api) {
AFB_API_NOTICE(afbBindingRoot, "UNICENS-CONTROLLER: INIT");
wrap_ucs_init(api);
wrap_ucs_subscribe_sync();
+ wrap_ucs_subscriberx_sync();
return 0;
}
@@ -47,10 +48,15 @@ static void on_availability_cb(uint16_t node, bool available) {
microphone_availablility_changed(node, available);
}
+static void on_message_rx_cb(uint16_t node, uint16_t msg_id, uint16_t data_sz, uint8_t *data_ptr) {
+ microphone_message_received(node, msg_id, data_sz, data_ptr);
+}
+
/* callback for handling events */
static void onevent(afb_api_t api, const char *event, struct json_object *object) {
AFB_API_NOTICE(afbBindingRoot, "UNICENS-CONTROLLER: Event: %s object: %s", event, json_object_get_string(object));
wrap_ucs_interpret_event(event, object, &on_availability_cb);
+ wrap_ucs_interpretrx_event(event, object, &on_message_rx_cb);
}
static void ping(afb_req_t request) {
@@ -63,6 +69,7 @@ static const afb_verb_t verbs[] = {
{.verb = "slimamp_master_volume_set", .session = AFB_SESSION_NONE, .callback = slimamp_master_vol_set_api, .auth = NULL},
{.verb = "amplifier_master_volume_set", .session = AFB_SESSION_NONE, .callback = amplifier_master_vol_set_api, .auth = NULL},
{.verb = "microphone_mode_set", .session = AFB_SESSION_NONE, .callback = microphone_mode_set_api, .auth = NULL},
+ {.verb = "microphone_doa_get", .session = AFB_SESSION_NONE, .callback = microphone_doa_get_api, .auth = NULL},
{NULL}
};