// WiFiSnifferDlg.h : header file
//

#pragma once

#include "afxcmn.h"
#include "afxwin.h"

#include "..\..\..\..\Source\WiFi\wclWiFi.h"

using namespace wclWiFi;


// CWiFiSnifferDlg dialog
class CWiFiSnifferDlg : public CDialog
{
// Construction
public:
	CWiFiSnifferDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_WIFISNIFFER_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()

private:
	CListCtrl lvIfaces;
	CStatic laMac;
	CStatic laChannel;
	CStatic laPhy;
	CComboBox cbPhy;
	CEdit edChannel;
	CListBox lbRaw;

	CwclWiFiClient Client;
	CwclWiFiSniffer Sniffer;

	void AfterOpen(void* Sender);
	void BeforeClose(void* Sender);
	void OnRawFrameReceived(void* Sender, const void* const Buffer, 
		const unsigned long Size);

	void RefreshChannel();
	void RefreshPhy();
	void ShowError(CString s, const int Error);

public:
	afx_msg void OnDestroy();
	afx_msg void OnBnClickedButtonEnumIfaces();
	afx_msg void OnBnClickedButtonStart();
	afx_msg void OnBnClickedButtonStop();
	afx_msg void OnBnClickedButtonSetPhy();
	afx_msg void OnBnClickedButtonClear();
private:
	CButton cbDoNotChangeMode;
	CStatic laIfaceMode;
};
