Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor StasV's Avatar
    Join Date
    Jul 2007
    Posts
    161
    I need to read data from GPS receiver.
    1) GPS receiver writes data every second. But i don't need such frequent updates. So if I will read it every second, it will shorten battery-life.
    2) I want to choose between two possible ways of reading data in background.
    a) CPeriodic object reads data from GPS receiver every second, and if data string is a complete structure (symbols $ [something] \r\n is there) - parse it and put it into proper class which needs gps location.
    b) CActive (but I am not sure, is it just simple thread?) - run reading process in background, and I should be able to terminate it even if it is waiting data from receiver (if receiver suddenly was turned off).
    3) I can also imagine my application connecting, reading and disconnecting from receiver every time i need data, but such implementation scares me

    Could anyone help me to
    1) choose the way of reading data
    2) to understand how CActive works (tiny example will be great!)
    Thanks
    P.S
    Symbian 6.1 & 8.0a

  2. #2
    Super Contributor peter_k_john's Avatar
    Join Date
    Oct 2005
    Posts
    739
    Hi,

    I think you are connecting to the gps receiver through bluetooth. So you have established a connection to the gps device. It will write to your blutooth socket in every seconds. Then its up to you to read from that socket or not.

    About second question. You just search on google using "active object symbian" as key word.

    I am here providing you some examples

    http://www.forum.nokia.com/info/sw.n...0b_en.zip.html
    http://newlc.com/Symbian-Active-Object-Framework-A.html
    http://wiki.forum.nokia.com/index.php/Active_object
    http://www.forum.nokia.com/info/sw.n..._v1_1.zip.html

    regards,
    Peter

  3. #3
    Regular Contributor StasV's Avatar
    Join Date
    Jul 2007
    Posts
    161
    Then its up to you to read from that socket or not.
    And what if system internal buffer overflows? I will get wrong data?
    The other catch is that while moving, gps coordinates from buffer remains old. So this way of reading data is not acceptable.
    About second question.
    Can you explain me what exactly means "active object"? I just can not understand the purpose of it.

    And, which of the following ways of reading data is better?

    Thank you for your answer.

  4. #4
    Super Contributor peter_k_john's Avatar
    Join Date
    Oct 2005
    Posts
    739
    Hi,

    One thing i can suggest to you is to read from socket on every second and process it on the intervals as you want.

    And on active object this article on newlc will explain to you more cleary than me.
    http://newlc.com/ActiveObjects.html

    And then you can go through the links i have already provided to you or read any books related to symbian.

    I think for reading its better to maintain the connection with gps receiver without breaking it.

    Regards,
    Peter

  5. #5
    Regular Contributor StasV's Avatar
    Join Date
    Jul 2007
    Posts
    161
    Thank you very much

Similar Threads

  1. Comm Port
    By koqin in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2009-05-08, 12:19
  2. problems writing to Comm Port (RComm)
    By pribhi in forum Symbian C++
    Replies: 8
    Last Post: 2007-04-18, 13:57
  3. error reading from from comm port plzz help
    By herat007 in forum General Messaging
    Replies: 0
    Last Post: 2007-03-26, 17:36
  4. DKU-2 is working for reading data from comm port?
    By Dharmesh2000 in forum General Messaging
    Replies: 0
    Last Post: 2006-08-21, 19:26
  5. Reading serial port in a thread...
    By bjorn.rudolfsson in forum Symbian C++
    Replies: 1
    Last Post: 2003-05-19, 10:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved