I'm trying to read contacts using 32feet library for c#. I'm connecting my PC to mobile device via bluetooth, and when I try to execute this code always give me bad request error
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();
And in the constructor:
private BluetoothDeviceInfo localinfo = null;
public BluetoothDeviceInfo LocalInfo
{
get
{
return localinfo = (localinfo ?? new BluetoothDeviceInfo(BluetoothRadio.PrimaryRadio.LocalAddress));
}
}
What I'm doing wrong? Is the URI wrong, or I need a different Bluetooth?