Commit | Line | Data |
---|---|---|
81447b5b PP |
1 | /* |
2 | * The MIT License (MIT) | |
3 | * | |
4 | * Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com> | |
5 | * | |
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
7 | * of this software and associated documentation files (the "Software"), to deal | |
8 | * in the Software without restriction, including without limitation the rights | |
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
10 | * copies of the Software, and to permit persons to whom the Software is | |
11 | * furnished to do so, subject to the following conditions: | |
12 | * | |
13 | * The above copyright notice and this permission notice shall be included in | |
14 | * all copies or substantial portions of the Software. | |
15 | * | |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
22 | * THE SOFTWARE. | |
23 | */ | |
24 | ||
81447b5b | 25 | /* Type */ |
f6a5e476 | 26 | struct bt_notification; |
81447b5b PP |
27 | |
28 | /* Notification type */ | |
29 | enum bt_notification_type { | |
f6a5e476 | 30 | BT_NOTIFICATION_TYPE_SENTINEL = -1000, |
81447b5b | 31 | BT_NOTIFICATION_TYPE_UNKNOWN = -1, |
f6a5e476 PP |
32 | BT_NOTIFICATION_TYPE_ALL = -2, |
33 | BT_NOTIFICATION_TYPE_EVENT = 0, | |
34 | BT_NOTIFICATION_TYPE_INACTIVITY = 1, | |
35 | BT_NOTIFICATION_TYPE_STREAM_BEGIN = 2, | |
36 | BT_NOTIFICATION_TYPE_STREAM_END = 3, | |
37 | BT_NOTIFICATION_TYPE_PACKET_BEGIN = 4, | |
38 | BT_NOTIFICATION_TYPE_PACKET_END = 5, | |
39 | BT_NOTIFICATION_TYPE_DISCARDED_EVENTS = 6, | |
40 | BT_NOTIFICATION_TYPE_DISCARDED_PACKETS = 7, | |
81447b5b PP |
41 | }; |
42 | ||
43 | /* General functions */ | |
44 | enum bt_notification_type bt_notification_get_type( | |
45 | struct bt_notification *notification); | |
46 | ||
47 | /* Event notification functions */ | |
48 | struct bt_notification *bt_notification_event_create( | |
839d52a5 | 49 | struct bt_event *event, |
f6a5e476 | 50 | struct bt_clock_class_priority_map *clock_class_priority_map); |
839d52a5 | 51 | struct bt_event *bt_notification_event_get_event( |
81447b5b | 52 | struct bt_notification *notification); |
f6a5e476 PP |
53 | struct bt_clock_class_priority_map * |
54 | bt_notification_event_get_clock_class_priority_map( | |
55 | struct bt_notification *notification); | |
56 | ||
57 | /* Inactivity notification functions */ | |
58 | struct bt_notification *bt_notification_inactivity_create( | |
59 | struct bt_clock_class_priority_map *clock_class_priority_map); | |
60 | struct bt_clock_class_priority_map * | |
61 | bt_notification_inactivity_get_clock_class_priority_map( | |
62 | struct bt_notification *notification); | |
839d52a5 | 63 | struct bt_clock_value *bt_notification_inactivity_get_clock_value( |
f6a5e476 | 64 | struct bt_notification *notification, |
839d52a5 | 65 | struct bt_clock_class *clock_class); |
f6a5e476 PP |
66 | int bt_notification_inactivity_set_clock_value( |
67 | struct bt_notification *notification, | |
839d52a5 | 68 | struct bt_clock_value *clock_value); |
81447b5b PP |
69 | |
70 | /* Packet notification functions */ | |
71 | struct bt_notification *bt_notification_packet_begin_create( | |
839d52a5 | 72 | struct bt_packet *packet); |
81447b5b | 73 | struct bt_notification *bt_notification_packet_end_create( |
839d52a5 PP |
74 | struct bt_packet *packet); |
75 | struct bt_packet *bt_notification_packet_begin_get_packet( | |
81447b5b | 76 | struct bt_notification *notification); |
839d52a5 | 77 | struct bt_packet *bt_notification_packet_end_get_packet( |
81447b5b | 78 | struct bt_notification *notification); |
81447b5b PP |
79 | |
80 | /* Stream notification functions */ | |
f6a5e476 | 81 | struct bt_notification *bt_notification_stream_begin_create( |
839d52a5 | 82 | struct bt_stream *stream); |
81447b5b | 83 | struct bt_notification *bt_notification_stream_end_create( |
839d52a5 PP |
84 | struct bt_stream *stream); |
85 | struct bt_stream *bt_notification_stream_begin_get_stream( | |
f6a5e476 | 86 | struct bt_notification *notification); |
839d52a5 | 87 | struct bt_stream *bt_notification_stream_end_get_stream( |
81447b5b | 88 | struct bt_notification *notification); |
f6a5e476 PP |
89 | |
90 | /* Discarded packets notification functions */ | |
839d52a5 | 91 | struct bt_clock_value * |
f6a5e476 PP |
92 | bt_notification_discarded_packets_get_begin_clock_value( |
93 | struct bt_notification *notification); | |
839d52a5 | 94 | struct bt_clock_value * |
f6a5e476 PP |
95 | bt_notification_discarded_packets_get_end_clock_value( |
96 | struct bt_notification *notification); | |
97 | int64_t bt_notification_discarded_packets_get_count( | |
98 | struct bt_notification *notification); | |
839d52a5 | 99 | struct bt_stream *bt_notification_discarded_packets_get_stream( |
f6a5e476 PP |
100 | struct bt_notification *notification); |
101 | ||
102 | /* Discarded events notification functions */ | |
839d52a5 | 103 | struct bt_clock_value * |
f6a5e476 PP |
104 | bt_notification_discarded_events_get_begin_clock_value( |
105 | struct bt_notification *notification); | |
839d52a5 | 106 | struct bt_clock_value * |
f6a5e476 PP |
107 | bt_notification_discarded_events_get_end_clock_value( |
108 | struct bt_notification *notification); | |
109 | int64_t bt_notification_discarded_events_get_count( | |
110 | struct bt_notification *notification); | |
839d52a5 | 111 | struct bt_stream *bt_notification_discarded_events_get_stream( |
f6a5e476 | 112 | struct bt_notification *notification); |