diff options
Diffstat (limited to 'code/test/vc_server.c')
-rw-r--r-- | code/test/vc_server.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/code/test/vc_server.c b/code/test/vc_server.c index 455f1a0..8525ad4 100644 --- a/code/test/vc_server.c +++ b/code/test/vc_server.c @@ -18,21 +18,19 @@ ECPConnection conn; #define CTYPE_TEST 0 #define MTYPE_MSG 8 -ssize_t handle_open(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) { +ssize_t handle_open(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s, ECP2Buffer *b) { printf("OPEN RECEIVED\n"); - return ecp_conn_handle_open(conn, sq, t, p, s); + return ecp_conn_handle_open(conn, sq, t, p, s, b); } -ssize_t handle_msg(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) { +ssize_t handle_msg(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s, ECP2Buffer *b) { printf("MSG S:%s size:%ld\n", p, s); - unsigned char payload[ECP_SIZE_PLD(1000, 0)]; - unsigned char *buf = ecp_pld_get_buf(payload, 0); char *msg = "VAISTINU JE CAR!"; + unsigned char buf[1000]; - ecp_pld_set_type(payload, MTYPE_MSG); strcpy((char *)buf, msg); - ssize_t _rv = ecp_pld_send(conn, payload, sizeof(payload)); + ssize_t _rv = ecp_send(conn, MTYPE_MSG, buf, 1000); return s; } |