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

#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 *laTimeout;
        TLabel *laMilliseconds;
        TLabel *laReadBuffer;
        TLabel *laWriteBuffer;
        TButton *btDiscover;
        TButton *btConnect;
        TButton *btDisconnect;
        TListView *lvDevices;
        TButton *btClearEvents;
        TEdit *edTimeout;
        TEdit *edText;
        TButton *btSend;
        TEdit *edReadBuffer;
        TEdit *edWriteBuffer;
        TButton *btSetBuffers;
        TListBox *lbEvents;
        TCheckBox *cbAuthentication;
        TCheckBox *cbEncryption;
        TButton *btGetBuffers;
        TwclRfCommClient *wclRfCommClient;
        TwclBluetoothManager *wclBluetoothManager;
        TCheckBox *cbServiceName;
        TEdit *edServiceName;
        TButton *btPair;
        TCheckBox *cbEnumPaired;
        TButton *btUnpair;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall btDiscoverClick(TObject *Sender);
        void __fastcall btClearEventsClick(TObject *Sender);
        void __fastcall btConnectClick(TObject *Sender);
        void __fastcall btDisconnectClick(TObject *Sender);
        void __fastcall btSendClick(TObject *Sender);
        void __fastcall btSetBuffersClick(TObject *Sender);
        void __fastcall btGetBuffersClick(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 wclBluetoothManagerDeviceFound(TObject *Sender,
          const TwclBluetoothRadio *Radio, const __int64 Address);
        void __fastcall wclBluetoothManagerDiscoveringCompleted(
          TObject *Sender, const TwclBluetoothRadio *Radio,
          const int Error);
        void __fastcall wclBluetoothManagerDiscoveringStarted(
          TObject *Sender, const TwclBluetoothRadio *Radio);
        void __fastcall wclRfCommClientConnect(TObject *Sender,
          const int Error);
        void __fastcall wclRfCommClientData(TObject *Sender,
          const Pointer Data, const DWORD Size);
        void __fastcall wclRfCommClientDisconnect(TObject *Sender,
          const int Reason);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall wclBluetoothManagerAuthenticationCompleted(
          TObject *Sender, const TwclBluetoothRadio *Radio,
          const __int64 Address, const int Error);
        void __fastcall wclBluetoothManagerConfirm(TObject *Sender,
          const TwclBluetoothRadio *Radio, const __int64 Address,
          bool& Confirm);
        void __fastcall btPairClick(TObject *Sender);
        void __fastcall btUnpairClick(TObject *Sender);
private:	// User declarations
        TwclBluetoothRadio* __fastcall GetRadio();

        void __fastcall GetBuffers();
public:		// User declarations
        __fastcall TfmMain(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TfmMain *fmMain;
//---------------------------------------------------------------------------
#endif
