diff options
author | Uros Majstorovic <majstor@majstor.org> | 2017-12-06 07:17:24 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2017-12-06 07:17:24 +0100 |
commit | 848f44266dd4b9213af632d55747d66f03881422 (patch) | |
tree | 2f1a348e6e5c77760bbbec8d2ec54e89cedc7e66 /code/test/vc_client.c | |
parent | 028af540a2d856bccc84d3f5e3e8d3517105e411 (diff) |
refactoring for memory limited systems
Diffstat (limited to 'code/test/vc_client.c')
-rw-r--r-- | code/test/vc_client.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/code/test/vc_client.c b/code/test/vc_client.c index eb23d05..9ea3d1b 100644 --- a/code/test/vc_client.c +++ b/code/test/vc_client.c @@ -20,10 +20,10 @@ ECPNode vconn_node[20]; #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) { uint32_t seq = 0; - ecp_conn_handle_open(conn, sq, t, p, s); + ecp_conn_handle_open(conn, sq, t, p, s, b); if (s < 0) { printf("OPEN ERR:%ld\n", s); return s; @@ -31,17 +31,16 @@ ssize_t handle_open(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned printf("OPEN!\n"); - unsigned char payload[ECP_SIZE_PLD(1000, 0)]; - unsigned char *buf = ecp_pld_get_buf(payload, 0); char *msg = "PERA JE CAR!"; + unsigned char buf[1156]; - 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, 1156); + return s; } -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); return s; } |