[Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/imote2/tools/src/iMoteTerm/USB/rev1
ChannelAssignmentWnd.h, NONE, 1.1 ConfigurationPage.h, NONE,
1.1 DataFormatPage.h, NONE, 1.1 DynArray.h, NONE,
1.1 DynQueue.h, NONE, 1.1 IMoteCartesianPlot.h, NONE,
1.1 IMoteListDisp.h, NONE, 1.1 IMoteStatus.h, NONE,
1.1 IMoteTerminal.h, NONE, 1.1 LogFile.h, NONE,
1.1 MappingFunctionDlg.h, NONE, 1.1 PlotInfo.h, NONE,
1.1 RichEditExt.h, NONE, 1.1 SaveSettingsPage.h, NONE,
1.1 SerialPort.h, NONE, 1.1 StdAfx.h, NONE, 1.1 SymTable.h,
NONE, 1.1 USBDevice.h, NONE, 1.1 cmCommand.h, NONE,
1.1 header.h, NONE, 1.1 hidpi.h, NONE, 1.1 hidsdi.h, NONE,
1.1 hidusage.h, NONE, 1.1 iMoteConsole.h, NONE,
1.1 iMoteConsoleDlg.h, NONE, 1.1 qtables.h, NONE,
1.1 resource.h, NONE, 1.1 sampleHeader.h, NONE,
1.1 ChannelAssignmentWnd.cpp, NONE, 1.1 ConfigurationPage.cpp,
NONE, 1.1 Copy of IMoteTerminal.cpp, NONE,
1.1 DataFormatPage.cpp, NONE, 1.1 DynArray.cpp, NONE,
1.1 DynQueue.cpp, NONE, 1.1 IMoteCartesianPlot.cpp, NONE,
1.1 IMoteListDisp.cpp, NONE, 1.1 IMoteStatus.cpp, NONE,
1.1 IMoteTerminal.cpp, NONE, 1.1 LogFile.cpp, NONE,
1.1 MappingFunctionDlg.cpp, NONE, 1.1 PlotInfo.cpp, NONE,
1.1 RichEditExt.cpp, NONE, 1.1 SaveSettingsPage.cpp, NONE,
1.1 SerialPort.cpp, NONE, 1.1 StdAfx.cpp, NONE,
1.1 SymTable.cpp, NONE, 1.1 USBDevice.cpp, NONE,
1.1 iMoteConsole.cpp, NONE, 1.1 iMoteConsoleDlg.cpp, NONE,
1.1 iMoteConsole.sln, NONE, 1.1 iMoteConsole.suo, NONE,
1.1 hid.lib, NONE, 1.1
Lama Nachman
lnachman at users.sourceforge.net
Sun Mar 4 23:40:56 PST 2007
Update of /cvsroot/tinyos/tinyos-1.x/contrib/imote2/tools/src/iMoteTerm/USB/rev1
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv6205/rev1
Added Files:
ChannelAssignmentWnd.h ConfigurationPage.h DataFormatPage.h
DynArray.h DynQueue.h IMoteCartesianPlot.h IMoteListDisp.h
IMoteStatus.h IMoteTerminal.h LogFile.h MappingFunctionDlg.h
PlotInfo.h RichEditExt.h SaveSettingsPage.h SerialPort.h
StdAfx.h SymTable.h USBDevice.h cmCommand.h header.h hidpi.h
hidsdi.h hidusage.h iMoteConsole.h iMoteConsoleDlg.h qtables.h
resource.h sampleHeader.h ChannelAssignmentWnd.cpp
ConfigurationPage.cpp Copy of IMoteTerminal.cpp
DataFormatPage.cpp DynArray.cpp DynQueue.cpp
IMoteCartesianPlot.cpp IMoteListDisp.cpp IMoteStatus.cpp
IMoteTerminal.cpp LogFile.cpp MappingFunctionDlg.cpp
PlotInfo.cpp RichEditExt.cpp SaveSettingsPage.cpp
SerialPort.cpp StdAfx.cpp SymTable.cpp USBDevice.cpp
iMoteConsole.cpp iMoteConsoleDlg.cpp iMoteConsole.sln
iMoteConsole.suo hid.lib
Log Message:
Pushed out internal tree
--- NEW FILE: ChannelAssignmentWnd.h ---
#pragma once
// CChannelAssignmentWnd
class CColorCtrl: public CWnd
{
DECLARE_DYNAMIC(CColorCtrl)
public:
CColorCtrl();
virtual ~CColorCtrl();
COLORREF m_color;
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnPaint();
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
};
// CChannelAssignmentWnd
class CChannelConfigCtrl: public CWnd
{
DECLARE_DYNAMIC(CChannelConfigCtrl)
public:
CChannelConfigCtrl();
virtual ~CChannelConfigCtrl();
CColorCtrl m_ColorCtrl;
CEdit m_EditAddress;
CComboBox m_ComboChannel;
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnPaint();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};
class CChannelAssignmentWnd : public CWnd
{
DECLARE_DYNAMIC(CChannelAssignmentWnd)
public:
CChannelAssignmentWnd();
virtual ~CChannelAssignmentWnd();
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnPaint();
CHeaderCtrl m_HeaderCtrl;
CFont m_font;
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
CChannelConfigCtrl m_ChannelConfigCtrl;
};
--- NEW FILE: ConfigurationPage.h ---
#pragma once
#include "afxwin.h"
#include "ChannelAssignmentWnd.h"
// CConfigurationPage dialog
class CConfigurationPage : public CPropertyPage
{
DECLARE_DYNAMIC(CConfigurationPage)
public:
CConfigurationPage(COMMCONFIG *CommConfig, CString COMPortName);
virtual ~CConfigurationPage();
// Dialog Data
enum { IDD = IDD_PP_CONFIGURATION };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
void PopulateSystemSerialPorts();
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
CComboBox m_comportComboControl;
COMMCONFIG *m_pCommConfig;
CString m_strPortName;
afx_msg void OnBnClickedButtonSettings();
CString m_comportComboValue;
CChannelAssignmentWnd m_ChannelAssignmentWnd;
};
--- NEW FILE: DataFormatPage.h ---
#pragma once
// CDataFormatPage dialog
struct SDataFormatSettings
{
bool b16BitData, bMagicNumber, bChannelID,bFragmentLength;
unsigned int MagicNumberSize,ChannelIDSize, FragmentLengthSize;
unsigned int MagicNumberValue;
};
class CDataFormatPage : public CPropertyPage
{
DECLARE_DYNAMIC(CDataFormatPage)
public:
CDataFormatPage(SDataFormatSettings *pSettings,CWnd* pParent = NULL); // standard constructor
virtual ~CDataFormatPage();
// Dialog Data
enum { IDD = IDD_PP_DATAFORMAT };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
// afx_msg void OnBnClickedCheck1();
// afx_msg void OnBnClickedCheck1();
afx_msg void OnBnClickedCheck16bitdata();
afx_msg void OnBnClickedCheckChannelid();
afx_msg void OnBnClickedCheckFragmentlength();
afx_msg void OnBnClickedCheckMagicnumber();
virtual BOOL OnInitDialog();
void LoadSettings(void);
void SaveSettings(void);
private:
SDataFormatSettings *m_pSettings;
public:
virtual BOOL OnApply();
};
--- NEW FILE: DynArray.h ---
#pragma once
class CDynArray
{
private:
int iSize;
int iCapacity;
int *ppvArray;
void Grow();
public:
CDynArray();
~CDynArray();
void Add(int i);
int Get(int line);
int GetSize();
void Clear();
void Pop();
};
--- NEW FILE: DynQueue.h ---
#pragma once
/* A DynQueue is an fifo queue whose length can expand dynamically. */
class CDynQueue
{
public:
CDynQueue(void);
~CDynQueue(void);
int getLength();
void *dequeue();
void enqueue(const void *pvItem);
void push(const void *pvItem); //puts an item at the head of the queue
void *peek();
private:
unsigned int iLength;
unsigned int iPhysLength;
unsigned int index;
const void **ppvQueue;
void shiftgrow();
};
--- NEW FILE: IMoteCartesianPlot.h ---
#pragma once
// CIMoteCartesianPlot
#include "PlotInfo.h"
#define MAXVAL (65536)
#define SCALINGFACTOR (2)
class CIMoteCartesianPlot : public CFrameWnd
{
DECLARE_DYNAMIC(CIMoteCartesianPlot)
public:
CIMoteCartesianPlot(CPlotInfo *plotinfo,UINT ChannelID,UINT iMoteID);
virtual ~CIMoteCartesianPlot();
protected:
DECLARE_MESSAGE_MAP()
HICON m_hIcon;
public:
// virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
void PrepareDC(CDC *pDC);
void DrawBackground(CDC *pDC);
void DrawCartesian(CDC* pDC,bool bRedrawAll=false);
afx_msg void OnPaint();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
int ZoomIndex;
double ZoomSettings[5];
int m_LastDrawIndex;
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
void SetMappingFunction(int MinRange, int MaxRange);
UINT m_nTimerID;
UINT m_iMoteID;
UINT m_ChannelID;
UINT m_DataID;
int m_MappingMinRange,m_MappingMaxRange;
CPlotInfo *m_plotinfo;
afx_msg void OnDestroy();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnEditSetmappingfunction();
afx_msg void OnClose();
};
--- NEW FILE: IMoteListDisp.h ---
#pragma once
#include "plotinfo.h"
#include <afxtempl.h>
// CIMoteListDisp frame
struct SMoteInf{
CPlotInfo *m_plotinfo;
UINT m_ChannelID;
UINT m_iMoteID;
UINT m_LastDispPoint;
CString headers[3];
};
class CIMoteListDisp : public CFrameWnd
{
DECLARE_DYNCREATE(CIMoteListDisp)
bool AddMote(CPlotInfo *plotinfo,UINT ChannelID,UINT iMoteID,CString header1, CString header2, CString header3);
CIMoteListDisp(); // protected constructor used by dynamic creation
virtual ~CIMoteListDisp();
bool m_bCreated;
protected:
DECLARE_MESSAGE_MAP()
UINT m_nTimerID;
HICON m_hIcon;
CPtrArray m_MoteInfArray;
CListCtrl m_ListCtrl;
public:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
afx_msg void OnClose();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnSize(UINT nType, int cx, int cy);
int UpdateList(void);
};
--- NEW FILE: IMoteStatus.h ---
#pragma once
#include "afxwin.h"
#include "afxcmn.h"
// CIMoteStatus dialog
class CIMoteStatus : public CDialog
{
DECLARE_DYNAMIC(CIMoteStatus)
public:
CIMoteStatus(CWnd* pParent = NULL); // standard constructor
virtual ~CIMoteStatus();
// Dialog Data
enum { IDD = IDD_IMOTESTATUS };
protected:
HICON m_hIcon;
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
private:
CWnd *m_parent;
DWORD m_iBurn;
DWORD m_nBurn;
DWORD m_iVerify;
DWORD m_nVerify;
CString m_dev;
public:
CStatic m_burnStatic;
CStatic m_verifyStatic;
CProgressCtrl m_burnProgress;
CProgressCtrl m_verifyProgress;
void UpdateStatus(DWORD iBurn, DWORD nBurn, DWORD iVerify, DWORD nVerify, BYTE toUpdate);
void GetStatus(DWORD *iBurn, DWORD *nBurn, DWORD *iVerify, DWORD *nVerify);
protected:
virtual void OnCancel();
};
--- NEW FILE: IMoteTerminal.h ---
#pragma once
#include "RichEditExt.h"
#include "DynArray.h"
#include "USBDevice.h"
#include "SerialPort.h"
#include "IMoteStatus.h"
class CIMoteTerminal;
#include "iMoteConsoleDlg.h"
#include "afxwin.h"
#include "afxcmn.h"
// CIMoteTerminal dialog
#include "sampleHeader.h"
class CIMoteTerminal : public CDialog
{
DECLARE_DYNAMIC(CIMoteTerminal)
public:
CIMoteTerminal(CWnd* pParent = NULL, CUSBDevice *dev = NULL, bool att = false);
virtual ~CIMoteTerminal();
void ScrollToBottom();
void ScrollToTop();
bool Scroll(bool up);
void UpdateText();
void BufferAppend(char x, bool refresh);
void BufferAppend(CString x);
void BufferAppend(char *y);
void BufferAppend(char * y, DWORD len);
void WidthAdjustment();
void SendData(BYTE *data, DWORD len, BYTE type);
void SendData(CString data);
void setAttached(bool att);
bool isAttached();
void setPath(TCHAR *path);
void DisplayChange();
void checkBinary(BYTE *data, DWORD BytesToCheck, DWORD Packet);
void Connect();
void Disconnect();
CUSBDevice *m_usb;
// Dialog Data
enum { IDD = IDD_IMOTETERMINAL };
protected:
HICON m_hIcon;
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
private:
CWnd *m_parent;
CRichEditExt m_outputRichEditControl;
CRichEditCtrl m_fileRichEditControl;
SCROLLINFO m_outputScrollInfo;
CSerialPort *m_serialport;
USBdata m_dataIn[IMOTE_HID_TYPE_COUNT];
bool m_attached;
CDynArray m_lines;
int m_trueLines;
int m_trueCurLine;
int m_curLine;
CString m_buffer;
CString m_bufferTrue;
CString m_visible;
int m_sizeCount, m_prevMaxCharCount;
CString m_fileSaveName;
CString m_fileOpenName;
CString m_curDir;
CIMoteStatus *m_sendFileStatus;
bool m_sendFileBusy;
BYTE *m_lastSendFile;
bool m_lastSendFileValid;
DWORD m_lastSendFileIndex;
HACCEL m_hAccel;
HANDLE binaryFile;
public:
virtual BOOL OnInitDialog();
afx_msg void OnUpdateTermEditEcho(CCmdUI *pCmdUI);
afx_msg void OnTermEditEcho();
afx_msg void OnBnClickedButtonTermSendbreak();
afx_msg void OnBnClickedButtonTermClearBuffer();
afx_msg void OnBnClickedButtonTermConnect();
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
afx_msg void OnTermEditClearBuffer();
afx_msg void OnTermEditConnect();
CButton m_connectButton;
CButton m_sendBreakButton;
CButton m_sendFileButton;
CButton m_textFileCheck;
CStatic m_detachedStatic;
CStatic m_comNumStatic;
BOOL m_bTextFile;
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
afx_msg LRESULT OnReceiveUSBData(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnReceiveSerialData(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnClosePort(WPARAM wParam, LPARAM lParam);
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnTermFileSave();
afx_msg void OnTermFileHide();
afx_msg void OnTermEditCopy();
afx_msg void OnTermFileSaveAs();
afx_msg void OnBnClickedButtonTermSendFile();
afx_msg void OnTermFileOpenFile();
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnClose();
CRichEditCtrl m_addrRichEditControl;
CButton m_executeButton;
CStatic m_addrStatic;
afx_msg void OnBnClickedButtonTermExecute();
afx_msg void OnTermEditExecute();
CString m_addrString;
int processJTPacket(USBdata *USBin, BYTE validBytes);
};
--- NEW FILE: LogFile.h ---
#pragma once
// CLogFile document
class CLogFile : public CDocument
{
DECLARE_DYNCREATE(CLogFile)
public:
CLogFile();
virtual ~CLogFile();
virtual void Serialize(CArchive& ar); // overridden for document i/o
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
void setBuffer(CString * buffer);
private:
CString *m_pBuffer;
protected:
virtual BOOL OnNewDocument();
DECLARE_MESSAGE_MAP()
};
--- NEW FILE: MappingFunctionDlg.h ---
#pragma once
// CMappingFunctionDlg dialog
class CMappingFunctionDlg : public CDialog
{
DECLARE_DYNAMIC(CMappingFunctionDlg)
public:
CMappingFunctionDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CMappingFunctionDlg();
// Dialog Data
enum { IDD = IDD_DIALOG_MAPPINGFUNCTION };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
int m_EditMinRangeValue;
int m_EditMaxRangeValue;
};
--- NEW FILE: PlotInfo.h ---
// PlotInfo.h: interface for the CPlotInfo class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_PLOTINFO_H__C4DFF996_A32F_4741_9490_715D0FD47D2C__INCLUDED_)
#define AFX_PLOTINFO_H__C4DFF996_A32F_4741_9490_715D0FD47D2C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define NUMPOINTS (3000)
//#define NUMPOINTS (450)
#define BUFLEN (6)
#define TIMESTAMP_VALID 0x1
#define X_VALID 0x2
#define Y_VALID 0x4
#define Z_VALID 0x8
class CPlotInfo : public CObject
{
public:
CPlotInfo();
virtual ~CPlotInfo();
int pointcount;
unsigned char validmask;
int bufpos;
POINT buffer[BUFLEN];;
long x[NUMPOINTS];
long y[NUMPOINTS];
long z[NUMPOINTS];
CString timestamps[NUMPOINTS];
void Serialize( CArchive& archive );
void SaveAscii( CFile& archive );
unsigned char SetValidMask(unsigned char newmask);
DECLARE_SERIAL(CPlotInfo)
};
#endif // !defined(AFX_PLOTINFO_H__C4DFF996_A32F_4741_9490_715D0FD47D2C__INCLUDED_)
--- NEW FILE: RichEditExt.h ---
#pragma once
//#define OUTPUTLINECOUNT 12
// CRichEditExt
class CRichEditExt : public CRichEditCtrl
{
DECLARE_DYNAMIC(CRichEditExt)
public:
CRichEditExt();
virtual ~CRichEditExt();
protected:
DECLARE_MESSAGE_MAP()
private:
bool m_bEcho;
CWnd *m_parent;
int m_maxLines;
int m_maxChars;
bool m_bInit;
bool m_bDMaxChar;
public:
bool dEcho();
bool getEcho();
void SetParent(CWnd *parent);
bool MaxCharCountChange();
void ExtraInit();
int MaxLineCount();
int MaxCharCount();
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};
--- NEW FILE: SaveSettingsPage.h ---
#pragma once
// CSaveSettingsPage dialog
class CSaveSettingsPage : public CPropertyPage
{
DECLARE_DYNAMIC(CSaveSettingsPage)
public:
CSaveSettingsPage(CWnd* pParent = NULL); // standard constructor
virtual ~CSaveSettingsPage();
// Dialog Data
enum { IDD = IDD_PP_SAVESETTINGS };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
};
--- NEW FILE: SerialPort.h ---
// SerialPort.h: interface for the CSerialPort class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SERIALPORT_H__69D89F91_3784_41DB_8142_AE1A84BDC69B__INCLUDED_)
#define AFX_SERIALPORT_H__69D89F91_3784_41DB_8142_AE1A84BDC69B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "DynQueue.h"
typedef struct __Commdata{
BYTE *data;
DWORD datalen;
} Commdata;
typedef Commdata *PCommdata;
#define WM_RECEIVE_SERIAL_DATA (WM_USER + 1)
#define WM_RECEIVE_USB_DATA (WM_USER + 2)
#define WM_CLOSE_PORT (WM_USER + 3)
class CSerialPort
{
public:
void CheckBuffer(void);
bool IsRxThreadAlive();
bool ClosePort(void);
bool IsConnected();
bool WriteData(BYTE *sendString, DWORD datalen);
bool OpenPort(const char *lpcstrPort, DCB *pDCB);
CSerialPort();
virtual ~CSerialPort();
void SetParent(CWnd *parent);
protected:
static UINT CommThreadRxFunc(LPVOID pParam);
static UINT CommThreadTxFunc(LPVOID pParam);
COMMTIMEOUTS m_commtimeouts;
HANDLE m_hComm;
OVERLAPPED m_rxOv, m_txOv;
HANDLE m_hTxUpdateEvent;
private:
//bool PrivateClosePort(void);
static void OutputError(char *string, DWORD error);
bool m_bConnected;
CWinThread *m_rxThread;
CWinThread *m_txThread;
CWnd *m_parent;
void QueueData(PCommdata data);
void ClearQueue();
CDynQueue m_sendQueue;
public:
bool SetBreak(bool On);
};
#endif // !defined(AFX_SERIALPORT_H__69D89F91_3784_41DB_8142_AE1A84BDC69B__INCLUDED_)
--- NEW FILE: StdAfx.h ---
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__17DA529E_2E26_4F55_976D_7EE13D4562CB__INCLUDED_)
#define AFX_STDAFX_H__17DA529E_2E26_4F55_976D_7EE13D4562CB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#include <afxcoll.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__17DA529E_2E26_4F55_976D_7EE13D4562CB__INCLUDED_)
--- NEW FILE: SymTable.h ---
#ifndef __CSYMTABLE_H
#define __CSYMTABLE_H
typedef struct Binding *Binding_T;
class CSymTable{
public:
CSymTable();
~CSymTable();
int getLength();
bool put(const char *pcKey, const void *pvValue);
bool remove(const char *pcKey);
bool contains(const char *pcKey);
void *get(const char *pcKey);
void map(void (*pfApply)(const char *pcKey, void *pvValue, void *pvExtra), const void *pvExtra);
private:
int iSize;
int iBuckets;
Binding_T *pbList;
unsigned int hash(const char *pcKey);
int incBuckets(int iPrevBuckets);
void expand();
};
#endif
--- NEW FILE: USBDevice.h ---
// USBDevice.h: interface for the CUSBDevice class.
//
//////////////////////////////////////////////////////////////////////
#ifndef __USBDEVICE_H
#define __USBDEVICE_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define vID 0x042b
#define pID 0x1337
extern "C" {
#include "hidsdi.h"
#include <setupapi.h>
}
#include "DynQueue.h"
class CUSBDevice;
typedef struct __USBdata{
__USBdata::__USBdata():data(NULL),i(0),len(0),n(0),type(0){}
BYTE *data;
DWORD i;
DWORD n;
BYTE type;
DWORD len;
} USBdata;
typedef struct __USBmessage{
__USBmessage::__USBmessage(CUSBDevice *u, DWORD bytes, CString serial){usb = u; actualBytesRead = bytes; serialNum = serial;};
CUSBDevice *usb;
DWORD actualBytesRead;
CString serialNum;
} USBmessage;
#define isFlagged(_BITFIELD, _FLAG) (((_BITFIELD) & (_FLAG)) != 0)
#define _BIT(_bit) (1 << ((_bit) & 0x1f))
#define IMOTE_HID_TYPE_COUNT 4
//Imote2 HID report, byte positions
#define IMOTE_HID_TYPE 1
#define IMOTE_HID_NI 2
//Imote2 HID report, type byte, bit positions
#define IMOTE_HID_TYPE_CL 0
#define IMOTE_HID_TYPE_L 2
#define IMOTE_HID_TYPE_H 4
#define IMOTE_HID_TYPE_MSC 5
//Imote2 HID report, type byte, L defintions
#define IMOTE_HID_TYPE_L_BYTE 0
#define IMOTE_HID_TYPE_L_SHORT 1
#define IMOTE_HID_TYPE_L_INT 2
//Imote2 HID report, L sizes
#define IMOTE_HID_TYPE_L_BYTE_SIZE 15871
#define IMOTE_HID_TYPE_L_SHORT_SIZE 3997695
#define IMOTE_HID_TYPE_L_INT_SIZE ULONG_MAX
//Imote2 HID report, type byte, CL defintions
#define IMOTE_HID_TYPE_CL_GENERAL 0
#define IMOTE_HID_TYPE_CL_BINARY 1
#define IMOTE_HID_TYPE_CL_RPACKET 2
#define IMOTE_HID_TYPE_CL_BLUSH 3
//Imote2 HID report, type byte, MSC definitions
#define IMOTE_HID_TYPE_MSC_DEFAULT 0
#define IMOTE_HID_TYPE_MSC_BLOADER 1
//Imote2 HID report, max packet data sizes
#define IMOTE_HID_BYTE_MAXPACKETDATA 62
#define IMOTE_HID_SHORT_MAXPACKETDATA 61
#define IMOTE_HID_INT_MAXPACKETDATA 59
#define WM_RECEIVE_SERIAL_DATA (WM_USER + 1)
#define WM_RECEIVE_USB_DATA (WM_USER + 2)
#define WM_CLOSE_PORT (WM_USER + 3)
class CUSBDevice
{
public:
/*bool IsRxThreadAlive();
bool IsTxThreadAlive();*/
bool CloseDevice(void);
bool IsConnected();
bool WriteData(BYTE *data, DWORD datalen, BYTE type);
bool ConnectDevice();//, HIDP_CAPS Capabilities);
CUSBDevice();
CUSBDevice(CString serial);
virtual ~CUSBDevice();
void setDetail(TCHAR *path);
void SetParent(CWnd* parent);
protected:
static UINT USBThreadRxFunc(LPVOID pParam);
static UINT USBThreadTxFunc(LPVOID pParam);
COMMTIMEOUTS m_commtimeouts;
HANDLE m_hDevice;
OVERLAPPED m_rxOv, m_txOv;
HANDLE m_hTxUpdateEvent;
private:
int SendData(BYTE *data, DWORD requestedBytesWrote);
void QueueData(BYTE *data);
void ClearQueue();
//bool PrivateClosePort(void);
static void OutputError(char *string, DWORD error);
bool m_bConnected;
CWinThread *m_rxThread;
CWinThread *m_txThread;
CWnd *m_parent;
HIDP_CAPS m_Capabilities;
TCHAR *m_pPath;
char *m_serialNumString;
CDynQueue m_sendQueue;
};
#endif // !defined(AFX_USBDEVICE_H__69D89F91_3784_41DB_8142_AE1A84BDC69B__INCLUDED_)
--- NEW FILE: cmCommand.h ---
// All command strings end with 0x00 terminator for send function, and begin with a byte count
// of the real packet.
// auto baud detection
static unsigned char cmd_autobaud[] = { 0x01, 0x55, 0x00};
// command to retrieve the camera module revision
static unsigned char cmd_getrev[] = { 0x04, 0x01, 0x00, 0x00, 0x02, 0x00};
// set uart packet size
static unsigned char cmd_init1[] = { 0x06, 0x00, 0x00, 0x20, 0x00, 0x0C, 0x02, 0x00};
static unsigned char cmd_init2[] = { 0x08, 0x00, 0x00, 0x0C, 0xB9, 0x40, 0xB9, 0x40, 0x02, 0x00};
static unsigned char cmd_init3[] = { 0x0C, 0x00, 0x00, 0x26, 0x01, 0x60, 0x01, 0x60,
0x01, 0x60, 0x01, 0x60, 0x02, 0x00};
// Set the JPEG file size
static unsigned char cmd_init4[] = { 0x08, 0x00, 0x00, 0x3E, 0x03, 0xC0, 0x03, 0xC0, 0x02, 0x00};
//static unsigned char cmd_init4[] = { 0x08, 0x00, 0x00, 0x3E, 0x27, 0x10, 0x27, 0x10, 0x02, 0x00};
//static unsigned char cmd_init4[] = { 0x08, 0x00, 0x00, 0x3E, 0x0A, 0x00, 0x0A, 0x00, 0x02, 0x00};
//
static unsigned char cmd_init5[] = { 0x08, 0x00, 0x00, 0x46, 0x03, 0xC0, 0x03, 0xC0, 0x02, 0x00};
static unsigned char cmd_init6[] = { 0x06, 0x00, 0x00, 0x42, 0x00, 0x00, 0x02, 0x00};
// VIDEO mode
static unsigned char cmd_initcmd[] = { 0x07, 0x00, 0x00, 0xEE, 0x02, 0x00, 0x01, 0x02, 0x00};
static unsigned char cmd_setflow[] = { 0x06, 0x00, 0x00, 0x24, 0x00, 0x01, 0x02, 0x00};
// this cmd takes a snapshot
static unsigned char cmd_initcmd1[] = { 0x06, 0x00, 0x00, 0x04, 0x00, 0x01, 0x02, 0x00};
static unsigned char cmd_getcmd2[] = { 0x04, 0x01, 0x00, 0x04, 0x02, 0x00};
// read status register
static unsigned char cmd_status[] = { 0x04, 0x01, 0x00, 0x74, 0x02, 0x00};
// full reset
static unsigned char cmd_reset[] = { 0x06, 0x00, 0x00, 0x04, 0x10, 0x60, 0x02, 0x00};
// abort image bit 11 of register 04
static unsigned char cmd_abort[] = { 0x06, 0x00, 0x00, 0x04, 0x10, 0x00, 0x02, 0x00};
// General status flags register
#define CM_STATUS_FLAGS 0x74
#define CM_STATUS_FLAGS_AEWB_C_MASK 0x0040
// Auto Exposure/White Balance Convergence
// 0 = Not converted
// 1 = Converged
#define CM_STATUS_FLAGS_FB_C_OK_MASK 0x0080
// Frame Buffer Contents
// 0 = Bad Frame
// 1 = Good Frame
// SET UP INITIAL PARAMETERS
// These values should be either read in from a file or set in some
// other way that does not require recompiling the program everytime
// there is a change
#define PACKET_SIZE 12 // packet size for image transfer
#define CM_SZR_IN_W 352 // Sizer Input Width
#define CM_SZR_IN_H 352 // Sizer Input Height
#define CM_SZR_OUT_W 352 // Sizer Output Width
#define CM_SZR_OUT_H 352 // Sizer Output Height
--- NEW FILE: header.h ---
//---------------------------------------------------------------------
// COPYRIGHT (C) 2000-2001, AGILENT TECHNOLOGIES. ALL RIGHTS RESERVED.
//---------------------------------------------------------------------
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
//---------------------------------------------------------------------
//
// Last modified: $Date: 2007/03/05 07:40:53 $
//
//
// A complete JPEG file starts with SOI marker (0xffd8) and ends
// with EOI marker (0xffd9):
//
// 0xff, 0xd8, {header}, {compressed image data}, 0xff, 0xd9
//
//
// Prepend the default_header[] below to the compressed data
// from HDCP-2010. Skip the first four bytes from the image
// processor:
//
// +-------skip----------+
// 0xff, 0xda, 0xQQ, 0xQQ, compressed image data...
//
//
// This header assumes auto quantization is ~disabled~ and the
// quantization scale factor is 0x100.
//
//
// The SOF0 segment below must be modified to match the actual image
// dimensions and downsample mode.
//
//
// To change the downsample mode, edit the HSF (horizontal sampling factor)
// and VSF (vertical sampling factor) for component 1:
//
// mode
// ------
// 444: -> HSF=1, VSF=1
// 422: -> HSF=2, VSF=1
// 411: non-standard JPEG (do not use)
//
//
// HSF and VSF for the other two color components should always be 1
//
//
typedef struct {
BYTE SOI[2];
BYTE APP0[18];
BYTE QTABLE0[69];
BYTE QTABLE1[69];
BYTE QTABLE2[69];
BYTE DCTABLE0[33];
BYTE DCTABLE1[33];
BYTE ACTABLE0[183];
BYTE ACTABLE1[183];
BYTE SOF0[19];
BYTE SOS[14];
} HEADER_4xx;
HEADER_4xx header_4xx = {
//
// SOI
//
{0xff, 0xd8,
},
//
// APP0 : Length = 16, JFIF v1.01
//
{
0xff, 0xe0, 0x00, 0x10,
0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00,
0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
},
//
// quantization table 0
//
{
0xff, 0xdb, 0x00, 0x43,
0x00,
0x08, 0x10, 0x10, 0x13, 0x10, 0x13, 0x16, 0x16,
0x16, 0x16, 0x16, 0x16, 0x1a, 0x18, 0x1a, 0x1b,
0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b,
0x1b, 0x1d, 0x1d, 0x1d, 0x22, 0x22, 0x22, 0x1c,
0x1d, 0x1d, 0x1b, 0x1b, 0x1d, 0x1d, 0x20, 0x20,
0x22, 0x22, 0x25, 0x26, 0x25, 0x23, 0x23, 0x22,
0x23, 0x26, 0x26, 0x28, 0x28, 0x28, 0x30, 0x30,
0x24, 0x2e, 0x38, 0x38, 0x3a, 0x45, 0x45, 0x53,
},
{
//
// quantization table 1
//
0xff, 0xdb, 0x00, 0x43,
0x01,
0x08, 0x10, 0x10, 0x13, 0x10, 0x13, 0x16, 0x16,
0x16, 0x16, 0x16, 0x16, 0x1a, 0x18, 0x1a, 0x1b,
0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b,
0x1b, 0x1d, 0x1d, 0x1d, 0x22, 0x22, 0x22, 0x1c,
0x1d, 0x1d, 0x1b, 0x1b, 0x1d, 0x1d, 0x20, 0x20,
0x22, 0x22, 0x25, 0x26, 0x25, 0x23, 0x23, 0x22,
0x23, 0x26, 0x26, 0x28, 0x28, 0x28, 0x30, 0x30,
0x24, 0x2e, 0x38, 0x38, 0x3a, 0x45, 0x45, 0x53,
},
//
// quantization table 2
//
{
0xff, 0xdb, 0x00, 0x43,
0x02,
0x08, 0x10, 0x10, 0x13, 0x10, 0x13, 0x16, 0x16,
0x16, 0x16, 0x16, 0x16, 0x1a, 0x18, 0x1a, 0x1b,
0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b,
0x1b, 0x1d, 0x1d, 0x1d, 0x22, 0x22, 0x22, 0x1c,
0x1d, 0x1d, 0x1b, 0x1b, 0x1d, 0x1d, 0x20, 0x20,
0x22, 0x22, 0x25, 0x26, 0x25, 0x23, 0x23, 0x22,
0x23, 0x26, 0x26, 0x28, 0x28, 0x28, 0x30, 0x30,
0x24, 0x2e, 0x38, 0x38, 0x3a, 0x45, 0x45, 0x53,
},
{
//
// DHT : Length = 31,
//
0xff, 0xc4, 0x00, 0x1f,
// DC Table 0
0x00,
0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b,
},
{
//
// DHT : Length = 31,
//
0xff, 0xc4, 0x00, 0x1f,
// DC Table 1
0x01,
0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b,
},
{
//
// DHT : Length = 181
//
0xff, 0xc4, 0x00, 0xb5,
// AC Table 0
0x10,
0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03,
0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d,
0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa,
},
{
//
// DHT : Length = 181
//
0xff, 0xc4, 0x00, 0xb5,
// AC Table 1
0x11,
0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04,
0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77,
0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa,
},
{
//
// SOF0 : Length = 17,
//
0xff, 0xc0, 0x00, 0x11,
0x08, // Sample precision
// 0x00, 0xf0, // Number of rows = 240 (0xf0)
// 0x01, 0x40, // Number of columns = 320 (0x140)
0x00, 96>>1, // Number of rows
0x00, 128>>1, // Number of columns
0x03, // Number of components
0x01, 0x21, 0x00, // Component 1: HSF= 2, VSF = 1, Q Table = 0
0x02, 0x11, 0x01, // Component 2: HSF= 1, VSF = 1, Q Table = 1
0x03, 0x11, 0x02, // Component 3: HSF= 1, VSF = 1, Q Table = 2
},
{
//
// SOS : Length = 12,
//
0xff, 0xda, 0x00, 0x0c,
0x03, // Number of components
0x01, 0x00, // Component 1: DC table 0, AC table 0
0x02, 0x11, // Component 2: DC table 1, AC table 1
0x03, 0x11, // Component 3: DC table 1, AC table 1
0x00, // Start of spectral selection
0x3f, // End of spectral selection
0x00, // Successive approximation high/low
}
//
// ------ compressed image data goes here ----------
//
//
// EOI
//
//0xff, 0xd9 (this marker is inserted into data stream by HDCP-2000/2010)
};
typedef struct {
BYTE SOI[2];
BYTE APP0[18];
BYTE QTABLE0[69];
BYTE DCTABLE0[33];
BYTE ACTABLE0[183];
BYTE SOF0[13];
BYTE SOS[10];
} HEADER_GRAY;
HEADER_GRAY header_gray = {
// SOI
{ 0xff, 0xd8 },
// APP0
{ 0xff, 0xe0, 0x00, 0x10,
0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00,
0x00, 0x01, 0x00, 0x01, 0x00, 0x00
},
// QTABLE0
{
0xff, 0xdb, 0x00, 0x43, 0x00,
0x08, 0x10, 0x10, 0x13, 0x10, 0x13, 0x16, 0x16,
0x16, 0x16, 0x16, 0x16, 0x1a, 0x18, 0x1a, 0x1b,
0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b,
0x1b, 0x1d, 0x1d, 0x1d, 0x22, 0x22, 0x22, 0x1c,
0x1d, 0x1d, 0x1b, 0x1b, 0x1d, 0x1d, 0x20, 0x20,
0x22, 0x22, 0x25, 0x26, 0x25, 0x23, 0x23, 0x22,
0x23, 0x26, 0x26, 0x28, 0x28, 0x28, 0x30, 0x30,
0x24, 0x2e, 0x38, 0x38, 0x3a, 0x45, 0x45, 0x53
},
// DCTABLE 0
{
0xff, 0xc4, 0x00, 0x1f,
// DC Table 0
0x00,
0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b
},
// ACTABLE 0
{
0xff, 0xc4, 0x00, 0xb5,
0x10,
0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03,
0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d,
0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa
},
// SOF0
{
0xff, 0xc0, 0x00, 0x0b,
0x08, // Sample precision
0x00, 8, // Number of rows
0x00, 8, // Number of columns
0x01, // Number of components
0x01, 0x11, 0x00, // Component 1: HSF= 1, VSF = 1, Q Table = 0
},
// SOS
{ 0xff, 0xda, 0x00, 0x08,
0x01, // Number of components
0x01, 0x00, // Component 1: DC table 0, AC table 0
0x00, // Start of spectral selection
0x3f, // End of spectral selection
0x00,
}
};
#define HEADER_LENGTH sizeof(default_header) / sizeof(unsigned char)
unsigned char gray_header[]= {
//
// SOI
//
0xff, 0xd8,
//
// APP0 : Length = 16, JFIF v1.01
//
0xff, 0xe0, 0x00, 0x10,
0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00,
0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
//
// quantization table 0
//
0xff, 0xdb, 0x00, 0x43, 0x00,
0x08, 0x10, 0x10, 0x13, 0x10, 0x13, 0x16, 0x16,
0x16, 0x16, 0x16, 0x16, 0x1a, 0x18, 0x1a, 0x1b,
0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b,
0x1b, 0x1d, 0x1d, 0x1d, 0x22, 0x22, 0x22, 0x1c,
0x1d, 0x1d, 0x1b, 0x1b, 0x1d, 0x1d, 0x20, 0x20,
0x22, 0x22, 0x25, 0x26, 0x25, 0x23, 0x23, 0x22,
0x23, 0x26, 0x26, 0x28, 0x28, 0x28, 0x30, 0x30,
0x24, 0x2e, 0x38, 0x38, 0x3a, 0x45, 0x45, 0x53,
////
//// quantization table 1
////
//0xff, 0xdb, 0x00, 0x43, 0x01,
//
// 0x08, 0x10, 0x10, 0x13, 0x10, 0x13, 0x16, 0x16,
// 0x16, 0x16, 0x16, 0x16, 0x1a, 0x18, 0x1a, 0x1b,
// 0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b,
// 0x1b, 0x1d, 0x1d, 0x1d, 0x22, 0x22, 0x22, 0x1c,
// 0x1d, 0x1d, 0x1b, 0x1b, 0x1d, 0x1d, 0x20, 0x20,
// 0x22, 0x22, 0x25, 0x26, 0x25, 0x23, 0x23, 0x22,
// 0x23, 0x26, 0x26, 0x28, 0x28, 0x28, 0x30, 0x30,
// 0x24, 0x2e, 0x38, 0x38, 0x3a, 0x45, 0x45, 0x53,
//
////
//// quantization table 2
////
//0xff, 0xdb, 0x00, 0x43, 0x02,
//
// 0x08, 0x10, 0x10, 0x13, 0x10, 0x13, 0x16, 0x16,
// 0x16, 0x16, 0x16, 0x16, 0x1a, 0x18, 0x1a, 0x1b,
// 0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b,
// 0x1b, 0x1d, 0x1d, 0x1d, 0x22, 0x22, 0x22, 0x1c,
// 0x1d, 0x1d, 0x1b, 0x1b, 0x1d, 0x1d, 0x20, 0x20,
// 0x22, 0x22, 0x25, 0x26, 0x25, 0x23, 0x23, 0x22,
// 0x23, 0x26, 0x26, 0x28, 0x28, 0x28, 0x30, 0x30,
// 0x24, 0x2e, 0x38, 0x38, 0x3a, 0x45, 0x45, 0x53,
//
// DHT : Length = 31,
//
0xff, 0xc4, 0x00, 0x1f,
// DC Table 0
0x00,
0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b,
////
//// DHT : Length = 31,
////
//0xff, 0xc4, 0x00, 0x1f,
//
// // DC Table 1
// 0x01,
// 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
// 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
// 0x08, 0x09, 0x0a, 0x0b,
//
// DHT : Length = 181
//
0xff, 0xc4, 0x00, 0xb5,
// AC Table 0
0x10,
0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03,
0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d,
0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa,
////
//// DHT : Length = 181
////
//0xff, 0xc4, 0x00, 0xb5,
//
// // AC Table 1
// 0x11,
// 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04,
// 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77,
// 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
// 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
// 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
// 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
// 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
// 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
// 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
// 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
// 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
// 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
// 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
// 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
// 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
// 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
// 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
// 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
// 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
// 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
// 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
// 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
// 0xf9, 0xfa,
////
//// DRI : Restart Interval = 0 MCU
////
//0xff, 0xdd, 0x00, 0x04, 0x00, 0x00,
//
// SOF0 : Length = 11,
//
0xff, 0xc0, 0x00, 0x0b,
0x08, // Sample precision
// 0x00, 0xf0, // Number of rows = 240 (0xf0)
// 0x01, 0x40, // Number of columns = 320 (0x140)
0x00, 96>>1, // Number of rows
0x00, 128>>1, // Number of columns
0x01, // Number of components
0x01, 0x11, 0x00, // Component 1: HSF= 1, VSF = 1, Q Table = 0
//
// SOS : Length = 8,
//
0xff, 0xda, 0x00, 0x08,
0x03, // Number of components
0x01, 0x00, // Component 1: DC table 0, AC table 0
0x00, // Start of spectral selection
0x3f, // End of spectral selection
0x00, // Successive approximation high/low
//
// ------ compressed image data goes here ----------
//
//
// EOI
//
//0xff, 0xd9 (this marker is inserted into data stream by HDCP-2000/2010)
};
unsigned char default_header[]= {
//
// SOI
//
0xff, 0xd8,
//
// APP0 : Length = 16, JFIF v1.01
//
0xff, 0xe0, 0x00, 0x10,
0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00,
0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
//
// quantization table 0
//
0xff, 0xdb, 0x00, 0x43, 0x00,
0x08, 0x10, 0x10, 0x13, 0x10, 0x13, 0x16, 0x16,
0x16, 0x16, 0x16, 0x16, 0x1a, 0x18, 0x1a, 0x1b,
0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b,
0x1b, 0x1d, 0x1d, 0x1d, 0x22, 0x22, 0x22, 0x1c,
0x1d, 0x1d, 0x1b, 0x1b, 0x1d, 0x1d, 0x20, 0x20,
0x22, 0x22, 0x25, 0x26, 0x25, 0x23, 0x23, 0x22,
0x23, 0x26, 0x26, 0x28, 0x28, 0x28, 0x30, 0x30,
0x24, 0x2e, 0x38, 0x38, 0x3a, 0x45, 0x45, 0x53,
//
// quantization table 1
//
0xff, 0xdb, 0x00, 0x43, 0x01,
0x08, 0x10, 0x10, 0x13, 0x10, 0x13, 0x16, 0x16,
0x16, 0x16, 0x16, 0x16, 0x1a, 0x18, 0x1a, 0x1b,
0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b,
0x1b, 0x1d, 0x1d, 0x1d, 0x22, 0x22, 0x22, 0x1c,
0x1d, 0x1d, 0x1b, 0x1b, 0x1d, 0x1d, 0x20, 0x20,
0x22, 0x22, 0x25, 0x26, 0x25, 0x23, 0x23, 0x22,
0x23, 0x26, 0x26, 0x28, 0x28, 0x28, 0x30, 0x30,
0x24, 0x2e, 0x38, 0x38, 0x3a, 0x45, 0x45, 0x53,
//
// quantization table 2
//
0xff, 0xdb, 0x00, 0x43, 0x02,
0x08, 0x10, 0x10, 0x13, 0x10, 0x13, 0x16, 0x16,
0x16, 0x16, 0x16, 0x16, 0x1a, 0x18, 0x1a, 0x1b,
0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b,
0x1b, 0x1d, 0x1d, 0x1d, 0x22, 0x22, 0x22, 0x1c,
0x1d, 0x1d, 0x1b, 0x1b, 0x1d, 0x1d, 0x20, 0x20,
0x22, 0x22, 0x25, 0x26, 0x25, 0x23, 0x23, 0x22,
0x23, 0x26, 0x26, 0x28, 0x28, 0x28, 0x30, 0x30,
0x24, 0x2e, 0x38, 0x38, 0x3a, 0x45, 0x45, 0x53,
//
// DHT : Length = 31,
//
0xff, 0xc4, 0x00, 0x1f,
// DC Table 0
0x00,
0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b,
//
// DHT : Length = 31,
//
0xff, 0xc4, 0x00, 0x1f,
// DC Table 1
0x01,
0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b,
//
// DHT : Length = 181
//
0xff, 0xc4, 0x00, 0xb5,
// AC Table 0
0x10,
0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03,
0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d,
0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa,
//
// DHT : Length = 181
//
0xff, 0xc4, 0x00, 0xb5,
// AC Table 1
0x11,
0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04,
0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77,
0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa,
//
// DRI : Restart Interval = 0 MCU
//
0xff, 0xdd, 0x00, 0x04, 0x00, 0x00,
//
// SOF0 : Length = 17,
//
0xff, 0xc0, 0x00, 0x11,
0x08, // Sample precision
// 0x00, 0xf0, // Number of rows = 240 (0xf0)
// 0x01, 0x40, // Number of columns = 320 (0x140)
0x00, 96>>1, // Number of rows
0x00, 128>>1, // Number of columns
0x03, // Number of components
0x01, 0x21, 0x00, // Component 1: HSF= 2, VSF = 1, Q Table = 0
0x02, 0x11, 0x01, // Component 2: HSF= 1, VSF = 1, Q Table = 1
0x03, 0x11, 0x02, // Component 3: HSF= 1, VSF = 1, Q Table = 2
//
// SOS : Length = 12,
//
0xff, 0xda, 0x00, 0x0c,
0x03, // Number of components
0x01, 0x00, // Component 1: DC table 0, AC table 0
0x02, 0x11, // Component 2: DC table 1, AC table 1
0x03, 0x11, // Component 3: DC table 1, AC table 1
0x00, // Start of spectral selection
0x3f, // End of spectral selection
0x00, // Successive approximation high/low
//
// ------ compressed image data goes here ----------
//
//
// EOI
//
//0xff, 0xd9 (this marker is inserted into data stream by HDCP-2000/2010)
};
#define HEADER_LENGTH sizeof(default_header) / sizeof(unsigned char)
#define GRAY_HEADER_LENGTH sizeof(gray_header) / sizeof(unsigned char)
--- NEW FILE: hidpi.h ---
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
HIDPI.H
Abstract:
Public Interface to the HID parsing library.
Environment:
Kernel & user mode
--*/
#ifndef __HIDPI_H__
[...1749 lines suppressed...]
#define HIDP_STATUS_INTERNAL_ERROR (HIDP_ERROR_CODES(0xC,8))
#define HIDP_STATUS_I8042_TRANS_UNKNOWN (HIDP_ERROR_CODES(0xC,9))
#define HIDP_STATUS_INCOMPATIBLE_REPORT_ID (HIDP_ERROR_CODES(0xC,0xA))
#define HIDP_STATUS_NOT_VALUE_ARRAY (HIDP_ERROR_CODES(0xC,0xB))
#define HIDP_STATUS_IS_VALUE_ARRAY (HIDP_ERROR_CODES(0xC,0xC))
#define HIDP_STATUS_DATA_INDEX_NOT_FOUND (HIDP_ERROR_CODES(0xC,0xD))
#define HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE (HIDP_ERROR_CODES(0xC,0xE))
#define HIDP_STATUS_BUTTON_NOT_PRESSED (HIDP_ERROR_CODES(0xC,0xF))
#define HIDP_STATUS_REPORT_DOES_NOT_EXIST (HIDP_ERROR_CODES(0xC,0x10))
#define HIDP_STATUS_NOT_IMPLEMENTED (HIDP_ERROR_CODES(0xC,0x20))
//
// We blundered this status code.
//
#define HIDP_STATUS_I8242_TRANS_UNKNOWN HIDP_STATUS_I8042_TRANS_UNKNOWN
#include <poppack.h>
#endif
--- NEW FILE: hidsdi.h ---
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
HIDSDI.H
Abstract:
This module contains the PUBLIC definitions for the
code that implements the HID dll.
Environment:
Kernel & user mode
--*/
#ifndef _HIDSDI_H
#define _HIDSDI_H
#include <pshpack4.h>
//#include "wtypes.h"
//#include <windef.h>
//#include <win32.h>
//#include <basetyps.h>
typedef LONG NTSTATUS;
#include "hidusage.h"
#include "hidpi.h"
typedef struct _HIDD_CONFIGURATION {
PVOID cookie;
ULONG size;
ULONG RingBufferSize;
} HIDD_CONFIGURATION, *PHIDD_CONFIGURATION;
typedef struct _HIDD_ATTRIBUTES {
ULONG Size; // = sizeof (struct _HIDD_ATTRIBUTES)
//
// Vendor ids of this hid device
//
USHORT VendorID;
USHORT ProductID;
USHORT VersionNumber;
//
// Additional fields will be added to the end of this structure.
//
} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;
BOOLEAN __stdcall
HidD_GetAttributes (
IN HANDLE HidDeviceObject,
OUT PHIDD_ATTRIBUTES Attributes
);
/*++
Routine Description:
Fill in the given HIDD_ATTRIBUTES structure with the attributes of the
given hid device.
--*/
void __stdcall
HidD_GetHidGuid (
OUT LPGUID HidGuid
);
BOOLEAN __stdcall
HidD_GetPreparsedData (
IN HANDLE HidDeviceObject,
OUT PHIDP_PREPARSED_DATA * PreparsedData
);
/*++
Routine Description:
Given a handle to a valid Hid Class Device Object, retrieve the preparsed
data for the device. This routine will allocate the appropriately
sized buffer to hold this preparsed data. It is up to client to call
HidP_FreePreparsedData to free the memory allocated to this structure when
it is no longer needed.
Arguments:
HidDeviceObject A handle to a Hid Device that the client obtains using
a call to CreateFile on a valid Hid device string name.
The string name can be obtained using standard PnP calls.
PreparsedData An opaque data structure used by other functions in this
library to retrieve information about a given device.
Return Value:
TRUE if successful.
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_FreePreparsedData (
IN PHIDP_PREPARSED_DATA PreparsedData
);
BOOLEAN __stdcall
HidD_FlushQueue (
IN HANDLE HidDeviceObject
);
/*++
Routine Description:
Flush the input queue for the given HID device.
Arguments:
HidDeviceObject A handle to a Hid Device that the client obtains using
a call to CreateFile on a valid Hid device string name.
The string name can be obtained using standard PnP calls.
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_GetConfiguration (
IN HANDLE HidDeviceObject,
OUT PHIDD_CONFIGURATION Configuration,
IN ULONG ConfigurationLength
);
/*++
Routine Description:
Get the configuration information for this Hid device
Arguments:
HidDeviceObject A handle to a Hid Device Object.
Configuration A configuration structure. HidD_GetConfiguration MUST
be called before the configuration can be modified and
set using HidD_SetConfiguration
ConfigurationLength That is ``sizeof (HIDD_CONFIGURATION)''. Using this
parameter, we can later increase the length of the
configuration array and not break older apps.
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_SetConfiguration (
IN HANDLE HidDeviceObject,
IN PHIDD_CONFIGURATION Configuration,
IN ULONG ConfigurationLength
);
/*++
Routine Description:
Set the configuration information for this Hid device...
NOTE: HidD_GetConfiguration must be called to retrieve the current
configuration information before this information can be modified
and set.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
Configuration A configuration structure. HidD_GetConfiguration MUST
be called before the configuration can be modified and
set using HidD_SetConfiguration
ConfigurationLength That is ``sizeof (HIDD_CONFIGURATION)''. Using this
parameter, we can later increase the length of the
configuration array and not break older apps.
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_GetFeature (
IN HANDLE HidDeviceObject,
OUT PVOID ReportBuffer,
IN ULONG ReportBufferLength
);
/*++
Routine Description:
Retrieve a feature report from a HID device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
ReportBuffer The buffer that the feature report should be placed
into. The first byte of the buffer should be set to
the report ID of the desired report
ReportBufferLength The size (in bytes) of ReportBuffer. This value
should be greater than or equal to the
FeatureReportByteLength field as specified in the
HIDP_CAPS structure for the device
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_SetFeature (
IN HANDLE HidDeviceObject,
IN PVOID ReportBuffer,
IN ULONG ReportBufferLength
);
/*++
Routine Description:
Send a feature report to a HID device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
ReportBuffer The buffer of the feature report to send to the device
ReportBufferLength The size (in bytes) of ReportBuffer. This value
should be greater than or equal to the
FeatureReportByteLength field as specified in the
HIDP_CAPS structure for the device
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_GetInputReport (
IN HANDLE HidDeviceObject,
OUT PVOID ReportBuffer,
IN ULONG ReportBufferLength
);
/*++
Routine Description:
Retrieve an input report from a HID device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
ReportBuffer The buffer that the input report should be placed
into. The first byte of the buffer should be set to
the report ID of the desired report
ReportBufferLength The size (in bytes) of ReportBuffer. This value
should be greater than or equal to the
InputReportByteLength field as specified in the
HIDP_CAPS structure for the device
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_SetOutputReport (
IN HANDLE HidDeviceObject,
IN PVOID ReportBuffer,
IN ULONG ReportBufferLength
);
/*++
Routine Description:
Send an output report to a HID device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
ReportBuffer The buffer of the output report to send to the device
ReportBufferLength The size (in bytes) of ReportBuffer. This value
should be greater than or equal to the
OutputReportByteLength field as specified in the
HIDP_CAPS structure for the device
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_GetNumInputBuffers (
IN HANDLE HidDeviceObject,
OUT PULONG NumberBuffers
);
/*++
Routine Description:
This function returns the number of input buffers used by the specified
file handle to the Hid device. Each file object has a number of buffers
associated with it to queue reports read from the device but which have
not yet been read by the user-mode app with a handle to that device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
NumberBuffers Number of buffers currently being used for this file
handle to the Hid device
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_SetNumInputBuffers (
IN HANDLE HidDeviceObject,
OUT ULONG NumberBuffers
);
/*++
Routine Description:
This function sets the number of input buffers used by the specified
file handle to the Hid device. Each file object has a number of buffers
associated with it to queue reports read from the device but which have
not yet been read by the user-mode app with a handle to that device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
NumberBuffers New number of buffers to use for this file handle to
the Hid device
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_GetPhysicalDescriptor (
IN HANDLE HidDeviceObject,
OUT PVOID Buffer,
IN ULONG BufferLength
);
/*++
Routine Description:
This function retrieves the raw physical descriptor for the specified
Hid device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
Buffer Buffer which on return will contain the physical
descriptor if one exists for the specified device
handle
BufferLength Length of buffer (in bytes)
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_GetManufacturerString (
IN HANDLE HidDeviceObject,
OUT PVOID Buffer,
IN ULONG BufferLength
);
/*++
Routine Description:
This function retrieves the manufacturer string from the specified
Hid device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
Buffer Buffer which on return will contain the manufacturer
string returned from the device. This string is a
wide-character string
BufferLength Length of Buffer (in bytes)
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_GetProductString (
IN HANDLE HidDeviceObject,
OUT PVOID Buffer,
IN ULONG BufferLength
);
/*++
Routine Description:
This function retrieves the product string from the specified
Hid device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
Buffer Buffer which on return will contain the product
string returned from the device. This string is a
wide-character string
BufferLength Length of Buffer (in bytes)
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_GetIndexedString (
IN HANDLE HidDeviceObject,
IN ULONG StringIndex,
OUT PVOID Buffer,
IN ULONG BufferLength
);
/*++
Routine Description:
This function retrieves a string from the specified Hid device that is
specified with a certain string index.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
StringIndex Index of the string to retrieve
Buffer Buffer which on return will contain the product
string returned from the device. This string is a
wide-character string
BufferLength Length of Buffer (in bytes)
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_GetSerialNumberString (
IN HANDLE HidDeviceObject,
OUT PVOID Buffer,
IN ULONG BufferLength
);
/*++
Routine Description:
This function retrieves the serial number string from the specified
Hid device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
Buffer Buffer which on return will contain the serial number
string returned from the device. This string is a
wide-character string
BufferLength Length of Buffer (in bytes)
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
BOOLEAN __stdcall
HidD_GetMsGenreDescriptor (
IN HANDLE HidDeviceObject,
OUT PVOID Buffer,
IN ULONG BufferLength
);
/*++
Routine Description:
This function retrieves the Microsoft Genre descriptor from the specified
Hid device.
Arguments:
HidDeviceObject A handle to a Hid Device Object.
Buffer Buffer which on return will contain the descriptor
returned from the device.
BufferLength Length of Buffer (in bytes)
Return Value:
TRUE if successful
FALSE otherwise -- Use GetLastError() to get extended error information
--*/
#include <poppack.h>
#endif
--- NEW FILE: hidusage.h ---
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
HIDUSAGE.H
Abstract:
Public Definitions of HID USAGES.
Environment:
Kernel & user mode
--*/
#ifndef __HIDUSAGE_H__
#define __HIDUSAGE_H__
//
// Usage Pages
//
typedef USHORT USAGE, *PUSAGE;
#define HID_USAGE_PAGE_UNDEFINED ((USAGE) 0x00)
#define HID_USAGE_PAGE_GENERIC ((USAGE) 0x01)
#define HID_USAGE_PAGE_SIMULATION ((USAGE) 0x02)
#define HID_USAGE_PAGE_VR ((USAGE) 0x03)
#define HID_USAGE_PAGE_SPORT ((USAGE) 0x04)
#define HID_USAGE_PAGE_GAME ((USAGE) 0x05)
#define HID_USAGE_PAGE_KEYBOARD ((USAGE) 0x07)
#define HID_USAGE_PAGE_LED ((USAGE) 0x08)
#define HID_USAGE_PAGE_BUTTON ((USAGE) 0x09)
#define HID_USAGE_PAGE_ORDINAL ((USAGE) 0x0A)
#define HID_USAGE_PAGE_TELEPHONY ((USAGE) 0x0B)
#define HID_USAGE_PAGE_CONSUMER ((USAGE) 0x0C)
#define HID_USAGE_PAGE_DIGITIZER ((USAGE) 0x0D)
#define HID_USAGE_PAGE_UNICODE ((USAGE) 0x10)
#define HID_USAGE_PAGE_ALPHANUMERIC ((USAGE) 0x14)
//
// Usages from Generic Desktop Page (0x01)
//
#define HID_USAGE_GENERIC_POINTER ((USAGE) 0x01)
#define HID_USAGE_GENERIC_MOUSE ((USAGE) 0x02)
#define HID_USAGE_GENERIC_JOYSTICK ((USAGE) 0x04)
#define HID_USAGE_GENERIC_GAMEPAD ((USAGE) 0x05)
#define HID_USAGE_GENERIC_KEYBOARD ((USAGE) 0x06)
#define HID_USAGE_GENERIC_KEYPAD ((USAGE) 0x07)
#define HID_USAGE_GENERIC_SYSTEM_CTL ((USAGE) 0x80)
#define HID_USAGE_GENERIC_X ((USAGE) 0x30)
#define HID_USAGE_GENERIC_Y ((USAGE) 0x31)
#define HID_USAGE_GENERIC_Z ((USAGE) 0x32)
#define HID_USAGE_GENERIC_RX ((USAGE) 0x33)
#define HID_USAGE_GENERIC_RY ((USAGE) 0x34)
#define HID_USAGE_GENERIC_RZ ((USAGE) 0x35)
#define HID_USAGE_GENERIC_SLIDER ((USAGE) 0x36)
#define HID_USAGE_GENERIC_DIAL ((USAGE) 0x37)
#define HID_USAGE_GENERIC_WHEEL ((USAGE) 0x38)
#define HID_USAGE_GENERIC_HATSWITCH ((USAGE) 0x39)
#define HID_USAGE_GENERIC_COUNTED_BUFFER ((USAGE) 0x3A)
#define HID_USAGE_GENERIC_BYTE_COUNT ((USAGE) 0x3B)
#define HID_USAGE_GENERIC_MOTION_WAKEUP ((USAGE) 0x3C)
#define HID_USAGE_GENERIC_VX ((USAGE) 0x40)
#define HID_USAGE_GENERIC_VY ((USAGE) 0x41)
#define HID_USAGE_GENERIC_VZ ((USAGE) 0x42)
#define HID_USAGE_GENERIC_VBRX ((USAGE) 0x43)
#define HID_USAGE_GENERIC_VBRY ((USAGE) 0x44)
#define HID_USAGE_GENERIC_VBRZ ((USAGE) 0x45)
#define HID_USAGE_GENERIC_VNO ((USAGE) 0x46)
#define HID_USAGE_GENERIC_SYSCTL_POWER ((USAGE) 0x81)
#define HID_USAGE_GENERIC_SYSCTL_SLEEP ((USAGE) 0x82)
#define HID_USAGE_GENERIC_SYSCTL_WAKE ((USAGE) 0x83)
#define HID_USAGE_GENERIC_SYSCTL_CONTEXT_MENU ((USAGE) 0x84)
#define HID_USAGE_GENERIC_SYSCTL_MAIN_MENU ((USAGE) 0x85)
#define HID_USAGE_GENERIC_SYSCTL_APP_MENU ((USAGE) 0x86)
#define HID_USAGE_GENERIC_SYSCTL_HELP_MENU ((USAGE) 0x87)
#define HID_USAGE_GENERIC_SYSCTL_MENU_EXIT ((USAGE) 0x88)
#define HID_USAGE_GENERIC_SYSCTL_MENU_SELECT ((USAGE) 0x89)
#define HID_USAGE_GENERIC_SYSCTL_MENU_RIGHT ((USAGE) 0x8A)
#define HID_USAGE_GENERIC_SYSCTL_MENU_LEFT ((USAGE) 0x8B)
#define HID_USAGE_GENERIC_SYSCTL_MENU_UP ((USAGE) 0x8C)
#define HID_USAGE_GENERIC_SYSCTL_MENU_DOWN ((USAGE) 0x8D)
//
// Usages from Simulation Controls Page (0x02)
//
#define HID_USAGE_SIMULATION_RUDDER ((USAGE) 0xBA)
#define HID_USAGE_SIMULATION_THROTTLE ((USAGE) 0xBB)
//
// Virtual Reality Controls Page (0x03)
//
//
// Sport Controls Page (0x04)
//
//
// Game Controls Page (0x05)
//
//
// Keyboard/Keypad Page (0x07)
//
// Error "keys"
#define HID_USAGE_KEYBOARD_NOEVENT ((USAGE) 0x00)
#define HID_USAGE_KEYBOARD_ROLLOVER ((USAGE) 0x01)
#define HID_USAGE_KEYBOARD_POSTFAIL ((USAGE) 0x02)
#define HID_USAGE_KEYBOARD_UNDEFINED ((USAGE) 0x03)
// Letters
#define HID_USAGE_KEYBOARD_aA ((USAGE) 0x04)
#define HID_USAGE_KEYBOARD_zZ ((USAGE) 0x1D)
// Numbers
#define HID_USAGE_KEYBOARD_ONE ((USAGE) 0x1E)
#define HID_USAGE_KEYBOARD_ZERO ((USAGE) 0x27)
// Modifier Keys
#define HID_USAGE_KEYBOARD_LCTRL ((USAGE) 0xE0)
#define HID_USAGE_KEYBOARD_LSHFT ((USAGE) 0xE1)
#define HID_USAGE_KEYBOARD_LALT ((USAGE) 0xE2)
#define HID_USAGE_KEYBOARD_LGUI ((USAGE) 0xE3)
#define HID_USAGE_KEYBOARD_RCTRL ((USAGE) 0xE4)
#define HID_USAGE_KEYBOARD_RSHFT ((USAGE) 0xE5)
#define HID_USAGE_KEYBOARD_RALT ((USAGE) 0xE6)
#define HID_USAGE_KEYBOARD_RGUI ((USAGE) 0xE7)
#define HID_USAGE_KEYBOARD_SCROLL_LOCK ((USAGE) 0x47)
#define HID_USAGE_KEYBOARD_NUM_LOCK ((USAGE) 0x53)
#define HID_USAGE_KEYBOARD_CAPS_LOCK ((USAGE) 0x39)
// Funtion keys
#define HID_USAGE_KEYBOARD_F1 ((USAGE) 0x3A)
#define HID_USAGE_KEYBOARD_F12 ((USAGE) 0x45)
#define HID_USAGE_KEYBOARD_RETURN ((USAGE) 0x28)
#define HID_USAGE_KEYBOARD_ESCAPE ((USAGE) 0x29)
#define HID_USAGE_KEYBOARD_DELETE ((USAGE) 0x2A)
#define HID_USAGE_KEYBOARD_PRINT_SCREEN ((USAGE) 0x46)
// and hundreds more...
//
// LED Page (0x08)
//
#define HID_USAGE_LED_NUM_LOCK ((USAGE) 0x01)
#define HID_USAGE_LED_CAPS_LOCK ((USAGE) 0x02)
#define HID_USAGE_LED_SCROLL_LOCK ((USAGE) 0x03)
#define HID_USAGE_LED_COMPOSE ((USAGE) 0x04)
#define HID_USAGE_LED_KANA ((USAGE) 0x05)
#define HID_USAGE_LED_POWER ((USAGE) 0x06)
#define HID_USAGE_LED_SHIFT ((USAGE) 0x07)
#define HID_USAGE_LED_DO_NOT_DISTURB ((USAGE) 0x08)
#define HID_USAGE_LED_MUTE ((USAGE) 0x09)
#define HID_USAGE_LED_TONE_ENABLE ((USAGE) 0x0A)
#define HID_USAGE_LED_HIGH_CUT_FILTER ((USAGE) 0x0B)
#define HID_USAGE_LED_LOW_CUT_FILTER ((USAGE) 0x0C)
#define HID_USAGE_LED_EQUALIZER_ENABLE ((USAGE) 0x0D)
#define HID_USAGE_LED_SOUND_FIELD_ON ((USAGE) 0x0E)
#define HID_USAGE_LED_SURROUND_FIELD_ON ((USAGE) 0x0F)
#define HID_USAGE_LED_REPEAT ((USAGE) 0x10)
#define HID_USAGE_LED_STEREO ((USAGE) 0x11)
#define HID_USAGE_LED_SAMPLING_RATE_DETECT ((USAGE) 0x12)
#define HID_USAGE_LED_SPINNING ((USAGE) 0x13)
#define HID_USAGE_LED_CAV ((USAGE) 0x14)
#define HID_USAGE_LED_CLV ((USAGE) 0x15)
#define HID_USAGE_LED_RECORDING_FORMAT_DET ((USAGE) 0x16)
#define HID_USAGE_LED_OFF_HOOK ((USAGE) 0x17)
#define HID_USAGE_LED_RING ((USAGE) 0x18)
#define HID_USAGE_LED_MESSAGE_WAITING ((USAGE) 0x19)
#define HID_USAGE_LED_DATA_MODE ((USAGE) 0x1A)
#define HID_USAGE_LED_BATTERY_OPERATION ((USAGE) 0x1B)
#define HID_USAGE_LED_BATTERY_OK ((USAGE) 0x1C)
#define HID_USAGE_LED_BATTERY_LOW ((USAGE) 0x1D)
#define HID_USAGE_LED_SPEAKER ((USAGE) 0x1E)
#define HID_USAGE_LED_HEAD_SET ((USAGE) 0x1F)
#define HID_USAGE_LED_HOLD ((USAGE) 0x20)
#define HID_USAGE_LED_MICROPHONE ((USAGE) 0x21)
#define HID_USAGE_LED_COVERAGE ((USAGE) 0x22)
#define HID_USAGE_LED_NIGHT_MODE ((USAGE) 0x23)
#define HID_USAGE_LED_SEND_CALLS ((USAGE) 0x24)
#define HID_USAGE_LED_CALL_PICKUP ((USAGE) 0x25)
#define HID_USAGE_LED_CONFERENCE ((USAGE) 0x26)
#define HID_USAGE_LED_STAND_BY ((USAGE) 0x27)
#define HID_USAGE_LED_CAMERA_ON ((USAGE) 0x28)
#define HID_USAGE_LED_CAMERA_OFF ((USAGE) 0x29)
#define HID_USAGE_LED_ON_LINE ((USAGE) 0x2A)
#define HID_USAGE_LED_OFF_LINE ((USAGE) 0x2B)
#define HID_USAGE_LED_BUSY ((USAGE) 0x2C)
#define HID_USAGE_LED_READY ((USAGE) 0x2D)
#define HID_USAGE_LED_PAPER_OUT ((USAGE) 0x2E)
#define HID_USAGE_LED_PAPER_JAM ((USAGE) 0x2F)
#define HID_USAGE_LED_REMOTE ((USAGE) 0x30)
#define HID_USAGE_LED_FORWARD ((USAGE) 0x31)
#define HID_USAGE_LED_REVERSE ((USAGE) 0x32)
#define HID_USAGE_LED_STOP ((USAGE) 0x33)
#define HID_USAGE_LED_REWIND ((USAGE) 0x34)
#define HID_USAGE_LED_FAST_FORWARD ((USAGE) 0x35)
#define HID_USAGE_LED_PLAY ((USAGE) 0x36)
#define HID_USAGE_LED_PAUSE ((USAGE) 0x37)
#define HID_USAGE_LED_RECORD ((USAGE) 0x38)
#define HID_USAGE_LED_ERROR ((USAGE) 0x39)
#define HID_USAGE_LED_SELECTED_INDICATOR ((USAGE) 0x3A)
#define HID_USAGE_LED_IN_USE_INDICATOR ((USAGE) 0x3B)
#define HID_USAGE_LED_MULTI_MODE_INDICATOR ((USAGE) 0x3C)
#define HID_USAGE_LED_INDICATOR_ON ((USAGE) 0x3D)
#define HID_USAGE_LED_INDICATOR_FLASH ((USAGE) 0x3E)
#define HID_USAGE_LED_INDICATOR_SLOW_BLINK ((USAGE) 0x3F)
#define HID_USAGE_LED_INDICATOR_FAST_BLINK ((USAGE) 0x40)
#define HID_USAGE_LED_INDICATOR_OFF ((USAGE) 0x41)
#define HID_USAGE_LED_FLASH_ON_TIME ((USAGE) 0x42)
#define HID_USAGE_LED_SLOW_BLINK_ON_TIME ((USAGE) 0x43)
#define HID_USAGE_LED_SLOW_BLINK_OFF_TIME ((USAGE) 0x44)
#define HID_USAGE_LED_FAST_BLINK_ON_TIME ((USAGE) 0x45)
#define HID_USAGE_LED_FAST_BLINK_OFF_TIME ((USAGE) 0x46)
#define HID_USAGE_LED_INDICATOR_COLOR ((USAGE) 0x47)
#define HID_USAGE_LED_RED ((USAGE) 0x48)
#define HID_USAGE_LED_GREEN ((USAGE) 0x49)
#define HID_USAGE_LED_AMBER ((USAGE) 0x4A)
#define HID_USAGE_LED_GENERIC_INDICATOR ((USAGE) 0x3B)
//
// Button Page (0x09)
//
// There is no need to label these usages.
//
//
// Ordinal Page (0x0A)
//
// There is no need to label these usages.
//
//
// Telephony Device Page (0x0B)
//
#define HID_USAGE_TELEPHONY_PHONE ((USAGE) 0x01)
#define HID_USAGE_TELEPHONY_ANSWERING_MACHINE ((USAGE) 0x02)
#define HID_USAGE_TELEPHONY_MESSAGE_CONTROLS ((USAGE) 0x03)
#define HID_USAGE_TELEPHONY_HANDSET ((USAGE) 0x04)
#define HID_USAGE_TELEPHONY_HEADSET ((USAGE) 0x05)
#define HID_USAGE_TELEPHONY_KEYPAD ((USAGE) 0x06)
#define HID_USAGE_TELEPHONY_PROGRAMMABLE_BUTTON ((USAGE) 0x07)
//
// and others...
//
#define HID_USAGE_CONSUMERCTRL ((USAGE)0x01)
#define HID_USAGE_DIGITIZER_PEN ((USAGE)0x02)
#define HID_USAGE_DIGITIZER_IN_RANGE ((USAGE)0x32)
#define HID_USAGE_DIGITIZER_TIP_SWITCH ((USAGE)0x42)
#define HID_USAGE_DIGITIZER_BARREL_SWITCH ((USAGE)0x44)
#endif
--- NEW FILE: iMoteConsole.h ---
// iMoteConsole.h : main header file for the IMOTECONSOLE application
//
#if !defined(AFX_IMOTECONSOLE_H__22611AAE_E17A_492A_A0B6_E23266581A2D__INCLUDED_)
#define AFX_IMOTECONSOLE_H__22611AAE_E17A_492A_A0B6_E23266581A2D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CIMoteConsoleApp:
// See iMoteConsole.cpp for the implementation of this class
//
class CIMoteConsoleApp : public CWinApp
{
public:
CIMoteConsoleApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CIMoteConsoleApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CIMoteConsoleApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IMOTECONSOLE_H__22611AAE_E17A_492A_A0B6_E23266581A2D__INCLUDED_)
--- NEW FILE: iMoteConsoleDlg.h ---
// iMoteConsoleDlg.h : header file
//
#include "SerialPort.h"
#include "USBDevice.h"
#include "SymTable.h"
#include "RichEditExt.h"
#include "IMoteTerminal.h"
#if !defined(AFX_IMOTECONSOLEDLG_H__CADB84BB_FA86_4487_9E9B_023D2C7975AE__INCLUDED_)
#define AFX_IMOTECONSOLEDLG_H__CADB84BB_FA86_4487_9E9B_023D2C7975AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CIMoteConsoleDlg dialog
#include "DataFormatPage.h"
#include "PlotInfo.h"
#include <fstream>
#include "IMoteCartesianPlot.h"
#include "IMoteListDisp.h"
#include "afxwin.h"
#include "afxcmn.h"
#include "dynarray.h"
extern CIMoteConsoleApp theApp;
#define NUMCHANNELS (20)
using namespace std;
class CIMoteConsoleDlg : public CDialog
{
// Construction
public:
CIMoteConsoleDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CIMoteConsoleDlg(); // standard constructor
void LoadProfileInfo(void);
void SaveProfileInfo(void);
// Dialog Data
//{{AFX_DATA(CIMoteConsoleDlg)
enum { IDD = IDD_IMOTECONSOLE_DIALOG };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CIMoteConsoleDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CIMoteConsoleDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnClose();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CToolBar m_wndConnectionToolBar;
int CreateConnectionToolBar(void);
CSymTable *m_terminalList;
SDataFormatSettings *m_pDataFormatSettings;
CObArray m_WindowArray;
BOOL DoRegisterDeviceInterface(GUID InterfaceClassGuid, HDEVNOTIFY *hDevNotify);
HDEVNOTIFY m_devNotificationHandle;
public:
CString m_strPortName;
COMMCONFIG *m_pCommConfig;
void BufferAppend(char x);
void BufferAppend(CIMoteTerminal *out, char x);
void BufferAppend(CIMoteTerminal *out, CString x);
void BufferAppend(CIMoteTerminal *out, char * y);
afx_msg void OnEditOptions();
afx_msg void OnEditNewwin();
afx_msg void OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex,BOOL bSysMenu);
CIMoteCartesianPlot *CreateNewView(UINT ID, UINT iMoteID, UINT channelID);
CIMoteListDisp *CreateNewList(UINT ID, UINT iMoteID, UINT channelID, bool bcreatenew=false, CIMoteListDisp *oldframe=NULL, CString headerX="",CString headerY="",CString headerZ="");
void PopulateUSBDevices();
CPlotInfo plotinfo[NUMCHANNELS];
int MoteIDs[NUMCHANNELS];
ofstream logfile;
void AddPoint(POINT newpoint, int channelID);
CPoint Filter(POINT newpoint, int channelID);
bool smooth;
bool rawdata;
bool bAppClosing;
void SaveLogEntry(CString *str);
void SaveLogEntryToScreen(CString *str);
afx_msg LRESULT OnReceiveData(WPARAM wParam, LPARAM lParam);
void BuildJPG(unsigned char *jpeg_data, int length, unsigned char *whole_jpg, int *whole_jpg_len);
protected:
virtual void OnCancel();
public:
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnEditTest();
afx_msg void OnViewSmooth();
afx_msg void OnUpdateViewSmooth(CCmdUI *pCmdUI);
afx_msg void OnEditTestnewlist();
afx_msg void OnDisplayChange();
int AddMote(void);
CComboBox m_displayedMoteComboControl;
CString m_displayedMoteComboValue;
CStatic m_comNumStatic;
CStatic m_detachedStatic;
afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData);
afx_msg void OnBnClickedButtonWindowBuffer();
afx_msg void OnHelpAbout();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IMOTECONSOLEDLG_H__CADB84BB_FA86_4487_9E9B_023D2C7975AE__INCLUDED_)
--- NEW FILE: qtables.h ---
unsigned char qtable_list[][64]={
{ // table 0
0x75 ,0xeb ,0xeb ,0xff ,0xeb ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
},
{ // table 1
0x6c ,0xd7 ,0xd7 ,0xff ,0xd7 ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
},
{ // table 2
0x63 ,0xc5 ,0xc5 ,0xea ,0xc5 ,0xea ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
},
{ // table 3
0x5b ,0xb5 ,0xb5 ,0xd7 ,0xb5 ,0xd7 ,0xf9 ,0xf9 ,
0xf9 ,0xf9 ,0xf9 ,0xf9 ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
},
{ // table 4
0x53 ,0xa6 ,0xa6 ,0xc5 ,0xa6 ,0xc5 ,0xe4 ,0xe4 ,
0xe4 ,0xe4 ,0xe4 ,0xe4 ,0xff ,0xf9 ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
},
{ // table 5
0x4c ,0x98 ,0x98 ,0xb5 ,0x98 ,0xb5 ,0xd1 ,0xd1 ,
0xd1 ,0xd1 ,0xd1 ,0xd1 ,0xf7 ,0xe4 ,0xf7 ,0xff ,
0xff ,0xff ,0xf7 ,0xf7 ,0xf7 ,0xf7 ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
},
{ // table 6
0x46 ,0x8c ,0x8c ,0xa6 ,0x8c ,0xa6 ,0xc0 ,0xc0 ,
0xc0 ,0xc0 ,0xc0 ,0xc0 ,0xe3 ,0xd1 ,0xe3 ,0xec ,
0xec ,0xec ,0xe3 ,0xe3 ,0xe3 ,0xe3 ,0xec ,0xec ,
0xec ,0xfd ,0xfd ,0xfd ,0xff ,0xff ,0xff ,0xf4 ,
0xfd ,0xfd ,0xec ,0xec ,0xfd ,0xfd ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,
},
{ // table 7
0x40 ,0x80 ,0x80 ,0x98 ,0x80 ,0x98 ,0xb0 ,0xb0 ,
0xb0 ,0xb0 ,0xb0 ,0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01 ,0x01 ,
0x01 ,0x01 ,0x01 ,0x01 ,0x02 ,0x02 ,0x02 ,0x02 ,
0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,
0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,
0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,
0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,0x02 ,
0x02 ,0x02 ,0x02 ,0x03 ,0x03 ,0x03 ,0x03 ,0x03 ,
0x02 ,0x03 ,0x04 ,0x04 ,0x04 ,0x04 ,0x04 ,0x05 ,
},
};
--- NEW FILE: resource.h ---
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by iMoteConsole.rc
//
#define IDI_IMOTE2 5
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_IMOTECONSOLE_DIALOG 102
#define IDD_IMOTETERMINAL 103
#define IDR_MAINFRAME 128
#define IDR_MENU1 130
#define IDD_PP_CONFIGURATION 132
#define IDB_BITMAP_ZOOMIN 132
#define IDB_BITMAP_ZOOMOUT 133
#define IDD_PP_DATAFORMAT 134
#define IDB_BITMAP_CONNECT 134
#define IDD_PP_SAVESETTINGS 135
#define IDB_BITMAP_DISCONNECT 135
#define IDR_ACCELERATOR_CARTESIAN 136
#define IDD_DIALOG_MAPPINGFUNCTION 137
#define IDR_MENU_TERM 140
#define IDR_MENU_BATCH 141
#define IDI_IMOTE 142
#define IDR_ACCELERATOR_TERM 143
#define IDR_ACCELERATOR_TERM1 144
#define IDR_ACCELERATOR_BATCH 144
#define IDD_IMOTEBATCH 144
#define IDD_IMOTESTATUS 145
#define IDC_COMBO_COMPORT 1000
#define IDC_BUTTON_CONNECT 1001
#define IDC_EDIT_COMMAND 1002
#define IDC_EDIT_COMMAND2 1003
#define IDC_EDIT_NUMBYTES 1003
#define IDC_BUTTON_SENDCOMMAND 1004
#define IDC_BUTTON_SENDBYTES 1005
#define IDC_BUTTON_CLEAR_BUFFER 1006
#define IDC_RICHEDIT_OUTPUT 1009
#define IDC_RICHEDIT_TEMP 1010
#define IDC_BUTTON_SETTINGS 1011
#define IDC_EDIT1 1012
#define IDC_LIST1 1013
#define IDC_BUTTON1 1014
#define IDC_BUTTON2 1015
#define IDC_CHECK_MAGICNUMBER 1016
#define IDC_CHECK_FRAGMENTLENGTH 1017
#define IDC_CHECK_CHANNELID 1018
#define IDC_CHECK_16BITDATA 1019
#define IDC_COMBO_MAGICNUMBER 1020
#define IDC_COMBO_CHANNELID 1021
#define IDC_COMBO_FRAGMENTLENGTH 1022
#define IDC_EDIT_MAGICNUMBER_VALUE 1023
#define IDC_STATIC_ASSIGNMENTBOX 1024
#define IDC_EDIT_MINRANGE 1027
#define IDC_EDIT_MAXRANGE 1028
#define IDC_BUTTON_SENDBREAK 1029
#define IDC_COMBO_DISPLAYED_IMOTE 1034
#define IDC_STATIC_DISPLAYED_IMOTE 1035
#define IDC_STATIC_COM_NUM 1038
#define IDC_STATIC_DETACHED 1039
#define IDC_BUTTON_WINDOW_BUFFER 1041
#define IDC_BUTTON_TERM_CLEAR_BUFFER 1042
#define IDC_BUTTON_TERM_CONNECT 1043
#define IDC_BUTTON_TERM_SENDBREAK 1044
#define IDC_STATIC_TERM_DETACHED 1045
#define IDC_STATIC_TERM_COM_NUM 1046
#define IDC_STATIC_ABOUT_COPY 1047
#define IDC_BUTTON_TERM_SENDFILE 1047
#define IDC_STATIC_ABOUT_VER 1048
#define IDC_STATIC_TERM_ADDR 1048
#define IDC_STATIC_ABOUT_DEV 1049
#define IDC_STATIC_ABOUT_IMOTE 1050
#define IDC_BUTTON_TERM_EXECUTE 1050
#define IDC_CHECK_TERM_TEXT_FILE 1051
#define IDC_RICHEDIT_TERM_FILE 1052
#define IDC_STATIC_STATUS_BNUMBER 1054
#define IDC_RICHEDIT_TERM_ADDR 1054
#define IDC_STATIC_STATUS_VNUMBER 1055
#define IDC_PROGRESS_STATUS_VERIFY 1056
#define IDC_PROGRESS_STATUS_BURN 1057
#define IDC_STATIC_BATCH_BNUMBER 1058
#define IDC_PROGRESS_BATCH_BURN 1059
#define IDC_STATIC_BATCH_VNUMBER 1060
#define IDC_PROGRESS_BATCH_VERIFY 1061
#define IDC_RICHEDIT_BATCH_FILE 1062
#define IDC_BUTTON_BATCH_BURN 1063
#define IDC_STATIC_BATCH_TNUMBER 1064
#define IDC_PROGRESS_BATCH_TOTAL 1065
#define IDC_BUTTON_BATCH_BURN2 1066
#define IDC_BUTTON_BATCH_ABORT 1066
#define ID_EDIT_NEWWIN 32771
#define ID_FILE_SAVE32772 32772
#define ID_FILE_SAVEAS 32773
#define ID_FILE_EXIT 32774
#define ID_HELP_ABOUT 32775
#define ID_EDIT_OPTIONS 32776
#define ID_Menu 32777
#define ID_EDIT_CONNECT 32778
#define ID_EDIT_SETMAPPINGFUNCTION 32780
#define ID_VIEW 32782
#define ID_VIEW_ZOOMIN 32783
#define ID_VIEW_ZOOMOUT 32784
#define ID_EDIT_TEST 32785
#define ID_VIEW32788 32788
#define ID_VIEW_SMOOTH 32789
#define ID_EDIT_TESTNEWLIST 32790
#define ID_EDIT_ECHO 32791
#define ID_TERM_EDIT_ECHO 32797
#define ID_TERM_EDIT_CONNECT 32798
#define ID_TERM_FILE_SAVE 32799
#define ID_TERM_FILE_SAVEAS 32800
#define ID_TERM_EDIT_CLEAR_BUFFER 32803
#define ID_TERM_FILE_HIDE 32805
#define ID_TERM_EDIT_COPY 32806
#define ID_TERM_EDIT_SENDFILE 32809
#define ID_TERM_FILE_OPENFILE 32810
#define ID_BATCH_FILE_OPENFILE -32717
#define ID_BATCH_FILE_HIDE 32820
#define ID_BATCH_EDIT_BURN 32821
#define ID_BATCH_FILE_CLOSE 32825
#define ID_BATCH_EDIT_ABORT 32826
#define ID_TERM_EDIT_EXECUTE 32830
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 145
#define _APS_NEXT_COMMAND_VALUE 32831
#define _APS_NEXT_CONTROL_VALUE 1064
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
--- NEW FILE: sampleHeader.h ---
#ifndef __SAMPLEHEADER_H__
#define __SAMPLEHEADER_H__
typedef struct sampleHeader {
unsigned char logicalNodeId; /* Intel logical nodeId, mote generating sample*/
unsigned char channelId; /* channelId generating the sample. This is VirtualChannel */
unsigned char acquisitionNum; /* Ordinal # of the acquisition for the query: e.g.1st, 2nd, 3rd */
unsigned char gSEFilterType; /* filler for header due to 32 bit boundary */
unsigned char sensorType; /* sensorType - Robbie creating enum */
unsigned char sampleWidth; /* bit width of sample data used for parsing sample body */
unsigned short queryGroupId; /* UniqueId of the query group being satisfied by this sample record */
unsigned char acquisitionCount; /* Total # of acquisitions needed to satisfy the query group */
unsigned char desiredUOM; /* Unit of Measure the user wants. See EngineeringUnits.h */
unsigned char outputUOM; /* Unit of Measure of the data on this sample record. See EngineeringUnits.h */
unsigned char engineeringUOM; /* Native UOM the sensor takes its readings in. See EngineeringUnits.h */
float conversionVal; /* Conversion of volts/EU to convert voltage reading the EU for the sensor */
float sensorZero; /* Zero stop of the sensor. */
unsigned long samplingRate; /* Rate at which samples are taken */
unsigned long numSamples; /* numSamples in this chunk */
unsigned long function; /* post processing function applied to data. Robbie creating function bitmap */
unsigned long long microSecTimeStamp; /* micro-second accurate time stamp using time sync*/
unsigned long wallClockTimeStamp; /* second accurate wall clock stamp */
float ADCScale; /* Scaling used for Analog to Digital conversion */
float ADCOffset; /* Offset used for Analog to Digital conversion */
unsigned long sequenceID; /* unique number identifying the capture */
unsigned long sampleOffset; /* The offset of the 1st sample of this block within the total number of samples */
unsigned long totalSamples; /* total number of samples in an acquisition */
} sampleHeader_t;
#endif //__SAMPLEHEADER_H__
--- NEW FILE: ChannelAssignmentWnd.cpp ---
// ChannelAssignmentWnd.cpp : implementation file
//
#include "stdafx.h"
#include "iMoteConsole.h"
#include "ChannelAssignmentWnd.h"
#include ".\channelassignmentwnd.h"
// CChannelAssignmentWnd
IMPLEMENT_DYNAMIC(CChannelAssignmentWnd, CWnd)
CChannelAssignmentWnd::CChannelAssignmentWnd()
{
}
CChannelAssignmentWnd::~CChannelAssignmentWnd()
{
}
BEGIN_MESSAGE_MAP(CChannelAssignmentWnd, CWnd)
ON_WM_PAINT()
ON_WM_CREATE()
END_MESSAGE_MAP()
// CChannelAssignmentWnd message handlers
void CChannelAssignmentWnd::OnPaint()
{
CPaintDC dc(this);
}
int CChannelAssignmentWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rect;
GetClientRect(&rect);
rect.bottom = rect.top +15;
m_font.CreateStockObject(DEFAULT_GUI_FONT);
m_HeaderCtrl.Create(WS_CHILD|WS_VISIBLE|HDS_BUTTONS, rect,this, 2);
m_HeaderCtrl.SetFont(&m_font);
HDITEM hdi;
hdi.mask = HDI_TEXT | HDI_WIDTH | HDI_FORMAT;
hdi.cxy = rect.Width()/3;
hdi.fmt = HDF_STRING | HDF_CENTER;
hdi.pszText = "Color";
m_HeaderCtrl.InsertItem(0, &hdi);
hdi.pszText = "iMoteID";
m_HeaderCtrl.InsertItem(1, &hdi);
hdi.pszText = "Axis";
m_HeaderCtrl.InsertItem(2, &hdi);
m_ChannelConfigCtrl.Create(NULL,"test",WS_CHILD|WS_VISIBLE|WS_BORDER,CRect(rect.left,15,rect.right,38),this,3);
return 0;
}
// CColorCtrl
IMPLEMENT_DYNAMIC(CColorCtrl, CWnd)
CColorCtrl::CColorCtrl()
{
m_color=RGB(255,0,0);
}
CColorCtrl::~CColorCtrl()
{
}
BEGIN_MESSAGE_MAP(CColorCtrl, CWnd)
ON_WM_PAINT()
ON_WM_LBUTTONDBLCLK()
END_MESSAGE_MAP()
// CColorCtrl message handlers
void CColorCtrl::OnPaint()
{
CPaintDC dc(this);
CRect rect;
GetClientRect(&rect);
dc.FillSolidRect(&rect,m_color);
}
void CColorCtrl::OnLButtonDblClk(UINT nFlags, CPoint point)
{
CColorDialog dlg;
if(dlg.DoModal()==IDOK)
{
m_color = dlg.m_cc.rgbResult;
Invalidate();
}
CWnd::OnLButtonDblClk(nFlags, point);
}
// CChannelConfigCtrl
IMPLEMENT_DYNAMIC(CChannelConfigCtrl, CWnd)
CChannelConfigCtrl::CChannelConfigCtrl()
{
}
CChannelConfigCtrl::~CChannelConfigCtrl()
{
}
BEGIN_MESSAGE_MAP(CChannelConfigCtrl, CWnd)
ON_WM_PAINT()
ON_WM_CREATE()
END_MESSAGE_MAP()
// CColorCtrl message handlers
void CChannelConfigCtrl::OnPaint()
{
CPaintDC dc(this);
}
int CChannelConfigCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rect;
GetClientRect(&rect);
m_ColorCtrl.Create(NULL,"test",WS_CHILD|WS_VISIBLE|WS_BORDER,CRect(rect.left,rect.top,rect.Width()/3,rect.bottom),this,3);
m_EditAddress.Create(WS_CHILD|WS_VISIBLE|ES_NUMBER|ES_RIGHT,CRect(rect.Width()/3,rect.top,2*rect.Width()/3,rect.bottom),this, 4);
m_ComboChannel.Create(WS_CHILD|WS_VISIBLE|CBS_DROPDOWN,CRect(2*rect.Width()/3,rect.top,rect.Width(),rect.bottom+60),this, 5);
m_ComboChannel.AddString("x");
m_ComboChannel.AddString("y");
m_ComboChannel.AddString("z");
return 0;
}
--- NEW FILE: ConfigurationPage.cpp ---
// ConfigurationPage.cpp : implementation file
//
#include "stdafx.h"
#include "iMoteConsole.h"
#include "ConfigurationPage.h"
#include ".\configurationpage.h"
// CConfigurationPage dialog
IMPLEMENT_DYNAMIC(CConfigurationPage, CPropertyPage)
CConfigurationPage::CConfigurationPage(COMMCONFIG *CommConfig, CString COMPortName)
: CPropertyPage(CConfigurationPage::IDD), m_pCommConfig(CommConfig)
, m_comportComboValue(_T("")), m_strPortName(COMPortName)
{
}
CConfigurationPage::~CConfigurationPage()
{
}
void CConfigurationPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
DDX_Control(pDX, IDC_COMBO_COMPORT, m_comportComboControl);
DDX_CBString(pDX, IDC_COMBO_COMPORT, m_comportComboValue);
}
BEGIN_MESSAGE_MAP(CConfigurationPage, CPropertyPage)
ON_BN_CLICKED(IDC_BUTTON_SETTINGS, OnBnClickedButtonSettings)
END_MESSAGE_MAP()
// CConfigurationPage message handlers
void CConfigurationPage::PopulateSystemSerialPorts()
{
//serial ports reside at HKLM/HARDWARE/DEVICEMAP/SERIALCOMM
HKEY hkey;
DWORD dwIndex = 0;
TCHAR *lpValueName;
BYTE *lpData;
DWORD values, maxValueNameLen, nameLen, maxValueDataLen, dataLen;
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
TEXT("HARDWARE\\DEVICEMAP\\SERIALCOMM"),
0,
KEY_QUERY_VALUE,
&hkey) != ERROR_SUCCESS)
{
TRACE("Unable to open HKLM\\HARDWARE\\DEVICEMAP\\SERIALCOMM\n");
return;
}
RegQueryInfoKey(hkey, NULL, NULL, NULL, NULL, NULL, NULL, &values,&maxValueNameLen, &maxValueDataLen, NULL, NULL);
maxValueNameLen++;//need to include the terminating NULL char
maxValueDataLen++;//need to include the terminating NULL char
lpValueName = new TCHAR[maxValueNameLen+1];
lpData = new BYTE[maxValueDataLen+1];
nameLen = maxValueNameLen;
dataLen = maxValueDataLen;
while(RegEnumValue(hkey, dwIndex, lpValueName, &nameLen, NULL, NULL, lpData, &dataLen) != ERROR_NO_MORE_ITEMS)
{
TRACE("%s = %s\n",lpValueName, lpData);
dwIndex++;
nameLen = maxValueNameLen;
dataLen = maxValueDataLen;
m_comportComboControl.AddString((LPCTSTR)lpData);
}
// RegQueryValueEx(hkey, lpValueName, lpreserved, lptype, lpdata, lpcbdata);
delete[] lpValueName;
delete[] lpData;
RegCloseKey(hkey);
}
BOOL CConfigurationPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
PopulateSystemSerialPorts();
int i, NumEntries = m_comportComboControl.GetCount();
for (i=0; i<NumEntries; i++)
{
CString string;
m_comportComboControl.GetLBText(i,string);
if(m_strPortName == ("\\\\.\\"+ string))
{
m_comportComboControl.SetCurSel(i);
break;
}
}
if(i==NumEntries)
{
m_comportComboControl.SetCurSel(0);
}
#if 0
CRect rect;
CStatic *pAssignmentBox=(CStatic *)GetDlgItem(IDC_STATIC_ASSIGNMENTBOX);
//pAssignmentBox->GetClientRect(&rect);
pAssignmentBox->GetWindowRect(&rect);
ScreenToClient(&rect);
rect.top+=20;
rect.left+=10;
rect.right-=10;
rect.bottom -=10;
//m_ChannelAssignmentWnd.Create(NULL,"Config",WS_OVERLAPPED|WS_VISIBLE|WS_BORDER,rect,this,1,NULL);
CString strWndClass = AfxRegisterWndClass(CS_DBLCLKS,AfxGetApp()->LoadStandardCursor(IDC_ARROW),(HBRUSH) (COLOR_3DFACE),AfxGetApp()->LoadStandardIcon(IDI_WINLOGO));
m_ChannelAssignmentWnd.CreateEx(WS_EX_OVERLAPPEDWINDOW,strWndClass, _T("Config"),WS_CHILD|WS_VISIBLE,rect,this,1);
#endif
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CConfigurationPage::OnBnClickedButtonSettings()
{
UpdateData();
if(!CommConfigDialog(m_comportComboValue,m_hWnd,m_pCommConfig))
{
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
TRACE((char*)lpMsgBuf);
LocalFree( lpMsgBuf );
}
}
--- NEW FILE: Copy of IMoteTerminal.cpp ---
// IMoteTerminal.cpp : implementation file
//
#include "stdafx.h"
#include "iMoteConsole.h"
#include "IMoteTerminal.h"
#include "assert.h"
#include ".\imoteterminal.h"
// CIMoteTerminal dialog
IMPLEMENT_DYNAMIC(CIMoteTerminal, CDialog)
CIMoteTerminal::CIMoteTerminal(CWnd* pParent /*=NULL*/, CUSBDevice *dev /*=NULL*/,
bool att /*=false*/) : CDialog(CIMoteTer