subbrute_radio_device_loader.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include <lib/subghz/devices/devices.h>
  3. /**
  4. * @file subghz_radio.h
  5. * @brief Defines the Sub-GHz radio device type.
  6. */
  7. typedef enum {
  8. SubGhzRadioDeviceTypeInternal,
  9. SubGhzRadioDeviceTypeExternalCC1101,
  10. } SubGhzRadioDeviceType;
  11. /**
  12. * @brief Sets the SubGhz radio device type.
  13. *
  14. * This function is used to set the SubGhz radio device type for the SubBrute radio device loader.
  15. *
  16. * @param [in] current_radio_device Pointer to the current SubGhz radio device.
  17. * @param [in] radio_device_type The desired SubGhz radio device type.
  18. *
  19. * @return @c const SubGhzDevice* Pointer to the new SubGhz radio device.
  20. *
  21. * @remark This function sets the SubGhz radio device type for the SubBrute radio device loader.
  22. * The current radio device will be replaced with a new instance of the specified radio device type.
  23. * If @p current_radio_device is NULL, a new instance of the specified radio device type will be created.
  24. *
  25. * @note The caller is responsible for handling memory deallocation of the returned pointer.
  26. *
  27. */
  28. const SubGhzDevice* subbrute_radio_device_loader_set(
  29. const SubGhzDevice* current_radio_device,
  30. SubGhzRadioDeviceType radio_device_type);
  31. /**
  32. * @brief Unloads the radio device in the subbrute radio device loader.
  33. *
  34. * This function is called to unload the specified radio device in the
  35. * subbrute radio device loader.
  36. * It first checks if the radio device is valid and then performs the necessary steps to
  37. * power off the device.
  38. * If the radio device is not the CC1101 internal device, it calls @c subghz_devices_end()
  39. * function to terminate the radio device.
  40. *
  41. * @param[in] radio_device A pointer to the radio device to unload.
  42. *
  43. */
  44. void subbrute_radio_device_loader_end(const SubGhzDevice* radio_device);