Hello Andy,
First of all, thank you for your interest in the problem i got into.
Ok, so i'll start by telling you that using the Windows File Transfer Wizard worked OK in sending file to device..However, before sending the file to device, i need to run a small app on device..This small app uses the following code:
private void btnListen_Click(object sender, EventArgs e)
{
ObexListener listener = new ObexListener(ObexTransport.Bluetooth);
if (!listener.IsListening)
{
listener.Start();
lblInfo.Text = "Start listening...";
Application.DoEvents();
DealWithRequest(listener);
}
}
private void DealWithRequest(ObexListener listener)
{
while (listener.IsListening)
{
try
{
ObexListenerContext olc = listener.GetContext();
ObexListenerRequest olr = olc.Request;
string filename = olr.RawUrl;
olr.WriteFile("\\My Documents\\" + filename);
lblInfo.Text = "ok";
}
catch (Exception ex)
{
lblInfo.Text = "error";
}
}
}
If i don't run this code in order to listen for incoming connections, and i just power on bluetooth device but no application running, i get the following error from Windows Bluetooth File Transfer Wizard:
"The OBEX service on the destination computer or device is not available or ready for the transfer. Please try again. If you still cannot complete the transfer, read the manufacturer's documentation that came with the device."
OK, let's move on....
I copied the app.config file in my desktop app folder, enabled logging (network.log) and got the following:
System.Net.Sockets Verbose: 0 : [5104] Socket#66074150::Socket(32#32)
System.Net.Sockets Verbose: 0 : [5104] Exiting Socket#66074150::Socket()
System.Net.Sockets Verbose: 0 : [5104]
Socket#66074150::Connect(00043E000000:0000110600001000800000805f9b34fb#1040187396)
System.Net.Sockets Verbose: 0 : [5104] Exiting Socket#66074150::Connect()
System.Net.Sockets Verbose: 0 : [5104] Socket#66074150::Send()
System.Net.Sockets Verbose: 0 : [5104] Data from Socket#66074150::Send
System.Net.Sockets Verbose: 0 : [5104]
00000000 : 80 00 1A 10 00 FF FF 46-00 13 F9 EC 7B C4 95 3C : .......F....{..<
System.Net.Sockets Verbose: 0 : [5104]
00000010 : 11 D2 98 4E 52 54 00 DC-9E 09 : ...NRT....
System.Net.Sockets Verbose: 0 : [5104] Exiting Socket#66074150::Send() -> 26#26
System.Net.Sockets Verbose: 0 : [5104] Socket#66074150::Receive()
System.Net.Sockets Verbose: 0 : [5104] Data from Socket#66074150::Receive
System.Net.Sockets Verbose: 0 : [5104] 00000000 : C3 00 03 : ...
System.Net.Sockets Verbose: 0 : [5104] Exiting Socket#66074150::Receive() -> 3#3
I have to mention that in both applications (desktop and device) i used InTheHand.Net.Personal.dll v2.1.0.0 (of course, XP assembly for desktop and CF2 assembly for device).
However, using the latest version (that is, v2.2.0.0) returned the same result.
Another thing i should mention (although is not crucial for my problem...or at least i THINK it isnt) is that the assembly TransportConnection in which resides Brecham.Obex.Net namespace, has a reference to InTheHand.Net.Personal.dll v2.0.60828, making it unusable with later versions of InTheHand.Net.Personal.dll....I tried to recompile the project, but i had to eliminate the unit testing portion from it (NUnit assembly), so i quit :)).
OK, next....
I ran the SdpBrowser sample for desktop, made the discovery, select my Windows CE device and got the following results:
• Record:
AttrId: 0x0000 -- ServiceRecordHandle
UInt32: 0x0
AttrId: 0x0001 -- ServiceClassIdList
ElementSequence
Uuid16: 0x1000 -- ServiceDiscoveryServer
AttrId: 0x0004 -- ProtocolDescriptorList
ElementSequence
ElementSequence
Uuid16: 0x100 -- L2CapProtocol
UInt16: 0x1
ElementSequence
Uuid16: 0x1 -- SdpProtocol
( ( L2Cap, PSM=Sdp ), ( Sdp ) )
AttrId: 0x0006 -- LanguageBaseAttributeIdList
ElementSequence
UInt16: 0x656E
UInt16: 0x6A
UInt16: 0x100
AttrId: 0x0100 -- ServiceName
TextString: [en] 'Service Discovery'
AttrId: 0x0101 -- ServiceDescription
TextString: [en] 'Publishes services to remote devices'
AttrId: 0x0102 -- ProviderName
TextString: [en] 'Microsoft'
AttrId: 0x0200 -- VersionNumberList
ElementSequence
UInt16: 0x100
AttrId: 0x0201 -- ServiceDatabaseState
UInt32: 0x9
• Record:
AttrId: 0x0000 -- ServiceRecordHandle
UInt32: 0x10000
AttrId: 0x0001 -- ServiceClassIdList
ElementSequence
Uuid16: 0x1112 -- HeadsetAudioGateway
Uuid16: 0x1203 -- GenericAudio
AttrId: 0x0004 -- ProtocolDescriptorList
ElementSequence
ElementSequence
Uuid16: 0x100 -- L2CapProtocol
ElementSequence
Uuid16: 0x3 -- RFCommProtocol
UInt8: 0x1
( ( L2Cap ), ( Rfcomm, ChannelNumber=1 ) )
AttrId: 0x0009 -- BluetoothProfileDescriptorList
ElementSequence
ElementSequence
Uuid16: 0x1108 -- Headset
UInt16: 0x100
AttrId: 0x0100
TextString (guessing UTF-8): 'Voice Gateway'
• Record:
AttrId: 0x0000 -- ServiceRecordHandle
UInt32: 0x10001
AttrId: 0x0001 -- ServiceClassIdList
ElementSequence
Uuid16: 0x111F -- HandsfreeAudioGateway
Uuid16: 0x1203 -- GenericAudio
AttrId: 0x0004 -- ProtocolDescriptorList
ElementSequence
ElementSequence
Uuid16: 0x100 -- L2CapProtocol
ElementSequence
Uuid16: 0x3 -- RFCommProtocol
UInt8: 0x2
( ( L2Cap ), ( Rfcomm, ChannelNumber=2 ) )
AttrId: 0x0009 -- BluetoothProfileDescriptorList
ElementSequence
ElementSequence
Uuid16: 0x111E -- Handsfree
UInt16: 0x101
AttrId: 0x0100
TextString (guessing UTF-8): 'Voice Gateway'
AttrId: 0x0301
UInt8: 0x1
AttrId: 0x0311 -- SupportedFeatures
UInt16: 0x21
• Record:
AttrId: 0x0000 -- ServiceRecordHandle
UInt32: 0x10002
AttrId: 0x0001 -- ServiceClassIdList
ElementSequence
Uuid16: 0x1106 -- ObexFileTransfer
AttrId: 0x0004 -- ProtocolDescriptorList
ElementSequence
ElementSequence
Uuid16: 0x100 -- L2CapProtocol
ElementSequence
Uuid16: 0x3 -- RFCommProtocol
UInt8: 0x3
ElementSequence
Uuid16: 0x8 -- ObexProtocol
( ( L2Cap ), ( Rfcomm, ChannelNumber=3 ), ( Obex ) )
AttrId: 0x0006 -- LanguageBaseAttributeIdList
ElementSequence
UInt16: 0x656E
UInt16: 0x6A
UInt16: 0x100
AttrId: 0x0009 -- BluetoothProfileDescriptorList
ElementSequence
ElementSequence
Uuid16: 0x1106 -- ObexFileTransfer
UInt16: 0x100
AttrId: 0x0100 -- ServiceName
TextString: [en] 'FTP'
So, as far as i can tell, it seems that the ObexFileTransfer service is there and is OK....
What do you think ?
Thank you!