C# の 32feet ライブラリを使用して連絡先を読み取ろうとしています。PC を Bluetooth 経由でモバイル デバイスに接続しています。このコードを実行しようとすると、常に不正な要求エラーが発生します。
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 が間違っていますか、それとも別の Bluetooth が必要ですか?