2 * This file is part of samsung-ril.
4 * Copyright (C) 2013 Paul Kocialkowski <contact@oaulk.fr>
6 * samsung-ril is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * samsung-ril is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with samsung-ril. If not, see <http://www.gnu.org/licenses/>.
23 #include <samsung-ril-socket.h>
25 #ifndef _SRS_CLIENT_H_
26 #define _SRS_CLIENT_H_
28 #define SRS_CLIENT_TIMEOUT 500000
30 #define SRS_CLIENT_LOCK(client) pthread_mutex_lock(&(client->mutex))
31 #define SRS_CLIENT_UNLOCK(client) pthread_mutex_unlock(&(client->mutex))
33 typedef void (*srs_client_thread_cb)(struct srs_message *message);
38 pthread_mutex_t mutex;
42 srs_client_thread_cb thread_cb;
45 int srs_client_recv_message(struct srs_client *client, struct srs_message *message);
46 int srs_client_send_message(struct srs_client *client, struct srs_message *message);
47 int srs_client_send(struct srs_client *client, unsigned short command, void *data, int length);
49 int srs_client_open(struct srs_client *client);
50 int srs_client_close(struct srs_client *client);
51 int srs_client_create(struct srs_client **client_p);
52 int srs_client_destroy(struct srs_client *client);
54 int srs_client_thread_start(struct srs_client *client,
55 srs_client_thread_cb cb);
56 int srs_client_thread_stop(struct srs_client *client);
58 int srs_client_ping(struct srs_client *client);