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

#ifndef mainH
#define mainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "wclBluetooth.hpp"
#include "wclUUIDs.hpp"
#include <ComCtrls.hpp>
//---------------------------------------------------------------------------
class TfmMain : public TForm
{
__published:	// IDE-managed Components
        TLabel *laReadBuffer;
        TLabel *laWriteBuffer;
        TButton *btListen;
        TButton *btClose;
        TListBox *lbEvents;
        TButton *btClear;
        TListView *lvClients;
        TButton *btDisconnect;
        TEdit *edText;
        TButton *btSend;
        TButton *btGetBuffers;
        TButton *btSetBuffers;
        TEdit *edReadBuffer;
        TEdit *edWriteBuffer;
        TCheckBox *cbAuthentication;
        TCheckBox *cbEcnryption;
        TwclBluetoothManager *wclBluetoothManager;
        TwclRfCommServer *wclRfCommServer;
        TLabel *laServiceName;
        TEdit *edServiceName;
        void __fastcall btClearClick(TObject *Sender);
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall btListenClick(TObject *Sender);
        void __fastcall btCloseClick(TObject *Sender);
        void __fastcall btDisconnectClick(TObject *Sender);
        void __fastcall btSendClick(TObject *Sender);
        void __fastcall btGetBuffersClick(TObject *Sender);
        void __fastcall btSetBuffersClick(TObject *Sender);
        void __fastcall wclBluetoothManagerNumericComparison(
          TObject *Sender, const TwclBluetoothRadio *Radio,
          const __int64 Address, const DWORD Number, bool& Confirm);
        void __fastcall wclBluetoothManagerPasskeyNotification(
          TObject *Sender, const TwclBluetoothRadio *Radio,
          const __int64 Address, const DWORD Passkey);
        void __fastcall wclBluetoothManagerPasskeyRequest(TObject *Sender,
          const TwclBluetoothRadio *Radio, const __int64 Address,
          DWORD& Passkey);
        void __fastcall wclBluetoothManagerPinRequest(TObject *Sender,
          const TwclBluetoothRadio *Radio, const __int64 Address,
          String& Pin);
        void __fastcall wclRfCommServerClosed(TObject *Sender,
          const int Reason);
        void __fastcall wclRfCommServerConnect(TObject *Sender,
          const TwclRfCommServerClientConnection *Client, const int Error);
        void __fastcall wclRfCommServerData(TObject *Sender,
          const TwclRfCommServerClientConnection *Client,
          const Pointer Data, const DWORD Size);
        void __fastcall wclRfCommServerDisconnect(TObject *Sender,
          const TwclRfCommServerClientConnection *Client,
          const int Reason);
        void __fastcall wclRfCommServerListen(TObject *Sender);
private:	// User declarations
        TwclBluetoothRadio* __fastcall GetRadio();
        String __fastcall GetDeviceName(__int64 Address);
public:		// User declarations
        __fastcall TfmMain(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TfmMain *fmMain;
//---------------------------------------------------------------------------
#endif
