From cbba099541d27400ad45083a4b1102b86f9e8dea Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 10 Aug 2017 21:02:16 +0200 Subject: rbuffer almost implemented --- code/test/basic.c | 4 ++-- code/test/client.c | 4 ++-- code/test/pr_client.c | 4 ++-- code/test/stress.c | 2 +- code/test/voip.c | 8 +++++--- 5 files changed, 12 insertions(+), 10 deletions(-) (limited to 'code/test') diff --git a/code/test/basic.c b/code/test/basic.c index c9f6bd5..809d453 100644 --- a/code/test/basic.c +++ b/code/test/basic.c @@ -26,7 +26,7 @@ ssize_t handle_open_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsign ecp_conn_handle_open(conn, sq, t, p, s); if (s < 0) { printf("OPEN ERR:%ld\n", s); - return 0; + return s; } unsigned char payload[ECP_SIZE_PLD(1000)]; @@ -36,7 +36,7 @@ ssize_t handle_open_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsign ecp_pld_set_type(payload, MTYPE_MSG); strcpy((char *)buf, msg); ssize_t _rv = ecp_send(conn, payload, sizeof(payload)); - return 0; + return s; } ssize_t handle_msg_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) { diff --git a/code/test/client.c b/code/test/client.c index 6e45df4..1d5dc6c 100644 --- a/code/test/client.c +++ b/code/test/client.c @@ -22,7 +22,7 @@ ssize_t handle_open_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsign ecp_conn_handle_open(conn, sq, t, p, s); if (s < 0) { printf("OPEN ERR:%ld\n", s); - return 0; + return s; } unsigned char payload[ECP_SIZE_PLD(1000)]; @@ -32,7 +32,7 @@ ssize_t handle_open_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsign ecp_pld_set_type(payload, MTYPE_MSG); strcpy((char *)buf, msg); ssize_t _rv = ecp_send(conn, payload, sizeof(payload)); - return 0; + return s; } ssize_t handle_msg_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) { diff --git a/code/test/pr_client.c b/code/test/pr_client.c index 7b80d6f..d643dd3 100644 --- a/code/test/pr_client.c +++ b/code/test/pr_client.c @@ -26,7 +26,7 @@ ssize_t handle_open(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned ecp_conn_handle_open(conn, sq, t, p, s); if (s < 0) { printf("OPEN ERR:%ld\n", s); - return 0; + return s; } printf("OPEN!\n"); @@ -38,7 +38,7 @@ ssize_t handle_open(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned ecp_pld_set_type(payload, MTYPE_MSG); strcpy((char *)buf, msg); ssize_t _rv = ecp_send(conn, payload, sizeof(payload)); - return 0; + return s; } ssize_t handle_msg(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) { diff --git a/code/test/stress.c b/code/test/stress.c index 42663fc..081c0cb 100644 --- a/code/test/stress.c +++ b/code/test/stress.c @@ -107,7 +107,7 @@ ssize_t handle_open_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsign perror(msg); exit(1); } - return 0; + return s; } ssize_t handle_msg_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) { diff --git a/code/test/voip.c b/code/test/voip.c index 67e1afe..8c53d01 100644 --- a/code/test/voip.c +++ b/code/test/voip.c @@ -52,7 +52,7 @@ int a_open(char *dev_name, snd_pcm_t **handle, snd_pcm_hw_params_t **hw_params, frame_size = *nchannels * (bits / 8); *buf_size = frame_size * *frames; - return 0; + return ECP_OK; } int a_prepare(snd_pcm_t *handle, snd_pcm_hw_params_t *hw_params, unsigned char *buf, snd_pcm_uframes_t frames) { @@ -68,7 +68,7 @@ int a_prepare(snd_pcm_t *handle, snd_pcm_hw_params_t *hw_params, unsigned char * for (i=0; i