Commit | Line | Data |
---|---|---|
811644b8 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 | ||
25 | /* Type */ | |
26 | struct bt_port; | |
27 | struct bt_private_port; | |
28 | ||
29 | /* Status */ | |
30 | enum bt_port_status { | |
31 | BT_PORT_STATUS_OK = 0, | |
32 | BT_PORT_STATUS_ERROR = -1, | |
33 | BT_PORT_STATUS_INVALID = -2, | |
34 | }; | |
35 | ||
36 | /* Port type */ | |
37 | enum bt_port_type { | |
38 | BT_PORT_TYPE_INPUT = 0, | |
39 | BT_PORT_TYPE_OUTPUT = 1, | |
40 | BT_PORT_TYPE_UNKOWN = -1, | |
41 | }; | |
42 | ||
43 | /* Functions (public) */ | |
44 | const char *bt_port_get_name(struct bt_port *port); | |
45 | enum bt_port_type bt_port_get_type(struct bt_port *port); | |
46 | struct bt_connection *bt_port_get_connection(struct bt_port *port); | |
47 | struct bt_component *bt_port_get_component(struct bt_port *port); | |
48 | enum bt_port_status bt_port_disconnect(struct bt_port *port); | |
49 | int bt_port_is_connected(struct bt_port *port); | |
50 | ||
51 | /* Functions (private) */ | |
52 | struct bt_port *bt_port_from_private_port(struct bt_private_port *private_port); | |
53 | struct bt_private_connection *bt_private_port_get_private_connection( | |
54 | struct bt_private_port *private_port); | |
55 | struct bt_private_component *bt_private_port_get_private_component( | |
56 | struct bt_private_port *private_port); | |
57 | enum bt_port_status bt_private_port_remove_from_component( | |
58 | struct bt_private_port *private_port); | |
59 | void *bt_private_port_get_user_data( | |
60 | struct bt_private_port *private_port); |