Hi
I find that if we use /dev/nmea to get GPS data with le_fdMonitor, it seems /dev/nmea blocks and legato timers only expire if /dev/nmea reads are completed. So if /dev/nmea (echo ‘$GPS_STOP’ > /dev/nmea) is stopped, then entire fdMonitoring interface dies completely (no timers expire etc). Sample code below, the timer fires every second then again 1ms later then repeats… instead of every 500ms. Im not sure if /dev/nmea blocks, or if problems sharing /dev/nmea with USB and positioning Service… but for me I can;t find reliable way to get RAW NMEA data, unless I drop fdMonitor from /dev/nmea. Anyone had a similar experience?
COMPONENT_INIT
{
printf(“Component Init\n”);le_timer_Ref_t timerPtr3 = le_timer_Create("500ms second timer"); le_clk_Time_t interval3 = {0, 500000};//secs,microsends le_timer_SetInterval(timerPtr3, interval3); le_timer_SetRepeat(timerPtr3, 0); //0 mean indefinately. le_timer_SetHandler(timerPtr3, &timer1Secs); le_timer_Start(timerPtr3); le_gnss_Start(); LE_INFO("Opening /dev/nmea for GPS"); int nmeafd = open("/dev/nmea", O_RDWR); int flags = fcntl(nmeafd, F_GETFL, 0); LE_INFO("Flags = 0x%x",flags); fcntl(nmeafd, F_SETFL, flags | O_NONBLOCK); flags = fcntl(nmeafd, F_GETFL, 0); LE_INFO("Flags = 0x%x",flags); write(nmeafd, "$GPS_START", 10); LE_INFO("Creating Monitor for /dev/nmea"); le_fdMonitor_Create("FMPGNSSMonitor",nmeafd,nmeaDataHandler,POLLIN); LE_INFO("Monitor Created");
}