//
// Copyright: © 2009 Sierra Wireless Inc., all rights reserved
//

// SimpleCMDlg.h : header file
//

#pragma once
#include "afxwin.h"
#include <GobiConnectionMgmtAPI.h>
#include "SwiWwanCmApi.h"

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

// Dialog Data
	enum { IDD = IDD_SIMPLECM_DIALOG };

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

// Implementation
protected:
	HICON m_hIcon;

	// GUI fields
	CString m_szRssi;
	CString m_szCarrier;
	CString m_szApn;
	CString m_szUsername;
	CString m_szPassword;
	CString m_szStatus;
	CComboBox m_cmbTech;

	// Connection session ID
	ULONG	m_nSessionId;

	// get signal strengths function pointer prototype
	typedef ULONG (__stdcall * tFNGetSignalStrengths)(
		ULONG *	pArraySize,
		INT8 *	pSignalStrength,
		ULONG * pRadioInterface 
		);

	// get PIN status function pointer prototype
	typedef ULONG (__stdcall * tFNUIMGetPINStatus)(
		ULONG	id, 
		ULONG*	pStatus, 
		ULONG*	pVerifyRetriesLeft, 
		ULONG*	pUnblockRetriesLeft 
		);

	// get session state function pointer prototype
	typedef ULONG (__stdcall * tFNUIMGetSessionState)(
		ULONG*	pState
		);

	// Initialize GobiApi
	BOOL Initialize();

	// Search for available device
	BOOL DeviceSearch();

	// Enable/Disable user editable controls
	void EnableControls(BOOL bEnable=TRUE);	

	// Get network information
	void GetNetworkInfo();

	// Get device state information
	void GetDeviceState();

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

	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg LRESULT OnNotifSignalStrength(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnNotifSessionState(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnNotifDeviceRemoval(WPARAM wParam, LPARAM lParam);
public:
	afx_msg void OnDestroy();
	afx_msg void OnBnClickedBtnConnect();

	
};
