libmygpio
libmygpio API documentation
Loading...
Searching...
No Matches
libmygpio_connection.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-3.0-or-later
3 libmygpio (c) 2020-2026 Juergen Mang <mail@jcgames.de>
4 https://github.com/jcorporation/mympd
5*/
6
12
13#ifndef LIBMYGPIO_CONNECTION_H
14#define LIBMYGPIO_CONNECTION_H
15
16#include <stdbool.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
30
38
47
56struct t_mygpio_connection *mygpio_connection_new(const char *socket_path, int timeout_ms);
57
63
69const unsigned *mygpio_connection_get_version(struct t_mygpio_connection *connection);
70
78
86
92const char *mygpio_connection_get_error(struct t_mygpio_connection *connection);
93
101
105
106#ifdef __cplusplus
107}
108#endif
109
110#endif
void mygpio_connection_free(struct t_mygpio_connection *connection)
struct t_mygpio_connection * mygpio_connection_new(const char *socket_path, int timeout_ms)
int mygpio_connection_get_fd(struct t_mygpio_connection *connection)
const unsigned * mygpio_connection_get_version(struct t_mygpio_connection *connection)
mygpio_conn_state
Definition libmygpio_connection.h:42
const char * mygpio_connection_get_error(struct t_mygpio_connection *connection)
enum mygpio_conn_state mygpio_connection_get_state(struct t_mygpio_connection *connection)
bool mygpio_connection_clear_error(struct t_mygpio_connection *connection)
@ MYGPIO_STATE_FATAL
Fatal state, read the error with mygpio_connection_get_error. You must reconnect to recover.
Definition libmygpio_connection.h:45
@ MYGPIO_STATE_OK
OK state.
Definition libmygpio_connection.h:43
@ MYGPIO_STATE_ERROR
Error state, read the error with mygpio_connection_get_error and clear it with mygpio_connection_clea...
Definition libmygpio_connection.h:44