summaryrefslogtreecommitdiff
path: root/fw/esp32/components/eos/include/net.h
diff options
context:
space:
mode:
Diffstat (limited to 'fw/esp32/components/eos/include/net.h')
-rw-r--r--fw/esp32/components/eos/include/net.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/fw/esp32/components/eos/include/net.h b/fw/esp32/components/eos/include/net.h
index b500e82..edf1a58 100644
--- a/fw/esp32/components/eos/include/net.h
+++ b/fw/esp32/components/eos/include/net.h
@@ -1,40 +1,40 @@
#include <stdint.h>
-/* common */
+#include "msgq.h"
+
#define EOS_NET_MTU 1500
-#define EOS_NET_SIZE_BUF EOS_NET_MTU
-#define EOS_NET_MTYPE_SOCK 1
-#define EOS_NET_MTYPE_WIFI 2
-#define EOS_NET_MTYPE_CELL 3
-#define EOS_NET_MTYPE_APP 4
-#define EOS_NET_MTYPE_RNG 5
+#define EOS_NET_MTYPE_BRIDGE 0 /* handler only */
+#define EOS_NET_MTYPE_WIFI 1
+#define EOS_NET_MTYPE_CELL 2
+#define EOS_NET_MTYPE_SOCK 3
+#define EOS_NET_MTYPE_RNG 4
#define EOS_NET_MAX_MTYPE 5
-#define EOS_NET_MTYPE_SLEEP 0x10 /* does not have net handler */
+#define EOS_NET_MTYPE_SLEEP 0x20 /* does not have net handler */
-#define EOS_NET_MTYPE_FLAG_ONEW 0x40
-#define EOS_NET_MTYPE_FLAG_REPL 0x80
-#define EOS_NET_MTYPE_MASK 0x3F /* 0x0F if mtype is handled by evtq */
+#define EOS_NET_MTYPE_FLAG_ONEW 0x80
+#define EOS_NET_MTYPE_FLAG_REPL 0x40
+#define EOS_NET_MTYPE_FLAG_BRIDGE 0x08
-/* esp32 specific */
-#define EOS_NET_SIZE_BUFQ 4
-#define EOS_NET_SIZE_SNDQ 4
+#define EOS_NET_MTYPE_MASK 0x0F
-typedef void (*eos_net_handler_t) (unsigned char, unsigned char *, uint16_t);
+typedef void (*eos_net_handler_t) (unsigned char, EOSMessage *msg, uint16_t);
void eos_net_xchg_task(void *param);
void eos_net_init(void);
void eos_net_run(void);
-unsigned char *eos_net_alloc(void);
-void eos_net_free(unsigned char *buf);
+void eos_net_alloc(EOSMessage *msg);
+void eos_net_free(EOSMessage *msg);
-int eos_net_send(unsigned char mtype, unsigned char *buffer, uint16_t buf_len);
-void eos_net_reply(unsigned char mtype, unsigned char *buffer, uint16_t buf_len);
+int eos_net_send(unsigned char mtype, EOSMessage *msg, uint16_t len);
+void eos_net_reply(unsigned char mtype, EOSMessage *msg, uint16_t len);
void eos_net_sleep_req(void);
void eos_net_wake(void);
+void eos_net_deep_sleep(void);
+void eos_net_deep_wake(void);
void eos_net_set_handler(unsigned char mtype, eos_net_handler_t handler);