Wireless Communication Library Support Forum
Frameworks => Bluetooth Framework => Topic started by: Raj on June 04, 2008, 08:36:16 AM
-
Hi
I am using WCL.net lite. I am trying to get all files from my mobile listed under one folder.
when I loop through the files and get , an error is thrown like asynchronous process in progress.
Please let me know how I could do that.
private void btnGetAllFiles_Click(object sender, EventArgs e)
{
if (lvFTP.Items.Count > 0 )
{
//Loop all items.
for (int i = 0; i < lvFTP.Items.Count; i++)
{
if (lvFTP.Items.SubItems[1].Text == "File")
{
strFileName = lvFTP.Items[0].Text;
wclFTPClient.Get(lvFTP.Items[0].Text);
}
}
}
}
-
Get is asynchroniouse operation. When file received OnGetCOmplete event fires. Only after that you can get other file.
-
I know that, problem is "get" method is asynchronously callig the delegate "wclFTPClient_GetComplete" but didn't notify for the completion of event,
Can you please suggest me that is there any class or method by which I can get all the files at one event.
can I make multiple instances of wclFTPClient, and fire them.
Please let me know
-
There is no way to get file files by one call.
-
how can i get the multiple files ?
Do I need to call wclFTPClient.Get() multiple times.
if yes then how will I know that GetCompleted event is fired ?
Please suggest me something.
-
Yes, you need to call Get multiple times.
Does the event fire in Demo app?
-
I have call dir function from end event of get function.
Thanks for ur support.
-
Since the Get is asynchroniouse operation, so how does the Put work? Sometimes, the Put block and the cpu occupancy is up to almost 100%, why? How dose the wcl lead to this case?My code as follows(the connection is ok):
this.wclFTPClient = new wclnet.wclFTPClient();
this.wclFTPClient.AutoDetect = true;
this.wclFTPClient.ClientTransport = wclnet.wclClientTransport.ctBluetooth;
this.wclFTPClient.Target = new System.Guid("f9ec7bc4-953c-11d2-984e-525400dc9e09");
//Create the stream
Stream FileStream = null;
try
{
FileStream = new FileStream(filename, FileMode.Open);
wclFTPClient.Put(filename, FileStream);
}
finally
{
if (FileStream != null)
{
FileStream.Close();
FileStream = null;
}
}
Best Regards!
-
Good day!
Pus is async as well. You do not need close the stream immeditally. Wait when OnComplete even fires and then release the stream.
-
I copy code from the wcl demo as follows, and in this function, the stream is also closed after Put, so what's the problem? and in which cases, the Put will block and make the cpu occupancy up to 100%?
private void btFTPPut_Click(object sender, EventArgs e)
{
if (OpenDialog.ShowDialog() == DialogResult.OK)
{
Stream Stream = new FileStream(OpenDialog.FileName, FileMode.Open);
try
{
String AFile = System.IO.Path.GetFileName(OpenDialog.FileName);
wclFTPClient.Put(AFile, Stream);
}
finally
{
Stream.Close();
Stream = null;
}
}
}
-
What is bluetooth drivers?
-
The bluedriver is Widcomm, and another strange question is : When I list files of the remote server(my pda), an null file existin the folder,and this file has the same name as the folder which includes it but the size of it is 0, and each foler opend has the file of this type, when I get it, the wcl show the error : access point error and exit, After I check the remote device, there is no this file;
Thanks for your reply.
-
Thanks for the report. I will check and fix asap
-
Hi Mike,
Thanks for your valuable answers.
First, I am able to make different connect simultaneously as well as I am getting the files from those active connections.
Mike, I need to know, that may I attach a custom object/tag/value with wclFTPClient Object ?
One thing more the transfer rate of file is two slow, i am checking the different and glot wclObexParam class, in that i checked Param Size, can we change these param size.
wclOBEXParams objwclOBEXParams = new wclOBEXParams();
objwclOBEXParams.PacketSize = ????
can we make chages like this to make file transfer fast ?
-
Of course yu can change it and it may help. But actually the transfering speed hard depend on the hardware.
-
Hi Mike,
you said, I can change the buffer and param's packet size, but when I am changing the buffer and param package size then it throws me the error for read only property.
Below is the code.
wclBuffers objBuffers = new wclBuffers();
objBuffers.ReadBuffer = 4096;
objBuffers.WriteBuffer = 4096;
objFtpClient.Buffers = objBuffers;
objFtpClient.Param = objParam;
Kindly suggest me something, if it possible ?
-
objFtpClient.Buffers.ReadBuffer = 4096;
objFtpClient.Buffers.WriteBuffer = 4096;
objFtpClient.Params.PacketSize = 4096;
-
I have tried this,
but no luch :(
no change in speed.
Can you suggest me the best hardware dongle, to make bluetooth transfer rate faster.
currently I am using BlueSoleil 2.1.3.0 Voip Release
Stack Version 05.04.11.200600413
-
Update BlueSoleil to MS and it will work faster. How to do so:
http://www.btframework.com/faq.htm
http://www.vinsvision.com/Articles/tabid/66/EntryID/13/Default.aspx
-
Hi Mike,
I am facing a strange problem, during wclFTPClient's Dir method e.filecount is always 0, while mobile has the file. Please telll me the possible error due to I am facing this problem.
-
Sorry !!!!!!!!!!!!
I have solved the problem.
I haven't set wclFtpClient.AutoDetect=true ;
But by the ways if I haven't set it is true, then what should be workaround to get the folder and file listing.
-
No work around. You use nokia phone which does not provide access to the files with using FileTransferProfile. Nokia uses its own service. AutoDetect allows to detect which service to use.
-
Thanks :)
-
Hi i know this topic is kinda old, but i have a problem sending multiple files and i was hoping you could help me out, here's the code (i'm using vb.net):
Private Sub Send()
BFObjectPushClientX.OpenDevice()
If BFObjectPushClientX.Active Then
Try
For Each row As DataRow In _archives.Tables(0).Rows
BFObjectPushClientX.Put(My.Application.Info.DirectoryPath & "\" & K_FOLDER_CONTENT_TMP & "\" & row("Archive"))
_ws.ReportBluetoothDelivery(Password(), row("BuyId"), row("ItemId"), My.Settings.User)
Next
Catch ex As Exception
Dim oErr As New cError(ex)
_frmMsg = New frmMessage("Can't deliver all files", eMessageType.Info, False)
_frmMsg.ShowDialog()
End Try
Else
_frmMsg = New frmMessaje("Unable to connect", eMessageType.Info, False)
_frmMsg.ShowDialog()
End If
BFObjectPushClientX.Close()
End Sub
End Class
it only sends one file at the time.
-
How should it be?
-
it should be able to send multiple files, this isn't my code, the guy that was working here before me did it and i'm not sure if it is right, and i need the app to send multiple files if that's the case, i guess that's why he used
For Each row As DataRow In _archives.Tables(0).Rows
BFObjectPushClientX.Put(My.Application.Info.DirectoryPath & "\" & K_FOLDER_CONTENT_TMP & "\" & row("Archive"))
_ws.ReportBluetoothDelivery(Password(), row("BuyId"), row("ItemId"), My.Settings.User)
Next
right? for each row in the _archives.Tables it should send a file
-
I don;t use VB in my development and it's a bit hard to understand what should it do. By the logic it should do so. But what do you mean on "Multiple files"? Per one Put operation? if yes - then it is impossible
-
what i'm trying to do is every time it enters the For it should select a different file from _archives.Tables(0).rows and send it, but it does it one time then it cancels the connection
-
i found what's wrong, don't worry it's in the stored procedure that reports the delivery where's throwing the exception, that's why it cancels the connection, thanks anyways!!