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 e0dec49..b00ffa3 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;
@@ -107,7 +109,7 @@ REQ_ERROR get_sink_id(const afb_req request, const char* key, uint16_t* out_sink
else{
if((strlen("default") == strlen(default_sink)) &&
(0 == strncmp("default", default_sink, strlen("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;
}
@@ -124,6 +126,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;