bthsagw_mdd.cpp

来自「wince4.2 bluetooth sdk」· C++ 代码 · 共 43 行

CPP
43
字号
//
// 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.
//
#include "btagw_reg.h"
#include <initguid.h>
#include <bt_sdp.h>

DWORD RegisterBthDevice(BT_ADDR bta, HANDLE* phDevice)
{
	if (! phDevice) {
		return ERROR_INVALID_PARAMETER;
	}
	
	PORTEMUPortParams pp;
	memset (&pp, 0, sizeof(pp));
	pp.device = bta;
	pp.uuidService = HeadsetServiceClass_UUID;
	
	*phDevice = RegisterDevice (L"BSP", 1, L"btd.dll", (DWORD)&pp);
	if (*phDevice == 0) {
		return GetLastError();
	}
		
	return ERROR_SUCCESS;
}

DWORD DeregisterBthDevice(HANDLE hDevice)
{
	if (hDevice) {
		return DeregisterDevice(hDevice) ? ERROR_SUCCESS : GetLastError();
	}

	return ERROR_SUCCESS;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?