From 3d58f7aba27b0a3eaa042c58801f4442d79a05e2 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Mon, 5 Nov 2012 22:06:31 +0100 Subject: SRS: Rework to handle multiple clients in a better way Signed-off-by: Paul Kocialkowski --- srs.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'srs.h') diff --git a/srs.h b/srs.h index c71dac3..b88731c 100644 --- a/srs.h +++ b/srs.h @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -30,7 +31,29 @@ #include +#define SRS_CLIENT_LOCK() pthread_mutex_lock(&client_data->mutex) +#define SRS_CLIENT_UNLOCK() pthread_mutex_unlock(&client_data->mutex) + +struct srs_client_info { + int fd; +}; + +struct srs_client_data { + struct ril_client *client; + + int server_fd; + int client_fd; + + struct list_head *clients; + + pthread_t thread; + pthread_mutex_t mutex; + int running; +}; + extern struct ril_client_funcs srs_client_funcs; -extern void srs_control_ping(int fd, struct srs_message *message); + +int srs_send(unsigned short command, void *data, int length); +void srs_control_ping(struct srs_message *message); #endif -- cgit v1.1