I'm trying to read contacts from my mobile device using 32feet library and i'm having a bad request error when I try. The device is paired with my app. This is my code:
var item = (BluetoothDeviceInfo)listBox.SelectedItem;
Task.Run(() =>
{
item.Update();
item.Refresh();
item.SetServiceState(BluetoothService.PhonebookAccess, true);
if (OBEXOpenStream(item.DeviceAddress.ToString()))
{
if (OBEXConnect())
{
string tName = "";
string tType = "text/x-vCard";
string tFileContent = "";
int result = OBEXRequest("GET", tName, tType, tFileContent);
item.ShowDialog();
}
}
OBEXCloseStream();
});
I dont know if there are another ways to get the contacts using OBEX.