1 /** @file vehicle_null.c
2 * @brief null uses dbus signals
4 * Navit, a modular navigation system.
5 * Copyright (C) 2005-2008 Navit Team
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
21 * @Author Tim Niemeyer <reddog@mastersword.de>
39 struct callback_list *cbl;
55 * @brief Free the null_vehicle
61 vehicle_null_destroy(struct vehicle_priv *priv)
68 * @brief Provide the outside with information
71 * @param type TODO: What can this be?
76 vehicle_null_position_attr_get(struct vehicle_priv *priv,
77 enum attr_type type, struct attr *attr)
79 dbg(1,"enter %s\n",attr_to_name(type));
82 case attr_position_fix_type:
83 attr->u.num = priv->fix_type;
86 case attr_position_height:
87 attr->u.numd = &priv->height;
89 case attr_position_speed:
90 attr->u.numd = &priv->speed;
92 case attr_position_direction:
93 attr->u.numd = &priv->direction;
95 case attr_position_radius:
96 attr->u.numd = &priv->radius;
100 case attr_position_qual:
101 attr->u.num = priv->sats;
103 case attr_position_sats_used:
104 attr->u.num = priv->sats_used;
107 case attr_position_coord_geo:
108 attr->u.coord_geo = &priv->geo;
109 if (!priv->have_coords)
112 case attr_position_time_iso8601:
113 attr->u.str=priv->fixiso8601;
123 int vehicle_null_set_attr(struct vehicle_priv *priv, struct attr *attr, struct attr **attrs)
129 struct vehicle_methods vehicle_null_methods = {
130 vehicle_null_destroy,
131 vehicle_null_position_attr_get,
132 vehicle_null_set_attr,
136 * @brief Create null_vehicle
141 * @returns vehicle_priv
143 static struct vehicle_priv *
144 vehicle_null_new_null(struct vehicle_methods *meth,
145 struct callback_list *cbl,
148 struct vehicle_priv *ret;
151 ret = g_new0(struct vehicle_priv, 1);
153 *meth = vehicle_null_methods;
159 * @brief register vehicle_null
167 plugin_register_vehicle_type("null", vehicle_null_new_null);