×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    May 2005
    Location
    Indonesia
    Posts
    198

    (Bluetooth) RSocket Write function does not call RunL function

    Hi,
    I'm developing a point to multipoint bluetooth application.
    Why sometimes the RSocket::Write function does not call the runL function.

    can someone give me some hints?

    thx
    Ronald Stevanus

  2. #2
    Registered User
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747

    Re: (Bluetooth) RSocket Write function does not call RunL function

    Normally when ever the Write operation finished successfully (or even failed) it will hit the RunL(). Did you call the SetActive()? It would be nice if you post your code here.

  3. #3
    Registered User
    Join Date
    May 2005
    Location
    Indonesia
    Posts
    198

    Re: (Bluetooth) RSocket Write function does not call RunL function

    Hi vin2ktalks,
    thx for the reply.

    I have called the SetActive() after the write function. I'm sending a large and simultaneous amount of data.

    I'm able to send the data to 7 devices, but after a period of time, 1 or 2 device will not receive the data since the write function never completes.
    I've tried to put a delay using User::After( 50000 ) each time sending the data, but the problem still exist.

    The problem occures not just when connecting to 7 devices. When connecting to 5 devices, 1 of the device will not receive the data, and sometimes when connecting to 3 device.
    I've tried to create a queue of sended data, but it doesn't work.

    thx
    Ronald Stevanus

  4. #4
    Registered User
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747

    Re: (Bluetooth) RSocket Write function does not call RunL function

    Hi Roland,

    Where did you keep the sleep? The sleep of 50000 is a very less amount of time. For a 1 second sleep you should have used "1000000". But the method of sleep is not a feasible way in a socket communication. It would be better if you could send an acknowledgement back to the master after each receives of the data. So based on these acknowledgements the master can again send the next data to the slaves.

  5. #5
    Registered User
    Join Date
    May 2005
    Location
    Indonesia
    Posts
    198

    Re: (Bluetooth) RSocket Write function does not call RunL function

    I put the sleep after calling the Write function to all devices. I use the sleep just for testing only.

    I've debugged my code, now I know that the RunL method is called, but become slower. The write will become slower when the 4th client connects, and it only slower on 1 other device, not in the last connected device. Weird??

    I can't use ack in my app, since the server will always send the data to all connected devices.

    thx
    Ronald Stevanus

  6. #6
    Registered User
    Join Date
    May 2005
    Location
    Indonesia
    Posts
    198

    Re: (Bluetooth) RSocket Write function does not call RunL function

    I've tried my apps again.
    I keep running my apps even there's a delayed device.
    the delayed device stops receiving data (it seems the Write function never finish).
    I turn off the stopped device.
    After a few moments, another device is delayed and stopped until there's only one device left (the first device).

    any idea??

  7. #7
    Registered User
    Join Date
    May 2005
    Location
    Indonesia
    Posts
    198

    Re: (Bluetooth) RSocket Write function does not call RunL function

    Hi,

    Is there any issue to create 2 active object to handle the write and receive process of a socket?
    So the receive process will always run, and the write process can be executed without cancelling the receive process. I've implemented this in my program, it's working but the the write function sometimes delayed and even stopped when the server connecting to another device. I was wondering, is it because the 2 active object or not?

    thx
    Ronald Stevanus

  8. #8
    Registered User
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747

    Re: (Bluetooth) RSocket Write function does not call RunL function

    Basically a full duplex socket communication is possible if there are two Active Objects (AO) for read and write separately. I've tested this under Point-To-Point connection and was working perfectly ok. I think you are trying a point-to-multipoint connection. In such situations I guess there should be some limit in the amount of data to be transferred across the devices. I suggest you to do an R&D on the maximum amount of data transfer rate. The data transfer rate is based on the Bluetooth version supports in your device. The latest version of Bluetooth v2.0 has a faster transfer up to 3Mbps, 3 times faster than v1.2.

  9. #9
    Registered User
    Join Date
    May 2005
    Location
    Indonesia
    Posts
    198

    Re: (Bluetooth) RSocket Write function does not call RunL function

    Why does the server receive data that was sent by it self? It's like echoing the data. Is this a normal behaviour, since I'm using 2 active object for sending and receiving?

  10. #10
    Registered User
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747

    Re: (Bluetooth) RSocket Write function does not call RunL function

    Quote Originally Posted by ronald29
    Why does the server receive data that was sent by it self? It's like echoing the data. Is this a normal behaviour, since I'm using 2 active object for sending and receiving?
    I'm not much sure why it's happening... It seems weird... Just a clarification! Are you using the same socket (active socket) reference on both the read and write AOs?

  11. #11
    Registered User
    Join Date
    May 2005
    Location
    Indonesia
    Posts
    198

    Re: (Bluetooth) RSocket Write function does not call RunL function

    Yes, I'm using the same socket.
    I'm sending about 20k bytes of data to every device that is connected.

  12. #12
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    88

    Unhappy Re: (Bluetooth) RSocket Write function does not call RunL function

    can i see your read and write called function,how you manage both fn at same time using two Active Object i am getting E32-CBase42?

  13. #13
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: (Bluetooth) RSocket Write function does not call RunL function

    Hi,
    If you are getting this panic means you are issuing another request on active object which is already having an active object. Before calling SetActive() you should have acheck like
    if(IsActive())
    {
    Cancel();
    }
    then...
    SetActive();
    This way there will be always one active request for the active object.
    Maximus
    S60 Developer
    Impossible is nothing

  14. #14
    Registered User
    Join Date
    May 2007
    Location
    Poland
    Posts
    606

    Re: (Bluetooth) RSocket Write function does not call RunL function

    if(IsActive())
    {
    Cancel();
    }
    Just to inform, you don t have to call if(IsActive()) before calling Cancel().

    Code:
    "CActive::Cancel() first determines if there is an outstanding
    request and, if so, it calls the DoCancel() method, a pure virtual function in CActive..." 
    ( Symbian OS Explained,page 137 ,Jo Stichbury )
    so Cancel will do it itself

    Good Luck

Similar Threads

  1. Using bluetooth to call a pushRegistry to start an application
    By ianstrain in forum Mobile Java General
    Replies: 3
    Last Post: 2006-11-08, 18:11
  2. Error while accepting an incoming call
    By yogesh14 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-03-23, 03:55
  3. Replies: 0
    Last Post: 2004-09-20, 12:28
  4. 6230 fails to write more than once to output stream in Bluetooth connection
    By sporritt in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2004-09-08, 17:02
  5. Replies: 0
    Last Post: 2004-04-16, 17:19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×