diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2012-11-05 22:06:31 +0100 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2012-11-05 22:06:31 +0100 |
commit | 3d58f7aba27b0a3eaa042c58801f4442d79a05e2 (patch) | |
tree | e727cbd722126afe612223e13abae3a7d85ae673 /srs.h | |
parent | c54dc2a93836d387d17f57b7461cdd1d43550fcf (diff) | |
download | hardware_ril_samsung-ril-3d58f7aba27b0a3eaa042c58801f4442d79a05e2.zip hardware_ril_samsung-ril-3d58f7aba27b0a3eaa042c58801f4442d79a05e2.tar.gz hardware_ril_samsung-ril-3d58f7aba27b0a3eaa042c58801f4442d79a05e2.tar.bz2 |
SRS: Rework to handle multiple clients in a better way
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'srs.h')
-rw-r--r-- | srs.h | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -23,6 +23,7 @@ #include <sys/types.h> #include <sys/socket.h> +#include <sys/select.h> #include <sys/un.h> #include <arpa/inet.h> @@ -30,7 +31,29 @@ #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 |