//---------------------------------------------------------------------------

#ifndef mainH
#define mainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "wclBluetooth.hpp"
//---------------------------------------------------------------------------
class TfmMain : public TForm
{
__published:	// IDE-managed Components
	TButton* btStart;
	TButton* btStop;
	TListBox* lbPackets;
	TButton* btClear;
	TLabel* laChannel;
	TComboBox* cbChannel;
        TwclBleSniffer *wclBleSniffer;
        void __fastcall btClearClick(TObject *Sender);
        void __fastcall btStartClick(TObject *Sender);
        void __fastcall btStopClick(TObject *Sender);
        void __fastcall wclBleSnifferStarted(TObject *Sender);
        void __fastcall wclBleSnifferStopped(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall wclBleSnifferRawPacketReceived(TObject *Sender,
          const TwclBluetoothLePacketHeader &Header, const Pointer Payload,
          const WORD Size);
        void __fastcall wclBleSnifferAdvDirectIndReceived(TObject *Sender,
          const TwclBluetoothLeAdvertisingPduHeader &PduHeader,
          const __int64 AdvA, const __int64 TargetA);
        void __fastcall wclBleSnifferAdvIndReceived(TObject *Sender,
          const TwclBluetoothLeAdvertisingPduHeader &PduHeader,
          const __int64 AdvA, const Pointer AdvData,
          const BYTE AdvDataLen);
        void __fastcall wclBleSnifferAdvNonConnIndReceived(TObject *Sender,
          const TwclBluetoothLeAdvertisingPduHeader &PduHeader,
          const __int64 AdvA, const Pointer AdvData,
          const BYTE AdvDataLen);
        void __fastcall wclBleSnifferAdvScanIndReceived(TObject *Sender,
          const TwclBluetoothLeAdvertisingPduHeader &PduHeader,
          const __int64 AdvA, const Pointer AdvData,
          const BYTE AdvDataLen);
        void __fastcall wclBleSnifferScanReqReceived(TObject *Sender,
          const TwclBluetoothLeAdvertisingPduHeader &PduHeader,
          const __int64 ScanA, const __int64 AdvA);
        void __fastcall wclBleSnifferScanRspReceived(TObject *Sender,
          const TwclBluetoothLeAdvertisingPduHeader &PduHeader,
          const __int64 AdvA, const Pointer ScanRspData,
          const BYTE ScanRspDataLen);
        void __fastcall wclBleSnifferConnectIndReceived(TObject *Sender,
          const TwclBluetoothLeAdvertisingPduHeader &PduHeader,
          const __int64 InitA, const __int64 AdvA,
          const TwclBleSnifferLlData &LlData);
private:	// User declarations
        void DumpHeader(const TwclBluetoothLePacketHeader& Header);
        void DumpPduHeader(
          const TwclBluetoothLeAdvertisingPduHeader& PduHeader);
        void DumpPayload(const Pointer Payload, const WORD Size);
public:		// User declarations
        __fastcall TfmMain(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TfmMain *fmMain;
//---------------------------------------------------------------------------
#endif
