diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2012-03-28 12:03:19 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-03-28 13:17:39 +0300 |
commit | e26b01d25b70b629aaa0f90a801636b6d193385e (patch) | |
tree | cc347d42432afc24eb25c0e41c9dce214d85737c /lib | |
parent | b45b981202c0d84b1dc1edc4501849f194243d08 (diff) | |
download | bluez-e26b01d25b70b629aaa0f90a801636b6d193385e.tar.gz |
Move common code to sdp to avoid duplication
LanguageBaseAttributeIDList is set from few places and each time static
function was copied and used for that. Move this funtion to sdp code
and use that instead of copying code.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sdp.c | 13 | ||||
-rw-r--r-- | lib/sdp_lib.h | 2 |
2 files changed, 15 insertions, 0 deletions
@@ -4794,3 +4794,16 @@ fail: return -1; } +void sdp_add_lang_attr(sdp_record_t *rec) +{ + sdp_lang_attr_t base_lang; + sdp_list_t *langs; + + base_lang.code_ISO639 = (0x65 << 8) | 0x6e; + base_lang.encoding = 106; + base_lang.base_offset = SDP_PRIMARY_LANG_BASE; + + langs = sdp_list_append(0, &base_lang); + sdp_set_lang_attr(rec, langs); + sdp_list_free(langs, NULL); +} diff --git a/lib/sdp_lib.h b/lib/sdp_lib.h index 433e9effb..6e1eb91a6 100644 --- a/lib/sdp_lib.h +++ b/lib/sdp_lib.h @@ -624,6 +624,8 @@ void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); int sdp_send_req_w4_rsp(sdp_session_t *session, uint8_t *req, uint8_t *rsp, uint32_t reqsize, uint32_t *rspsize); +void sdp_add_lang_attr(sdp_record_t *rec); + #ifdef __cplusplus } #endif |