// MakePacketDlg.h : header file
//

#pragma once
#include "DP5Protocol.h"


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

// Dialog Data
	enum { IDD = IDD_MAKEPACKET_DIALOG };

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

struct Packet_Out {
    BYTE PID1;
    BYTE PID2;
    USHORT LEN;  // signed, but data payload always less than 32768
    BYTE EXPECTEDRESPONSE;
    BYTE DATA[514];
};



// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedButton1();
	BOOL CopyAsciiData(BYTE Data[], CString strData, long lLen);
	BOOL POUT_Buffer(Packet_Out POUT, BYTE Buffer[]);
	afx_msg void OnBnClickedRadioMessageType1();	// send configuration
	afx_msg void OnBnClickedRadioMessageType2();	// request configuration
	afx_msg void OnBnClickedRadioMessageType3();	// send 512 byte misc data
	CString ConfigUChHexValCStr(LPCTSTR lpstrLabel, long intValue);
	CString ShowBytes(UCHAR Buffer[], long lLen); 
	TRANSMIT_PACKET_TYPE XmtCmd;	// Transmit command type for sending message
	BOOL TestPacketCkSumOK(BYTE Data[]);
};











