📄 hcitest.cxx
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/**
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.
Abstract:
Windows CE Bluetooth application sample
**/
#include <windows.h>
#include <stdio.h>
#include <bt_api.h>
int wmain (int argc, WCHAR **argv) {
int irep;
if ((argc < 2) || (! (irep = _wtoi(argv[1])))) {
wprintf (L"Usage: hcitest <number of repetitions>\n");
return 1;
}
for (int i = 0 ; i < irep ; ++i) {
int ifunc = rand () % 4;
char c = 0;
int ierr = 0;
switch (ifunc) {
case 0:
{
unsigned char uc = 0;
int ierr = BthReadScanEnableMask (&uc);
wprintf (L"BthReadScanEnableMask: mask = %d, err = %d\n", uc, ierr);
break;
}
case 1:
{
unsigned short us = 0;
int ierr = BthReadPageTimeout (&us);
wprintf (L"BthReadPageTimeout: t/o = %d, err = %d\n", us, ierr);
break;
}
case 2:
{
unsigned int ui = 0;
int ierr = BthReadCOD (&ui);
wprintf (L"BthReadCOD: cod = 0x%8x, err = %d\n", ui, ierr);
break;
}
case 3:
{
unsigned char uc = 0;
int ierr = BthReadAuthenticationEnable (&uc);
wprintf (L"BthReadAuthenticationEnable: res = %d, err = %d\n", uc, ierr);
break;
}
}
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -