summaryrefslogtreecommitdiff
path: root/navit/vehicle/webos
diff options
context:
space:
mode:
authorJoseph Herlant <aerostitch@users.noreply.github.com>2018-05-30 08:43:42 -0700
committerjkoan <jkoan@users.noreply.github.com>2018-05-30 17:43:42 +0200
commit567a02aa949dfa34f7b2c2246c6eb6f8818fdf01 (patch)
tree4bb102fa60f0d01db0184d1424a5fc822ba79bc9 /navit/vehicle/webos
parentcd477eb0e05b74b8dd26aa2df2778505a3b3c37c (diff)
downloadnavit-567a02aa949dfa34f7b2c2246c6eb6f8818fdf01.tar.gz
Cleanup:global:force the re-attach the return type to the function declaration (#605)
* Cleanup:global:force the re-attach the return type to the function declaration * cleanup:global:some loose ends
Diffstat (limited to 'navit/vehicle/webos')
-rw-r--r--navit/vehicle/webos/bluetooth.c65
-rw-r--r--navit/vehicle/webos/vehicle_webos.c39
2 files changed, 40 insertions, 64 deletions
diff --git a/navit/vehicle/webos/bluetooth.c b/navit/vehicle/webos/bluetooth.c
index 707478f7d..9bb94364c 100644
--- a/navit/vehicle/webos/bluetooth.c
+++ b/navit/vehicle/webos/bluetooth.c
@@ -21,8 +21,8 @@ static void vehicle_webos_spp_init_read(struct vehicle_priv *priv, unsigned int
/********************************************************************/
-static void
-mlPDL_ServiceCall_callback(struct callback_list *cbl, char *service, char *parameters/*, struct callback *fail_cb*/) {
+static void mlPDL_ServiceCall_callback(struct callback_list *cbl, char *service,
+ char *parameters/*, struct callback *fail_cb*/) {
PDL_Err err;
dbg(lvl_debug,"PDL_ServiceCall(%s) parameters(%s)",service,parameters);
err = PDL_ServiceCall(service, parameters);
@@ -35,8 +35,7 @@ mlPDL_ServiceCall_callback(struct callback_list *cbl, char *service, char *param
g_free(parameters);
}
-static void
-mlPDL_ServiceCall(const char *service, const char *parameters/*, struct callback *fail_cb = NULL*/) {
+static void mlPDL_ServiceCall(const char *service, const char *parameters/*, struct callback *fail_cb = NULL*/) {
struct callback *cb = NULL;
struct callback_list *cbl = NULL;
@@ -54,13 +53,12 @@ mlPDL_ServiceCall(const char *service, const char *parameters/*, struct callback
/********************************************************************/
-static void
-mlPDL_ServiceCallWithCallback_callback(struct callback_list *cbl,
- char *service,
- char *parameters,
- PDL_ServiceCallbackFunc callback,
- void *user,
- PDL_bool removeAfterResponse) {
+static void mlPDL_ServiceCallWithCallback_callback(struct callback_list *cbl,
+ char *service,
+ char *parameters,
+ PDL_ServiceCallbackFunc callback,
+ void *user,
+ PDL_bool removeAfterResponse) {
PDL_Err err;
dbg(lvl_debug,"PDL_ServiceCallWithCallback(%s) parameters(%s)",service,parameters);
err = PDL_ServiceCallWithCallback(service, parameters, callback, user, removeAfterResponse);
@@ -74,12 +72,11 @@ mlPDL_ServiceCallWithCallback_callback(struct callback_list *cbl,
g_free(parameters);
}
-static void
-mlPDL_ServiceCallWithCallback(const char *service,
- const char *parameters,
- PDL_ServiceCallbackFunc callback,
- void *user,
- PDL_bool removeAfterResponse) {
+static void mlPDL_ServiceCallWithCallback(const char *service,
+ const char *parameters,
+ PDL_ServiceCallbackFunc callback,
+ void *user,
+ PDL_bool removeAfterResponse) {
struct callback *cb = NULL;
struct callback_list *cbl = NULL;
@@ -98,8 +95,8 @@ mlPDL_ServiceCallWithCallback(const char *service,
/********************************************************************/
-static void
-vehicle_webos_init_pdl_locationtracking_callback(struct vehicle_priv *priv, struct callback_list *cbl, int param) {
+static void vehicle_webos_init_pdl_locationtracking_callback(struct vehicle_priv *priv, struct callback_list *cbl,
+ int param) {
PDL_Err err;
priv->gps_type = param ? GPS_TYPE_INT: GPS_TYPE_NONE;
@@ -116,8 +113,7 @@ vehicle_webos_init_pdl_locationtracking_callback(struct vehicle_priv *priv, stru
callback_list_destroy(cbl);
}
-static void
-vehicle_webos_init_pdl_locationtracking(struct vehicle_priv *priv, int param) {
+static void vehicle_webos_init_pdl_locationtracking(struct vehicle_priv *priv, int param) {
struct callback *cb = NULL;
struct callback_list *cbl = NULL;
@@ -131,8 +127,7 @@ vehicle_webos_init_pdl_locationtracking(struct vehicle_priv *priv, int param) {
/********************************************************************/
-static int
-vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer) {
+static int vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer) {
char *nmea_data_buf, *p, *item[32];
double lat, lng;
int i, bcsum;
@@ -327,8 +322,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer) {
return ret;
}
-static void
-vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user) {
+static void vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user) {
struct vehicle_priv *priv = user;
int size, rc = 0;
char *str, *tok;
@@ -391,8 +385,7 @@ vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user) {
vehicle_webos_spp_init_read(priv, buffer_size - priv->buffer_pos - 1);
}
-static void
-vehicle_webos_spp_init_read(struct vehicle_priv *priv, unsigned int length) {
+static void vehicle_webos_spp_init_read(struct vehicle_priv *priv, unsigned int length) {
//PDL_Err err;
char parameters[128];
@@ -405,8 +398,7 @@ vehicle_webos_spp_init_read(struct vehicle_priv *priv, unsigned int length) {
);
}
-static void
-vehicle_webos_spp_handle_open(PDL_ServiceParameters *params, void *user) {
+static void vehicle_webos_spp_handle_open(PDL_ServiceParameters *params, void *user) {
struct vehicle_priv *priv = (struct vehicle_priv *)user;
if (!priv->buffer)
@@ -419,8 +411,7 @@ vehicle_webos_spp_handle_open(PDL_ServiceParameters *params, void *user) {
vehicle_webos_spp_init_read(priv, buffer_size-1);
}
-static void
-vehicle_webos_spp_notify(PDL_ServiceParameters *params, void *user) {
+static void vehicle_webos_spp_notify(PDL_ServiceParameters *params, void *user) {
struct vehicle_priv *priv = user;
char notification[128];
@@ -485,8 +476,7 @@ vehicle_webos_spp_notify(PDL_ServiceParameters *params, void *user) {
}
-static void
-vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr) {
+static void vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr) {
char parameters[128];
dbg(lvl_debug,"subscribeNotifications");
@@ -502,8 +492,7 @@ vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr) {
priv->spp_address = addr;
}
-static void
-vehicle_webos_bt_gap_callback(PDL_ServiceParameters *params, void *param) {
+static void vehicle_webos_bt_gap_callback(PDL_ServiceParameters *params, void *param) {
const char *params_json;
struct vehicle_priv *priv = (struct vehicle_priv *)param;
char *device_addr = NULL;
@@ -555,8 +544,7 @@ vehicle_webos_bt_gap_callback(PDL_ServiceParameters *params, void *param) {
g_free(device_addr);
}
-int
-vehicle_webos_bt_open(struct vehicle_priv *priv) {
+int vehicle_webos_bt_open(struct vehicle_priv *priv) {
// Try to connect to BT GPS, or use PDL method
dbg(lvl_debug,"enter");
@@ -575,8 +563,7 @@ vehicle_webos_bt_open(struct vehicle_priv *priv) {
return 1;
}
-void
-vehicle_webos_bt_close(struct vehicle_priv *priv) {
+void vehicle_webos_bt_close(struct vehicle_priv *priv) {
dbg(lvl_debug,"XXX");
char parameters[128];
if (priv->spp_instance_id) {
diff --git a/navit/vehicle/webos/vehicle_webos.c b/navit/vehicle/webos/vehicle_webos.c
index 31f4b6cda..04dc90ae2 100644
--- a/navit/vehicle/webos/vehicle_webos.c
+++ b/navit/vehicle/webos/vehicle_webos.c
@@ -49,8 +49,7 @@ static char *vehicle_webos_prefix="webos:";
/*******************************************************************/
-static void
-vehicle_webos_callback(PDL_ServiceParameters *params, void *priv) {
+static void vehicle_webos_callback(PDL_ServiceParameters *params, void *priv) {
PDL_Location *location;
SDL_Event event;
SDL_UserEvent userevent;
@@ -84,8 +83,7 @@ vehicle_webos_callback(PDL_ServiceParameters *params, void *priv) {
return /*PDL_NOERROR*/;
}
-static void
-vehicle_webos_gps_update(struct vehicle_priv *priv, PDL_Location *location) {
+static void vehicle_webos_gps_update(struct vehicle_priv *priv, PDL_Location *location) {
if(location) { // location may be NULL if called by bluetooth-code. priv is already prefilled there
struct timeval tv;
gettimeofday(&tv,NULL);
@@ -122,8 +120,7 @@ vehicle_webos_gps_update(struct vehicle_priv *priv, PDL_Location *location) {
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
}
-static void
-vehicle_webos_timeout_callback(struct vehicle_priv *priv) {
+static void vehicle_webos_timeout_callback(struct vehicle_priv *priv) {
struct timeval tv;
gettimeofday(&tv,NULL);
@@ -140,8 +137,7 @@ vehicle_webos_timeout_callback(struct vehicle_priv *priv) {
}
}
-void
-vehicle_webos_close(struct vehicle_priv *priv) {
+void vehicle_webos_close(struct vehicle_priv *priv) {
event_remove_timeout(priv->ev_timeout);
priv->ev_timeout = NULL;
@@ -155,8 +151,7 @@ vehicle_webos_close(struct vehicle_priv *priv) {
}
}
-static int
-vehicle_webos_open(struct vehicle_priv *priv) {
+static int vehicle_webos_open(struct vehicle_priv *priv) {
PDL_Err err;
priv->pdk_version = PDL_GetPDKVersion();
@@ -193,17 +188,15 @@ vehicle_webos_open(struct vehicle_priv *priv) {
return 1;
}
-static void
-vehicle_webos_destroy(struct vehicle_priv *priv) {
+static void vehicle_webos_destroy(struct vehicle_priv *priv) {
vehicle_webos_close(priv);
if (priv->source)
g_free(priv->source);
g_free(priv);
}
-static int
-vehicle_webos_position_attr_get(struct vehicle_priv *priv,
- enum attr_type type, struct attr *attr) {
+static int vehicle_webos_position_attr_get(struct vehicle_priv *priv,
+ enum attr_type type, struct attr *attr) {
switch (type) {
case attr_position_height:
dbg(lvl_info,"Altitude: %f", priv->altitude);
@@ -310,8 +303,7 @@ vehicle_webos_position_attr_get(struct vehicle_priv *priv,
return 1;
}
-static int
-vehicle_webos_set_attr_do(struct vehicle_priv *priv, struct attr *attr, int init) {
+static int vehicle_webos_set_attr_do(struct vehicle_priv *priv, struct attr *attr, int init) {
switch (attr->type) {
case attr_source:
if (strncmp(vehicle_webos_prefix,attr->u.str,strlen(vehicle_webos_prefix))) {
@@ -338,8 +330,7 @@ vehicle_webos_set_attr_do(struct vehicle_priv *priv, struct attr *attr, int init
}
}
-static int
-vehicle_webos_set_attr(struct vehicle_priv *priv, struct attr *attr) {
+static int vehicle_webos_set_attr(struct vehicle_priv *priv, struct attr *attr) {
return vehicle_webos_set_attr_do(priv, attr, 0);
}
@@ -349,10 +340,9 @@ struct vehicle_methods vehicle_webos_methods = {
vehicle_webos_set_attr,
};
-static struct vehicle_priv *
-vehicle_webos_new(struct vehicle_methods
- *meth, struct callback_list
- *cbl, struct attr **attrs) {
+static struct vehicle_priv *vehicle_webos_new(struct vehicle_methods
+ *meth, struct callback_list
+ *cbl, struct attr **attrs) {
struct vehicle_priv *priv;
priv = g_new0(struct vehicle_priv, 1);
@@ -372,8 +362,7 @@ vehicle_webos_new(struct vehicle_methods
return priv;
}
-void
-plugin_init(void) {
+void plugin_init(void) {
dbg(lvl_debug, "enter");
plugin_register_category_vehicle("webos", vehicle_webos_new);
}