>From: Zhao, Forrest [mailto:[email protected]] >Sent: Saturday, February 26, 2011 12:01 AM >Subject: RE: How to make SelectMode/IntervalMode configurable for >gyroscope sensor adaptor? >> > >> >Hi Timo, >> > >> >We have a gyroscope sensor working in interval mode. So I wrote a >gyroscope >> >adaptor working under IntervalMode, which is based on the existent >> >gyroscope adaptor working under SelectMode. >> > >> >So I'm wondering if we can make SelectMode/IntervalMode a >configuration >> >parameter for gyroscope sensor adaptor? So that we don't need to >duplicate >> >most of the code. >> >> Hi Forrest, >> >> This is already possible in sensord-0.7.0. The configuration format has >changed >> a bit, and the default init() for adaptors looks for key "mode" in >configuration. A >> bunch of other things are handled more easily by configuration as well. You >just >> need to make sure that interval functions behave correctly based on which >> mode is used (call sysfsAdaptor functions for PollMode, implement for >> SelectMode). >> > >I started to rebase the patches against 0.7.0. And have a question about >gyroscope adaptor code. > >bool GyroscopeAdaptor::setInterval(const unsigned int value, const int >sessionId) >{ > return SysfsAdaptor::setInterval((value > 10 ? 10 : value), sessionId); >} > >May I know why the largest polling interval is limited to 10 millisecond? > >Or if this polling interval limitation is required for l3g4200dh, I plan to >introduce >a "driver_type" parameter to gyroscopeadaptor.cpp to pass through this >limitation for the gyroscope sensor on my device. Please let me know if you >have different idea.
Tbh, I have absolutely no idea where that comes from. As the adaptor uses SelectMode, there is no point in calling sysfsAdaptor::setInterval(), as that only affects things for PollMode. Adaptors in SelectMode should reimplement interval() and setInterval() to handle the driver correctly. That piece of code does not have any effect on behavior. I suggest you consider the gyro adaptor to be incomplete, and freely implement the interval handling as you see fit. // Timo _______________________________________________ MeeGo-dev mailing list [email protected] http://lists.meego.com/listinfo/meego-dev http://wiki.meego.com/Mailing_list_guidelines
