/*
- * Copyright (C) 2010-2013 jeanfi@gmail.com
+ * Copyright (C) 2010-2014 jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
return ret;
}
-void rsensor_init()
+void rsensor_init(void)
{
curl = curl_easy_init();
}
-void rsensor_cleanup()
+void rsensor_cleanup(void)
{
curl_easy_cleanup(curl);
}
return sensors;
}
-void remote_psensor_update(struct psensor *s)
+static void remote_psensor_update(struct psensor *s)
{
json_object *obj;
if (obj && !is_error(obj)) {
json_object *om;
- om = json_object_object_get(obj, "last_measure");
+ json_object_object_get_ex(obj, "last_measure", &om);
if (!is_error(obj)) {
json_object *ov, *ot;
struct timeval tv;
- ov = json_object_object_get(om, "value");
- ot = json_object_object_get(om, "time");
+ json_object_object_get_ex(om, "value", &ov);
+ json_object_object_get_ex(om, "time", &ot);
tv.tv_sec = json_object_get_int(ot);
tv.tv_usec = 0;