diff options
author | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-05-16 18:14:52 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-05-16 18:38:27 +0900 |
commit | 0c458cecd936c4263f46fe582afb91df7f5ed61c (patch) | |
tree | 2c43e8f9d0fab40fc5d53fe3217bb9095542d0e8 /src/sm-helper.c | |
parent | cbf280b545bbb3a879c55913564796f944b217c4 (diff) |
Get first sinkID and set it as default on initialize
Get first sinkID and set it as default on initialize
Change-Id: I7e5d6ef9db270f182dd1775985a2b6cf9b3fdc74
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/sm-helper.c')
-rw-r--r-- | src/sm-helper.c | 8 |
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; |