Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
http-svc: handle alises more efficiently
[src/app-framework-binder.git]
/
plugins
/
radio
/
radio-api.c
diff --git
a/plugins/radio/radio-api.c
b/plugins/radio/radio-api.c
index
b09cea8
..
ea17eb5
100644
(file)
--- a/
plugins/radio/radio-api.c
+++ b/
plugins/radio/radio-api.c
@@
-17,7
+17,6
@@
*/
#include "radio-api.h"
*/
#include "radio-api.h"
-#include "radio-rtlsdr.h"
/* ********************************************************
/* ********************************************************
@@
-131,7
+130,8
@@
STATIC json_object* init (AFB_request *request) { /* AFB_SESSION_CHECK */
json_object *jresp;
/* create a private client context */
json_object *jresp;
/* create a private client context */
- request->context = initRadioCtx();
+ if (!request->context)
+ request->context = initRadioCtx();
jresp = json_object_new_object();
json_object_object_add(jresp, "info", json_object_new_string ("Radio initialized"));
jresp = json_object_new_object();
json_object_object_add(jresp, "info", json_object_new_string ("Radio initialized"));
@@
-176,6
+176,8
@@
STATIC json_object* power (AFB_request *request) { /* AFB_SESSION_CHECK */
jresp = json_object_new_object();
json_object_object_add (jresp, "power", json_object_new_string ("off"));
}
jresp = json_object_new_object();
json_object_object_add (jresp, "power", json_object_new_string ("off"));
}
+ else
+ jresp = NULL;
return jresp;
}
return jresp;
}