aboutsummaryrefslogtreecommitdiffstats
path: root/src/sm-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sm-helper.c')
-rw-r--r--src/sm-helper.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sm-helper.c b/src/sm-helper.c
index f2620ce..9f78414 100644
--- a/src/sm-helper.c
+++ b/src/sm-helper.c
@@ -22,6 +22,8 @@
#include "sm-helper.h"
#include "sm-error.h"
+static int default_sinkID = DEFAULT_SINK;
+
REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uint16_t *out_id)
{
char* endptr;
@@ -102,7 +104,7 @@ REQ_ERROR get_sink_id(const afb_req request, const char* key, uint16_t* out_sink
AFB_DEBUG("%s", json_object_to_json_string_ext(test, JSON_C_TO_STRING_PRETTY));
if(0 == strcmp(requested_sink_str, "default")){
- *out_sink_id = DEFAULT_SINK;
+ *out_sink_id = default_sinkID;
AFB_INFO("sinkID(endpointID) is attached as default sinkID as %d", DEFAULT_SINK);
result = REQ_OK;
}
@@ -119,6 +121,10 @@ REQ_ERROR get_sink_id(const afb_req request, const char* key, uint16_t* out_sink
return REQ_OK;
}
+void set_default_sinkID(int sinkID){
+ default_sinkID = sinkID;
+}
+
void sm_add_object_to_json_object(struct json_object* j_obj, int count,...)
{
va_list args;