if (0 == ret)
{
+ json_object *jresp = json_object_new_object();
+ json_object *jstring;
+
+ jstring = json_object_new_string("connected");
+ json_object_object_add(jresp, "Status", jstring);
+
+ jstring = json_object_new_string(value);
+ json_object_object_add(jresp, "Address", jstring);
+
+ event_push(jresp, "connection");
afb_req_success (request, NULL, NULL);
}
else
ret = device_disconnect(value, NULL);
if (0 == ret)
{
+ json_object *jresp = json_object_new_object();
+ json_object *jstring;
+
+ jstring = json_object_new_string("disconnected");
+ json_object_object_add(jresp, "Status", jstring);
+
+ jstring = json_object_new_string(value);
+ json_object_object_add(jresp, "Address", jstring);
+
+ event_push(jresp, "connection");
afb_req_success (request, NULL, NULL);
}
else