loragw_lbt.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. / _____) _ | |
  3. ( (____ _____ ____ _| |_ _____ ____| |__
  4. \____ \| ___ | (_ _) ___ |/ ___) _ \
  5. _____) ) ____| | | || |_| ____( (___| | | |
  6. (______/|_____)_|_|_| \__)_____)\____)_| |_|
  7. (C)2020 Semtech
  8. Description:
  9. LoRa concentrator Listen-Before-Talk functions
  10. License: Revised BSD License, see LICENSE.TXT file include in the project
  11. */
  12. #ifndef _LORAGW_LBT_H
  13. #define _LORAGW_LBT_H
  14. /* -------------------------------------------------------------------------- */
  15. /* --- DEPENDANCIES --------------------------------------------------------- */
  16. #include <stdint.h> /* C99 types */
  17. #include <stdbool.h> /* bool type */
  18. #include "loragw_hal.h"
  19. #include "config.h" /* library configuration options (dynamically generated) */
  20. /* -------------------------------------------------------------------------- */
  21. /* --- PUBLIC MACROS -------------------------------------------------------- */
  22. /* -------------------------------------------------------------------------- */
  23. /* --- PUBLIC CONSTANTS ----------------------------------------------------- */
  24. /* -------------------------------------------------------------------------- */
  25. /* --- PUBLIC TYPES --------------------------------------------------------- */
  26. /* -------------------------------------------------------------------------- */
  27. /* --- PUBLIC FUNCTIONS PROTOTYPES ------------------------------------------ */
  28. /**
  29. @brief Configure the SX1261 and start LBT channel scanning
  30. @param sx1261_context the sx1261 radio parameters to take into account for scanning
  31. @param pkt description of the packet to be transmitted
  32. @return 0 for success, -1 for failure
  33. */
  34. int lgw_lbt_start(const struct lgw_conf_sx1261_s * sx1261_context, const struct lgw_pkt_tx_s * pkt);
  35. /**
  36. @brief Stop LBT scanning
  37. @return 0 for success, -1 for failure
  38. */
  39. int lgw_lbt_stop(void);
  40. /**
  41. @brief Check if packet was allowed to be transmitted or not
  42. @param rf_chain the TX path on which TX was requested
  43. @param tx_ok pointer to return if the packet was allowed to be transmitted or not.
  44. @return 0 for success, -1 for failure
  45. */
  46. int lgw_lbt_tx_status(uint8_t rf_chain, bool * tx_ok);
  47. #endif
  48. /* --- EOF ------------------------------------------------------------------ */