navit
0.5.3-trunk
|
#include <config.h>
#include <string.h>
#include <glib.h>
#include <math.h>
#include <time.h>
#include "debug.h"
#include "callback.h"
#include "plugin.h"
#include "coord.h"
#include "item.h"
#include "android.h"
#include "vehicle.h"
Data Structures | |
struct | vehicle_priv |
Functions | |
static void | vehicle_android_destroy (struct vehicle_priv *priv) |
Free the android_vehicle. More... | |
static int | vehicle_android_position_attr_get (struct vehicle_priv *priv, enum attr_type type, struct attr *attr) |
Retrieves a vehicle attribute. More... | |
static void | vehicle_android_position_callback (struct vehicle_priv *v, jobject location) |
Called when a new position has been reported. More... | |
static void | vehicle_android_status_callback (struct vehicle_priv *v, int sats_in_view, int sats_used) |
Called when a new GPS status has been reported. More... | |
static void | vehicle_android_fix_callback (struct vehicle_priv *v, int fix_type) |
Called when a change in GPS fix status has been reported. More... | |
static int | vehicle_android_init (struct vehicle_priv *ret) |
Initializes an Android vehicle. More... | |
static struct vehicle_priv * | vehicle_android_new_android (struct vehicle_methods *meth, struct callback_list *cbl, struct attr **attrs) |
Create android_vehicle. More... | |
void | plugin_init (void) |
register vehicle_android More... | |
Variables | |
struct vehicle_methods | vehicle_android_methods |
void plugin_init | ( | void | ) |
register vehicle_android
The plugin entry point.
References dbg, lvl_debug, and vehicle_android_new_android().
|
static |
|
static |
Called when a change in GPS fix status has been reported.
This function is called by
upon receiving a new
broadcast.
v | The struct_vehicle_priv |
fix_type | The fix type (1 = valid, 0 = invalid) |
References attr_position_valid_extrapolated_time, attr_position_valid_valid, callback_list_call_attr_0, vehicle_priv::cbl, vehicle_priv::fix_type, and vehicle_priv::valid.
Referenced by vehicle_android_new_android().
|
static |
Initializes an Android vehicle.
References android_activity, android_find_class_global(), android_find_method(), dbg, vehicle_priv::fcb, jnienv, vehicle_priv::Location_getAccuracy, vehicle_priv::Location_getAltitude, vehicle_priv::Location_getBearing, vehicle_priv::Location_getLatitude, vehicle_priv::Location_getLongitude, vehicle_priv::Location_getSpeed, vehicle_priv::Location_getTime, vehicle_priv::LocationClass, lvl_debug, lvl_error, vehicle_priv::NavitVehicle, vehicle_priv::NavitVehicleClass, vehicle_priv::pcb, and vehicle_priv::scb.
Referenced by vehicle_android_new_android().
|
static |
Create android_vehicle.
meth | |
cbl | |
attrs |
References attr_position_valid_invalid, callback_cast, callback_new_1, vehicle_priv::cbl, dbg, vehicle_priv::fcb, lvl_debug, vehicle_priv::pcb, vehicle_priv::sats, vehicle_priv::sats_used, vehicle_priv::scb, vehicle_priv::valid, vehicle_android_fix_callback(), vehicle_android_init(), vehicle_android_methods, vehicle_android_position_callback(), and vehicle_android_status_callback().
Referenced by plugin_init().
|
static |
Retrieves a vehicle attribute.
priv | vehicle_priv structure for the vehicle |
type | The attribute type to retrieve |
attr | Points to an attr structure that will receive the attribute data |
References attr_position_valid_invalid, attr_to_name(), attr::coord_geo, dbg, vehicle_priv::direction, vehicle_priv::fix_type, vehicle_priv::fixiso8601, vehicle_priv::geo, vehicle_priv::height, lvl_debug, attr::num, attr::numd, vehicle_priv::radius, vehicle_priv::sats, vehicle_priv::sats_used, vehicle_priv::speed, attr::str, type, attr::type, attr::u, and vehicle_priv::valid.
|
static |
Called when a new position has been reported.
This function is called by
upon receiving a new
.
v | The struct_vehicle_priv |
location | A Location |
References attr_position_valid_valid, callback_list_call_attr_0, vehicle_priv::cbl, dbg, vehicle_priv::direction, vehicle_priv::fixiso8601, vehicle_priv::geo, vehicle_priv::height, jnienv, coord_geo::lat, coord_geo::lng, vehicle_priv::Location_getAccuracy, vehicle_priv::Location_getAltitude, vehicle_priv::Location_getBearing, vehicle_priv::Location_getLatitude, vehicle_priv::Location_getLongitude, vehicle_priv::Location_getSpeed, vehicle_priv::Location_getTime, lvl_debug, vehicle_priv::radius, vehicle_priv::speed, and vehicle_priv::valid.
Referenced by vehicle_android_new_android().
|
static |
Called when a new GPS status has been reported.
This function is called by
upon receiving a new
.
Note that
should not be used to determine whether the vehicle's position is valid: some devices report non-zero numbers even when they do not have a fix. Position validity should be determined in
(an invalid fix type means we have lost the fix) and
(receiving a position means we have a fix).
v | The struct_vehicle_priv |
sats_in_view | The number of satellites in view |
sats_used | The number of satellites currently used to determine the position |
References callback_list_call_attr_0, vehicle_priv::cbl, vehicle_priv::sats, and vehicle_priv::sats_used.
Referenced by vehicle_android_new_android().
struct vehicle_methods vehicle_android_methods |
Referenced by vehicle_android_new_android().