📄 isoch.c
字号:
hWnd,
IsochListenDlgProc,
(LPARAM)&isochListen
)) {
dwRet = IsochListen( hWnd,
szDeviceName,
&isochListen
);
}
TRACE(TL_TRACE, (hWnd, "Exit w1394_IsochListen\r\n"));
return;
} // w1394_IsochListen
void
w1394_IsochQueryCurrentCycleTime(
HWND hWnd,
PSTR szDeviceName
)
{
CYCLE_TIME CycleTime;
DWORD dwRet;
TRACE(TL_TRACE, (hWnd, "Enter w1394_IsochQueryCurrentCycleTime\r\n"));
dwRet = IsochQueryCurrentCycleTime( hWnd,
szDeviceName,
&CycleTime
);
TRACE(TL_TRACE, (hWnd, "Exit w1394_IsochQueryCurrentCycleTime\r\n"));
return;
} // w1394_IsochQueryCurrentCycleTime
INT_PTR CALLBACK
IsochQueryResourcesDlgProc(
HWND hDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
static PISOCH_QUERY_RESOURCES pIsochQueryResources;
static CHAR tmpBuff[STRING_SIZE];
switch (uMsg) {
case WM_INITDIALOG:
pIsochQueryResources = (PISOCH_QUERY_RESOURCES)lParam;
if (pIsochQueryResources->fulSpeed == SPEED_FLAGS_FASTEST) {
CheckRadioButton( hDlg,
IDC_ISOCH_QUERY_RES_100MBPS,
IDC_ISOCH_QUERY_RES_FASTEST,
IDC_ISOCH_QUERY_RES_FASTEST
);
}
else {
CheckRadioButton( hDlg,
IDC_ISOCH_QUERY_RES_100MBPS,
IDC_ISOCH_QUERY_RES_FASTEST,
pIsochQueryResources->fulSpeed + (IDC_ISOCH_QUERY_RES_100MBPS-1)
);
}
return(TRUE); // WM_INITDIALOG
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
pIsochQueryResources->fulSpeed = 0;
if (IsDlgButtonChecked(hDlg, IDC_ISOCH_QUERY_RES_100MBPS))
pIsochQueryResources->fulSpeed = SPEED_FLAGS_100;
if (IsDlgButtonChecked(hDlg, IDC_ISOCH_QUERY_RES_200MBPS))
pIsochQueryResources->fulSpeed = SPEED_FLAGS_200;
if (IsDlgButtonChecked(hDlg, IDC_ISOCH_QUERY_RES_400MBPS))
pIsochQueryResources->fulSpeed = SPEED_FLAGS_400;
if (IsDlgButtonChecked(hDlg, IDC_ISOCH_QUERY_RES_1600MBPS))
pIsochQueryResources->fulSpeed = SPEED_FLAGS_1600;
if (IsDlgButtonChecked(hDlg, IDC_ISOCH_QUERY_RES_FASTEST))
pIsochQueryResources->fulSpeed = SPEED_FLAGS_FASTEST;
EndDialog(hDlg, TRUE);
return(TRUE); // IDOK
case IDCANCEL:
EndDialog(hDlg, FALSE);
return(TRUE); // IDCANCEL
default:
return(TRUE); // default
} // switch
break; // WM_COMMAND
default:
break; // default
} // switch
return(FALSE);
} // IsochQueryResourcesDlgProc
void
w1394_IsochQueryResources(
HWND hWnd,
PSTR szDeviceName
)
{
ISOCH_QUERY_RESOURCES isochQueryResources;
DWORD dwRet;
TRACE(TL_TRACE, (hWnd, "Enter w1394_IsochQueryResources\r\n"));
isochQueryResources.fulSpeed = SPEED_FLAGS_200;
if (DialogBoxParam( (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
"IsochQueryResources",
hWnd,
IsochQueryResourcesDlgProc,
(LPARAM)&isochQueryResources
)) {
dwRet = IsochQueryResources( hWnd,
szDeviceName,
&isochQueryResources
);
}
TRACE(TL_TRACE, (hWnd, "Exit w1394_IsochQueryResources\r\n"));
return;
} // w1394_IsochQueryResources
INT_PTR CALLBACK
IsochSetChannelBandwidthDlgProc(
HWND hDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
static PISOCH_SET_CHANNEL_BANDWIDTH pIsochSetChannelBandwidth;
static CHAR tmpBuff[STRING_SIZE];
switch (uMsg) {
case WM_INITDIALOG:
pIsochSetChannelBandwidth = (PISOCH_SET_CHANNEL_BANDWIDTH)lParam;
sprintf (tmpBuff, "%p", pIsochSetChannelBandwidth->hBandwidth);
SetDlgItemText(hDlg, IDC_ISOCH_SET_CHAN_BW_RESOURCE, tmpBuff);
_ultoa(pIsochSetChannelBandwidth->nMaxBytesPerFrame, tmpBuff, 16);
SetDlgItemText(hDlg, IDC_ISOCH_SET_CHAN_BW_BYTES_PER_FRAME, tmpBuff);
return(TRUE); // WM_INITDIALOG
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
GetDlgItemText(hDlg, IDC_ISOCH_SET_CHAN_BW_RESOURCE, tmpBuff, STRING_SIZE);
if (!sscanf (tmpBuff, "%p", pIsochSetChannelBandwidth->hBandwidth))
{
// failed to get the handle, just return here
EndDialog(hDlg, TRUE);
return FALSE;
}
GetDlgItemText(hDlg, IDC_ISOCH_SET_CHAN_BW_BYTES_PER_FRAME, tmpBuff, STRING_SIZE);
pIsochSetChannelBandwidth->nMaxBytesPerFrame = strtoul(tmpBuff, NULL, 16);
EndDialog(hDlg, TRUE);
return(TRUE); // IDOK
case IDCANCEL:
EndDialog(hDlg, FALSE);
return(TRUE); // IDCANCEL
default:
return(TRUE); // default
} // switch
break; // WM_COMMAND
default:
break; // default
} // switch
return(FALSE);
} // IsochSetChannelBandwidthDlgProc
void
w1394_IsochSetChannelBandwidth(
HWND hWnd,
PSTR szDeviceName
)
{
ISOCH_SET_CHANNEL_BANDWIDTH isochSetChannelBandwidth;
DWORD dwRet;
TRACE(TL_TRACE, (hWnd, "Enter w1394_IsochSetChannelBandwidth\r\n"));
isochSetChannelBandwidth.hBandwidth = NULL;
isochSetChannelBandwidth.nMaxBytesPerFrame = 640;
if (DialogBoxParam( (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
"IsochSetChannelBandwidth",
hWnd,
IsochSetChannelBandwidthDlgProc,
(LPARAM)&isochSetChannelBandwidth
)) {
dwRet = IsochSetChannelBandwidth( hWnd,
szDeviceName,
&isochSetChannelBandwidth
);
}
TRACE(TL_TRACE, (hWnd, "Exit w1394_IsochSetChannelBandwidth\r\n"));
return;
} // w1394_IsochSetChannelBandwidth
INT_PTR CALLBACK
IsochStopDlgProc(
HWND hDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
static PISOCH_STOP pIsochStop;
static CHAR tmpBuff[STRING_SIZE];
switch (uMsg) {
case WM_INITDIALOG:
pIsochStop = (PISOCH_STOP)lParam;
// put offset low and high and buffer length in edit controls
sprintf (tmpBuff, "%p", pIsochStop->hResource);
SetDlgItemText(hDlg, IDC_ISOCH_STOP_HANDLE, tmpBuff);
return(TRUE); // WM_INITDIALOG
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
GetDlgItemText(hDlg, IDC_ISOCH_STOP_HANDLE, tmpBuff, STRING_SIZE);
if (!sscanf (tmpBuff, "%p", &(pIsochStop->hResource)))
{
// failed to get the handle, just return here
EndDialog(hDlg, TRUE);
return FALSE;
}
EndDialog(hDlg, TRUE);
return(TRUE); // IDOK
case IDCANCEL:
EndDialog(hDlg, FALSE);
return(TRUE); // IDCANCEL
default:
return(TRUE); // default
} // switch
break; // WM_COMMAND
default:
break; // default
} // switch
return(FALSE);
} // IsochStopDlgProc
void
w1394_IsochStop(
HWND hWnd,
PSTR szDeviceName
)
{
ISOCH_STOP isochStop;
DWORD dwRet;
TRACE(TL_TRACE, (hWnd, "Enter w1394_IsochStop\r\n"));
isochStop.hResource = NULL;
isochStop.fulFlags = 0;
if (DialogBoxParam( (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
"IsochStop",
hWnd,
IsochStopDlgProc,
(LPARAM)&isochStop
)) {
dwRet = IsochStop( hWnd,
szDeviceName,
&isochStop
);
}
TRACE(TL_TRACE, (hWnd, "Exit w1394_IsochStop\r\n"));
return;
} // w1394_IsochStop
INT_PTR CALLBACK
IsochTalkDlgProc(
HWND hDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
static PISOCH_TALK pIsochTalk;
static CHAR tmpBuff[STRING_SIZE];
switch (uMsg) {
case WM_INITDIALOG:
pIsochTalk = (PISOCH_TALK)lParam;
// put offset low and high and buffer length in edit controls
sprintf (tmpBuff, "%p", pIsochTalk->hResource);
SetDlgItemText(hDlg, IDC_ISOCH_TALK_RESOURCE_HANDLE, tmpBuff);
_ultoa(pIsochTalk->StartTime.CL_CycleOffset, tmpBuff, 16);
SetDlgItemText(hDlg, IDC_ISOCH_TALK_CYCLE_OFFSET, tmpBuff);
_ultoa(pIsochTalk->StartTime.CL_CycleCount, tmpBuff, 16);
SetDlgItemText(hDlg, IDC_ISOCH_TALK_CYCLE_COUNT, tmpBuff);
_ultoa(pIsochTalk->StartTime.CL_SecondCount, tmpBuff, 16);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -