SRS: Rework to handle multiple clients in a better way
[samsung-ril.git] / srs.h
diff --git a/srs.h b/srs.h
index c71dac3..b88731c 100644 (file)
--- a/srs.h
+++ b/srs.h
@@ -23,6 +23,7 @@
 
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/select.h>
 #include <sys/un.h>
 
 #include <arpa/inet.h>
 
 #include <samsung-ril-socket.h>
 
+#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