summaryrefslogtreecommitdiff
path: root/code/test/echo.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2017-12-06 07:17:24 +0100
committerUros Majstorovic <majstor@majstor.org>2017-12-06 07:17:24 +0100
commit848f44266dd4b9213af632d55747d66f03881422 (patch)
tree2f1a348e6e5c77760bbbec8d2ec54e89cedc7e66 /code/test/echo.c
parent028af540a2d856bccc84d3f5e3e8d3517105e411 (diff)
refactoring for memory limited systems
Diffstat (limited to 'code/test/echo.c')
-rw-r--r--code/test/echo.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/code/test/echo.c b/code/test/echo.c
index aa27529..ff9c01c 100644
--- a/code/test/echo.c
+++ b/code/test/echo.c
@@ -14,8 +14,11 @@ ECPConnHandler handler_s;
#define CTYPE_TEST 0
#define MTYPE_MSG 8
-ssize_t handle_msg_s(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) {
- ssize_t rv = ecp_pld_send(conn, p-ECP_SIZE_PLD_HDR-1, ECP_SIZE_PLD_HDR+1+s);
+ssize_t handle_msg_s(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s, ECP2Buffer *b) {
+ unsigned char buf[ECP_MAX_PLD];
+
+ memcpy(buf, p, s);
+ ssize_t _rv = ecp_send(conn, t, buf, s);
return s;
}