|
navit
0.5.3-trunk
|
The Vehicle to gain position data from GeoClue. @Author jkoan. More...
Data Structures | |
| struct | vehicle_priv |
Macros | |
| #define | DEFAULT_RETRY_INTERVAL 10 |
| #define | MIN_RETRY_INTERVAL 1 |
| #define | plugin_init plugin_module_cat(module_,_init) |
| register vehicle_gypsy More... | |
Functions | |
| static void | vehicle_geoclue_destroy (struct vehicle_priv *priv) |
| Free the geoclue_vehicle. More... | |
| static void | print_location (GClueSimple *simple, GParamSpec *pspec, gpointer user_data) |
| static void | on_client_active_notify (GClueClient *client, GParamSpec *pspec, gpointer user_data) |
| static void | on_simple_ready (GObject *source_object, GAsyncResult *res, gpointer user_data) |
| static int | vehicle_geoclue_position_attr_get (struct vehicle_priv *priv, enum attr_type type, struct attr *attr) |
| Provide the outside with information. More... | |
| static struct vehicle_priv * | vehicle_geoclue_new (struct vehicle_methods *meth, struct callback_list *cbl, struct attr **attrs) |
| Create geoclue_vehicle. More... | |
| void | plugin_init (void) |
| register vehicle_geoclue More... | |
| static void | vehicle_gypsy_fixstatus_changed (GypsyDevice *device, gint fixstatus, gpointer userdata) |
| When the fixstatus has changed, this function get called. More... | |
| static void | vehicle_gypsy_position_changed (GypsyPosition *position, GypsyPositionFields fields_set, int timestamp, double latitude, double longitude, double altitude, gpointer userdata) |
| When the position has changed, this function get called. More... | |
| static void | vehicle_gypsy_satellite_changed (GypsySatellite *satellite, GPtrArray *satellites, gpointer userdata) |
| Everytime any Sat-Details are changed, this function get called. More... | |
| static void | vehicle_gypsy_course_changed (GypsyCourse *course, GypsyCourseFields fields, int timestamp, double speed, double direction, double climb, gpointer userdata) |
| When the course or speed has changed, this function get called. More... | |
| static gboolean | vehicle_gypsy_try_open (gpointer *data) |
| Attempt to open the gypsy device. More... | |
| static void | vehicle_gypsy_open (struct vehicle_priv *priv) |
| Open a connection to gypsy. Will re-try the connection if it fails. More... | |
| static void | vehicle_gypsy_close (struct vehicle_priv *priv) |
| Stop retry timer; Free alloced memory. More... | |
| static void | vehicle_gypsy_destroy (struct vehicle_priv *priv) |
| Free the gypsy_vehicle. More... | |
| static int | vehicle_gypsy_position_attr_get (struct vehicle_priv *priv, enum attr_type type, struct attr *attr) |
| Provide the outside with information. More... | |
| static struct vehicle_priv * | vehicle_gypsy_new_gypsy (struct vehicle_methods *meth, struct callback_list *cbl, struct attr **attrs) |
| Create gypsy_vehicle. More... | |
Variables | |
| GClueLocation * | vehicle_priv::location |
| char * | vehicle_priv::bla |
| int | vehicle_priv::accuracy |
| char * | vehicle_priv::time_str |
| GClueSimple * | vehicle_priv::simple |
| GClueClient * | client = NULL |
| struct vehicle_methods | vehicle_geoclue_methods |
| GypsyControl * | vehicle_priv::control |
| GypsyPosition * | vehicle_priv::position |
| GypsyDevice * | vehicle_priv::device |
| GypsyCourse * | vehicle_priv::course |
| GypsySatellite * | vehicle_priv::satellite |
| char * | vehicle_priv::path |
| guint | vehicle_priv::retry_timer |
| int | vehicle_priv::have_cords |
| static struct vehicle_priv * | vehicle_last |
| struct vehicle_methods | vehicle_gypsy_methods |
The Vehicle to gain position data from GeoClue. @Author jkoan.
The Vehicle to gain position data from gypsy. gypsy uses dbus signals @Author Tim Niemeyer reddog@mastersword.de
| #define DEFAULT_RETRY_INTERVAL 10 |
| #define MIN_RETRY_INTERVAL 1 |
| void plugin_init | ( | void | ) | plugin_module_cat(module_,_init) |
register vehicle_gypsy
|
static |
References client.
Referenced by on_simple_ready().
|
static |
References client, dbg, exit, lvl_debug, lvl_error, on_client_active_notify(), print_location(), and vehicle_priv::simple.
Referenced by vehicle_geoclue_new().
| void plugin_init | ( | void | ) |
register vehicle_geoclue
The plugin entry point.
register vehicle_gypsy
References dbg, lvl_error, and vehicle_geoclue_new().
|
static |
References vehicle_priv::accuracy, vehicle_priv::altitude, callback_list_call_attr_0, vehicle_priv::cbl, vehicle_priv::direction, vehicle_priv::geo, vehicle_priv::height, coord_geo::lat, coord_geo::lng, vehicle_priv::location, vehicle_priv::simple, vehicle_priv::speed, and vehicle_priv::time_str.
Referenced by on_simple_ready().
|
static |
Free the geoclue_vehicle.
| priv |
References client, and vehicle_priv::simple.
|
static |
Create geoclue_vehicle.
| meth[out] | Methodes supported by geoclue Plugin |
| cbl[in] | Callback List reference |
| attrs | Configuration attributes |
References cbl, vehicle_priv::cbl, dbg, lvl_debug, on_simple_ready(), and vehicle_geoclue_methods.
Referenced by plugin_init().
|
static |
Provide the outside with information.
| priv | |
| type | TODO: What can this be? |
| attr |
|
static |
Stop retry timer; Free alloced memory.
| priv |
References vehicle_priv::control, vehicle_priv::course, vehicle_priv::device, vehicle_priv::path, vehicle_priv::position, vehicle_priv::retry_timer, and vehicle_priv::satellite.
Referenced by vehicle_gypsy_destroy().
|
static |
When the course or speed has changed, this function get called.
Only speed and direction are used!
If we get any new information, we have to call the global callback.
| course | The GypsyCourse |
| fields | Bitmask indicating what field was set |
| timestamp | the time since Unix Epoch |
| speed | |
| direction | |
| climb | |
| userdata |
References callback_list_call_attr_0, vehicle_priv::cb, vehicle_priv::cbl, vehicle_priv::direction, vehicle_priv::speed, and vehicle_last.
Referenced by vehicle_gypsy_try_open().
|
static |
Free the gypsy_vehicle.
| priv |
References vehicle_priv::source, and vehicle_gypsy_close().
|
static |
When the fixstatus has changed, this function get called.
fixstatus can be one of this: GYPSY_DEVICE_FIX_STATUS_INVALID = 0 GYPSY_DEVICE_FIX_STATUS_NONE = 1 GYPSY_DEVICE_FIX_STATUS_2D = 2 GYPSY_DEVICE_FIX_STATUS_3D = 3
Anytime this functions get called, we have to call the global callback.
| device | The GypsyDevice |
| fixstatus | The fisstatus 0, 1, 2 or 3 |
| userdata |
References callback_list_call_attr_0, vehicle_priv::cbl, vehicle_priv::fix_type, and vehicle_last.
Referenced by vehicle_gypsy_try_open().
|
static |
Create gypsy_vehicle.
| meth | |
| cbl | |
| attrs |
References attr_search(), attr::attrs, vehicle_priv::attrs, cbl, vehicle_priv::cbl, eval::conn, dbg, DEFAULT_RETRY_INTERVAL, vehicle_priv::have_cords, lvl_debug, lvl_error, MIN_RETRY_INTERVAL, attr::num, vehicle_priv::retry_interval, vehicle_priv::source, attr::str, attr::u, vehicle_gypsy_methods, and vehicle_gypsy_open().
|
static |
Open a connection to gypsy. Will re-try the connection if it fails.
| priv |
References vehicle_priv::retry_interval, vehicle_priv::retry_timer, and vehicle_gypsy_try_open().
Referenced by vehicle_gypsy_new_gypsy().
|
static |
Provide the outside with information.
| priv | |
| type | TODO: What can this be? |
| attr |
|
static |
When the position has changed, this function get called.
The fields_set can hold: GYPSY_POSITION_FIELDS_NONE = 1 << 0, GYPSY_POSITION_FIELDS_LATITUDE = 1 << 1, GYPSY_POSITION_FIELDS_LONGITUDE = 1 << 2, GYPSY_POSITION_FIELDS_ALTITUDE = 1 << 3
If we get any new information, we have to call the global callback.
| position | The GypsyPosition |
| fields_set | Bitmask indicating what field was set |
| timestamp | the time since Unix Epoch |
| latitude | |
| longitude | |
| altitude | |
| userdata |
References vehicle_priv::altitude, callback_list_call_attr_0, vehicle_priv::cb, vehicle_priv::cbl, vehicle_priv::fix_time, vehicle_priv::geo, vehicle_priv::have_cords, vehicle_priv::height, coord_geo::lat, coord_geo::lng, and vehicle_last.
Referenced by vehicle_gypsy_try_open().
|
static |
Everytime any Sat-Details are changed, this function get called.
Going through all Sats, counting those wich are in use.
Anytime this functions get called, we have to call the global callback.
| satellite | The GypsySatellite |
| satellites | An GPtrArray wich hold information of all sats |
| userdata |
References callback_list_call_attr_0, vehicle_priv::cbl, vehicle_priv::satellites, vehicle_priv::sats, vehicle_priv::sats_used, and vehicle_last.
Referenced by vehicle_gypsy_try_open().
|
static |
Attempt to open the gypsy device.
Tells gypsy wich functions to call when anything occours.
| data |
References vehicle_priv::control, vehicle_priv::course, data, dbg, vehicle_priv::device, lvl_debug, vehicle_priv::path, vehicle_priv::position, vehicle_priv::satellite, vehicle_priv::source, vehicle_gypsy_course_changed(), vehicle_gypsy_fixstatus_changed(), vehicle_gypsy_position_changed(), vehicle_gypsy_satellite_changed(), and vehicle_last.
Referenced by vehicle_gypsy_open().
| int vehicle_priv::accuracy |
Referenced by print_location().
| char* vehicle_priv::bla |
| GClueClient* client = NULL |
Referenced by on_client_active_notify(), on_simple_ready(), and vehicle_geoclue_destroy().
| GypsyControl* vehicle_priv::control |
Referenced by vehicle_gypsy_close(), and vehicle_gypsy_try_open().
| GypsyCourse* vehicle_priv::course |
Referenced by vehicle_gypsy_close(), and vehicle_gypsy_try_open().
| GypsyDevice* vehicle_priv::device |
Referenced by vehicle_gypsy_close(), and vehicle_gypsy_try_open().
| int vehicle_priv::have_cords |
Referenced by vehicle_gypsy_new_gypsy(), and vehicle_gypsy_position_changed().
| GClueLocation* vehicle_priv::location |
Referenced by print_location().
| char* vehicle_priv::path |
Referenced by vehicle_gypsy_close(), and vehicle_gypsy_try_open().
| GypsyPosition* vehicle_priv::position |
Referenced by vehicle_gypsy_close(), and vehicle_gypsy_try_open().
| guint vehicle_priv::retry_timer |
Referenced by vehicle_gypsy_close(), and vehicle_gypsy_open().
| GypsySatellite* vehicle_priv::satellite |
Referenced by vehicle_gypsy_close(), and vehicle_gypsy_try_open().
| GClueSimple* vehicle_priv::simple |
Referenced by on_simple_ready(), print_location(), and vehicle_geoclue_destroy().
| char* vehicle_priv::time_str |
Referenced by print_location().
| struct vehicle_methods vehicle_geoclue_methods |
Referenced by vehicle_geoclue_new().
| struct vehicle_methods vehicle_gypsy_methods |
Referenced by vehicle_gypsy_new_gypsy().
|
static |