#pragma once
#include <windows.h>
#include "util/gdix.h" // Rect<>
struct ComSel{
Rect<short>r; // window position and size
char showcmd; // SW_SHOW etc.
BYTE port; // 0 means COM1, etc.
BYTE baudcode; // 7:6 = exponent 2,6,3,[3:0] for base 5, 5:4 = ex for base 3, 3:0 = leftshift
BYTE rsv; // 7:6 = handshake, 5:4 = parity, 3 = stopbits, 2:0 = databits%8, so 0x00 encodes 8-n-1
bool load();
void dialogHandler(HWND,UINT,WPARAM,LPARAM); // COM-Port-ID = 101, Baudrate = 102
// Der kümmert sich zusätzlich um die Fensterposition (hm, nicht seine Aufgabe!)
bool save();
ComSel(BYTE p=2,BYTE bc=0x29/*115200*/);
static HANDLE Open(UINT ComNr,DWORD dwFlags=0); // ComNr=0 = COM1 usw.
// returns 0 on failure, not INVALID_HANDLE_VALUE aka (HANDLE)-1
};
TCHAR*getExeName(TCHAR exepath[MAX_PATH]);
// siehe http://www.tu-chemnitz.de/~heha/Mikrocontroller/Baudrate.htm
DWORD decodeBaud(BYTE);
BYTE encodeBaud(DWORD rate);
| Detected encoding: ANSI (CP1252) | 4
|
|
|