Skip to content
Snippets Groups Projects
Commit 21b07be5 authored by clohr's avatar clohr
Browse files

cas devType vide

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/C/trunk@1936 b32b6428-25c9-4566-ad07-03861ab6144f
parent 6576591a
Branches
No related tags found
No related merge requests found
......@@ -1010,8 +1010,10 @@ struct json_object *get_devices(devices_t *devices, const char *key) {
TAILQ_FOREACH(np, devices, entries)
if ( (key == NULL) || (select_kv(&(np->map), key) != NULL) ) {
jrow = json_object_new_object();
json_object_object_add(jrow, "address", json_object_new_string(np->devinfo.addr));
json_object_object_add(jrow, "devType", json_object_new_string(np->devinfo.devType));
if (np->devinfo.addr)
json_object_object_add(jrow, "address", json_object_new_string(np->devinfo.addr));
if (np->devinfo.devType)
json_object_object_add(jrow, "devType", json_object_new_string(np->devinfo.devType));
json_object_object_add(jrow, "timeout", json_object_new_int64(np->timeout));
json_object_array_add(jarray, jrow);
}
......@@ -1023,8 +1025,10 @@ struct json_object *get_devices(devices_t *devices, const char *key) {
struct json_object *get_device(device_t *device) {
struct json_object *jobj = json_object_new_object();
json_object_object_add(jobj, "address", json_object_new_string(device->devinfo.addr));
json_object_object_add(jobj, "devType", json_object_new_string(device->devinfo.devType));
if (device->devinfo.addr)
json_object_object_add(jobj, "address", json_object_new_string(device->devinfo.addr));
if (device->devinfo.devType)
json_object_object_add(jobj, "devType", json_object_new_string(device->devinfo.devType));
if (device->devinfo.vendorId)
json_object_object_add(jobj, "vendorId",
json_object_new_string(device->devinfo.vendorId));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment