1 /******************************************************************************
3 Copyright (c) 2012, AudioScience, Inc
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 3. Neither the name of the Intel Corporation nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
32 ******************************************************************************/
34 #ifndef _MRPDHELPER_H_
35 #define _MRPDHELPER_H_
37 /**************************************************************************
38 This module provides helper functions for communicating with the MRPD daemon.
39 ***************************************************************************/
41 enum mrpdhelper_attribtype {
42 mrpdhelper_attribtype_null,
43 mrpdhelper_attribtype_mmrp,
44 mrpdhelper_attribtype_mvrp,
45 mrpdhelper_attribtype_msrp_domain,
46 mrpdhelper_attribtype_msrp_talker,
47 mrpdhelper_attribtype_msrp_listener,
48 mrpdhelper_attribtype_msrp_talker_fail,
49 mrpdhelper_attribtype_msrp_listener_fail
52 enum mrpdhelper_notification {
53 mrpdhelper_notification_null,
54 mrpdhelper_notification_new,
55 mrpdhelper_notification_join,
56 mrpdhelper_notification_leave
59 enum mrpdhelper_state {
60 mrpdhelper_state_null,
62 mrpdhelper_state_leave,
63 mrpdhelper_state_empty
66 enum mrpdhelper_applicant_state {
67 mrpdhelper_applicant_state_null,
68 mrpdhelper_applicant_state_VO,
69 mrpdhelper_applicant_state_VP,
70 mrpdhelper_applicant_state_VN,
71 mrpdhelper_applicant_state_AN,
72 mrpdhelper_applicant_state_AA,
73 mrpdhelper_applicant_state_QA,
74 mrpdhelper_applicant_state_LA,
75 mrpdhelper_applicant_state_AO,
76 mrpdhelper_applicant_state_QO,
77 mrpdhelper_applicant_state_AP,
78 mrpdhelper_applicant_state_QP,
79 mrpdhelper_applicant_state_LO
82 struct mrpdhelper_mmrp_notify {
86 struct mrpdhelper_mvrp_notify {
90 struct mrpdhelper_msrp_domain {
96 struct mrpdhelper_msrp_listener {
101 struct mrpdhelper_msrp_talker {
105 uint32_t max_frame_size;
106 uint32_t max_interval_frames;
107 uint32_t priority_and_rank;
108 uint32_t accum_latency;
110 uint32_t failure_code;
113 struct mrpdhelper_notify {
114 enum mrpdhelper_attribtype attrib;
115 enum mrpdhelper_notification notify;
116 enum mrpdhelper_state state;
117 enum mrpdhelper_applicant_state app_state;
120 struct mrpdhelper_mmrp_notify m;
121 struct mrpdhelper_mvrp_notify v;
122 struct mrpdhelper_msrp_domain sd;
123 struct mrpdhelper_msrp_listener sl;
124 struct mrpdhelper_msrp_talker st;
128 int mrpdhelper_parse_notification(char *sz,
129 size_t len, struct mrpdhelper_notify *n);
131 int mrpdhelper_notify_equal(struct mrpdhelper_notify *n1,
132 struct mrpdhelper_notify *n2);