/* BLE BT4/BT5 driver */ #pragma once #include "transmitter.h" class BLE_TX : public Transmitter { public: bool init(void) override; bool transmit_cn_longrange(CNDID_UAS_Data &UAS_data); // 国标蓝牙协议发送 bool transmit_cn_legacy(CNDID_UAS_Data &UAS_data); // 国标蓝牙协议发送 bool transmit_longrange(ODID_UAS_Data &UAS_data); // 国际蓝牙协议发送 bool transmit_legacy(ODID_UAS_Data &UAS_data); // 国际蓝牙协议发送 bool transmit_GB2025_longrange(UavIdentificationData &UAS_data); // GB2025 包协议发送 private: bool initialised; uint8_t msg_counters_ODID[ODID_MSG_COUNTER_AMOUNT]; // 国际计数器 uint8_t msg_counters_CNDID[CNDID_MSG_COUNTER_AMOUNT]; // 国标计数器 uint8_t msg_counters_GB2025; uint8_t legacy_payload[36]; uint8_t longrange_payload[250]; bool started; uint8_t dBm_to_tx_power(float dBm) const; };