我正在尝试使用 c# 的 32feet 库读取联系人。我正在通过蓝牙将我的 PC 连接到移动设备,当我尝试执行此代码时,总是给我错误的请求错误
LocalInfo.SetServiceState(BluetoothService.PhonebookAccessPce, true);
BluetoothAddress addr = BluetoothAddress.Parse("00:00:00:00:00:00");
BluetoothEndPoint rep = new BluetoothEndPoint(addr, BluetoothService.PhonebookAccessPse);
BluetoothClient cli = new BluetoothClient();
cli.Connect(rep);
Uri uri = new Uri(ObexUri.UriSchemeObex + "://" + addr + "/telecom/pb.vcf");
ObexWebRequest request = new ObexWebRequest(uri);
request.Method = "GET";
request.ContentType = "text/x-vCard";
ObexWebResponse resp = (ObexWebResponse)request.GetResponse();
在构造函数中:
private BluetoothDeviceInfo localinfo = null;
public BluetoothDeviceInfo LocalInfo
{
get
{
return localinfo = (localinfo ?? new BluetoothDeviceInfo(BluetoothRadio.PrimaryRadio.LocalAddress));
}
}
我做错了什么?URI 是否错误,或者我需要不同的蓝牙?