BLE_TX.h 944 B

1234567891011121314151617181920212223242526
  1. /*
  2. BLE BT4/BT5 driver
  3. */
  4. #pragma once
  5. #include "transmitter.h"
  6. class BLE_TX : public Transmitter {
  7. public:
  8. bool init(void) override;
  9. bool transmit_cn_longrange(CNDID_UAS_Data &UAS_data); // 国标蓝牙协议发送
  10. bool transmit_cn_legacy(CNDID_UAS_Data &UAS_data); // 国标蓝牙协议发送
  11. bool transmit_longrange(ODID_UAS_Data &UAS_data); // 国际蓝牙协议发送
  12. bool transmit_legacy(ODID_UAS_Data &UAS_data); // 国际蓝牙协议发送
  13. bool transmit_GB2025_longrange(UavIdentificationData &UAS_data); // GB2025 包协议发送
  14. private:
  15. bool initialised;
  16. uint8_t msg_counters_ODID[ODID_MSG_COUNTER_AMOUNT]; // 国际计数器
  17. uint8_t msg_counters_CNDID[CNDID_MSG_COUNTER_AMOUNT]; // 国标计数器
  18. uint8_t msg_counters_GB2025;
  19. uint8_t legacy_payload[36];
  20. uint8_t longrange_payload[250];
  21. bool started;
  22. uint8_t dBm_to_tx_power(float dBm) const;
  23. };