/*
  WiFi beacon driver
 */
#pragma once

#include "transmitter.h"

class WiFi_TX:public Transmitter {
public:
    bool init(void) override;
    bool transmit_cn_nan(CNDID_UAS_Data &UAS_data);
    bool transmit_cn_beacon(CNDID_UAS_Data &UAS_data);
    bool transmit_nan(ODID_UAS_Data &UAS_data);
    bool transmit_beacon(ODID_UAS_Data &UAS_data);
    bool transmit_GB2025_nan(UavIdentificationData &UAS_data);
    bool transmit_GB2025_beacon(UavIdentificationData &UAS_data);

private:
    bool initialised;
    char ssid[32];
    uint8_t WiFi_mac_addr[6];
    size_t ssid_length;
    uint8_t send_counter_cn_nan; // 发送的中国广播nan计数器
    uint8_t send_counter_cn_beacon; // 发送的中国广播beacon计数器
    uint8_t send_counter_nan;  
    uint8_t send_counter_beacon;
    uint8_t send_counter_GB2025_nan; // 发送的中国GB2025广播nan计数器
    uint8_t send_counter_GB2025_beacon; // 发送的中国GB2025广播beacon计数器
    uint8_t dBm_to_tx_power(float dBm) const;
};
