mongoose/test/driver_mock.c

22 lines
504 B
C
Raw Normal View History

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