BlueSCSI_platform_network.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2023 joshua stein <jcs@jcs.org>
  3. *
  4. * Permission to use, copy, modify, and distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #pragma once
  17. #ifdef BLUESCSI_NETWORK
  18. #include <stdint.h>
  19. #include <stddef.h>
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. bool platform_network_supported();
  24. void platform_network_poll();
  25. int platform_network_init(char *mac);
  26. void platform_network_add_multicast_address(uint8_t *mac);
  27. bool platform_network_wifi_join(char *ssid, char *password);
  28. int platform_network_wifi_start_scan();
  29. int platform_network_wifi_scan_finished();
  30. void platform_network_wifi_dump_scan_list();
  31. int platform_network_wifi_rssi();
  32. char * platform_network_wifi_ssid();
  33. char * platform_network_wifi_bssid();
  34. int platform_network_wifi_channel();
  35. int platform_network_send(uint8_t *buf, size_t len);
  36. // Test if the communication between the network device and the BlueIDE works
  37. bool platform_network_iface_check();
  38. // Tears down the interface, mainly used to turn off the LED on the RM2 Pico 1W/2W
  39. void platform_network_deinit();
  40. # ifdef __cplusplus
  41. }
  42. # endif
  43. #endif // BLUESCSI_NETWORK