driver_mock.c 504 B

12345678910111213141516171819202122
  1. static bool mock_init(struct mg_tcpip_if *ifp) {
  2. (void) ifp;
  3. return true;
  4. }
  5. static size_t mock_tx(const void *buf, size_t len, struct mg_tcpip_if *ifp) {
  6. (void) buf, (void) len, (void) ifp;
  7. return len;
  8. }
  9. static size_t mock_rx(void *buf, size_t len, struct mg_tcpip_if *ifp) {
  10. (void) buf, (void) len, (void) ifp;
  11. return 0;
  12. }
  13. static bool mock_up(struct mg_tcpip_if *ifp) {
  14. (void) ifp;
  15. return true;
  16. }
  17. struct mg_tcpip_driver mg_tcpip_driver_mock = {mock_init, mock_tx, mock_rx, mock_up};