mongoose/test/driver_mock.c

22 lines
504 B
C
Raw Permalink Normal View History

static bool mock_init(struct mg_tcpip_if *ifp) {
2022-12-19 19:43:25 +08:00
(void) ifp;
2022-11-09 21:11:22 +08:00
return true;
2022-09-19 20:28:07 +08:00
}
static size_t mock_tx(const void *buf, size_t len, struct mg_tcpip_if *ifp) {
2022-12-19 19:43:25 +08:00
(void) buf, (void) len, (void) ifp;
2022-09-19 20:28:07 +08:00
return len;
}
static size_t mock_rx(void *buf, size_t len, struct mg_tcpip_if *ifp) {
2022-12-19 19:43:25 +08:00
(void) buf, (void) len, (void) ifp;
2022-12-01 04:37:32 +08:00
return 0;
2022-09-19 20:28:07 +08:00
}
static bool mock_up(struct mg_tcpip_if *ifp) {
2022-12-19 19:43:25 +08:00
(void) ifp;
2022-11-09 21:11:22 +08:00
return true;
2022-09-19 20:28:07 +08:00
}
struct mg_tcpip_driver mg_tcpip_driver_mock = {mock_init, mock_tx, mock_rx, mock_up};