summaryrefslogtreecommitdiff
path: root/ecp/src/platform/fe310
diff options
context:
space:
mode:
Diffstat (limited to 'ecp/src/platform/fe310')
-rw-r--r--ecp/src/platform/fe310/features_tmpl.mk1
-rw-r--r--ecp/src/platform/fe310/transport.c11
2 files changed, 6 insertions, 6 deletions
diff --git a/ecp/src/platform/fe310/features_tmpl.mk b/ecp/src/platform/fe310/features_tmpl.mk
index 39f95cf..54f777c 100644
--- a/ecp/src/platform/fe310/features_tmpl.mk
+++ b/ecp/src/platform/fe310/features_tmpl.mk
@@ -1,3 +1,2 @@
with_vconn = yes
with_dir = yes
-with_debug = yes
diff --git a/ecp/src/platform/fe310/transport.c b/ecp/src/platform/fe310/transport.c
index 35addfa..b53534d 100644
--- a/ecp/src/platform/fe310/transport.c
+++ b/ecp/src/platform/fe310/transport.c
@@ -1,6 +1,5 @@
#include <stdlib.h>
#include <string.h>
-#include <stdio.h>
#include <ecp/core.h>
#include <ecp/tr.h>
@@ -12,6 +11,7 @@ ECPSocket *_ecp_tr_sock = NULL;
unsigned char pld_buf[ECP_MAX_PLD];
static void packet_handler(unsigned char type, unsigned char *buffer, uint16_t len) {
+ ECPContext *ctx;
ECP2Buffer bufs;
ECPBuffer packet;
ECPBuffer payload;
@@ -33,12 +33,13 @@ static void packet_handler(unsigned char type, unsigned char *buffer, uint16_t l
eos_sock_recvfrom(buffer, len, NULL, 0, &addr);
+ ctx = _ecp_tr_sock->ctx;
rv = ecp_pkt_handle(_ecp_tr_sock, NULL, &addr, &bufs, len-EOS_SOCK_SIZE_UDP_HDR);
-#ifdef ECP_DEBUG
- if (rv < 0) {
- printf("RCV ERR:%d\n", rv);
+ if ((rv < 0) && ctx->logger) {
+ int _rv = rv;
+
+ ctx->logger("packet_handler: err:%d\n", _rv);
}
-#endif
if (bufs.packet->buffer) {
eos_net_free(buffer, 0);
} else {