This is an airborne application with very strict data retention specs and unreliable power.  Weight is of utmost concern so packing extra batteries isn't an option.  I am sure there are many more eloquent ways to do the job, but for me, it's simple and it works.   

--- On Mon, 12/17/12, Miner, Jonathan W (US SSA) <jonathan.w.miner@baesystems.com> wrote:

From: Miner, Jonathan W (US SSA) <jonathan.w.miner@baesystems.com>
Subject: Re: [Gumstix-users] close(fd) takes too long
To: "General mailing list for gumstix users." <gumstix-users@lists.sourceforge.net>
Date: Monday, December 17, 2012, 5:51 AM

Hi -

Without knowing how your entire application works, it seems odd to open/close the GPS port each time you need GPS data.  You would expect that this should not cause a resource problem, but there is also additional time involved with executing the open/close calls, and associated resource management. Why not use a daemon like gpsd to manage the interface with the GPS and then use the gpsd API to poll for the current location?

I'll admit that I've worked with USB and serial GPS devices, but never with a Gumstix or Gallop board; so maybe my answer doesn't work in this particular situation.
________________________________________
From: Mipo01 [Mipo01@gmail.com]
Sent: Monday, December 17, 2012 08:08
To: gumstix-users@lists.sourceforge.net
Subject: Re: [Gumstix-users] close(fd) takes too long

Thank you very much for the response. I tried to change it but the same issue
occurred. It gets stuck on the same point.

Code:

int gps (float* lat1, float* lon1){

                FILE* fd;
        int round = 0;
        int longitude_deg,lattitude_deg,UTC;
        char buff[44],temp_buff[7];
        float longitude_min, lattitude_min;

        fd = fopen("/dev/ttyO0", "r+");
        if (fd == NULL){
                printf("Can't open port for GPS!\n");
                return 1;
        }
        else {
                do{
                        memset(temp_buff,0,sizeof(temp_buff));    //reset
the buffer
                        fgets (buff,44,fd);
                if (buff[4]=='M'&&buff[5]=='C'&&buff[17]=='A')
                        {
                                printf ("In the loop \n");
                                fflush(fd);
                                printf ("flushed \n");
                                fclose(fd);
                                printf ("OK\n");

                                memset(temp_buff,0,sizeof(temp_buff));
                                temp_buff[0]=buff[19];
                                temp_buff[1]=buff[20];
                                lattitude_deg = atof (temp_buff);
...



--
View this message in context: http://gumstix.8.n6.nabble.com/close-fd-takes-too-long-tp4966259p4966263.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
gumstix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
gumstix-users mailing list
gumstix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gumstix-users