Skip to content
Snippets Groups Projects
Commit 079ea802 authored by clohr's avatar clohr
Browse files

Support alive msgs without timeout

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/xAAL_C/tags/testing_jansson@437 b32b6428-25c9-4566-ad07-03861ab6144f
parent 50a65265
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -310,7 +310,7 @@ int main(int argc, char **argv) { ...@@ -310,7 +310,7 @@ int main(int argc, char **argv) {
int ttl = -1; int ttl = -1;
int arg_error = 0; int arg_error = 0;
int attribute_light = 0; int attribute_light = 0;
json_t *my_uuid, *my_devType, *bcast, *any_any; json_t *my_uuid, *my_devType, *bcast; //, *any_any;
struct sigaction act_alarm; struct sigaction act_alarm;
uuid_clear(uuid); uuid_clear(uuid);
...@@ -366,7 +366,7 @@ int main(int argc, char **argv) { ...@@ -366,7 +366,7 @@ int main(int argc, char **argv) {
/* Init some json objects */ /* Init some json objects */
my_devType = json_string("lamp.basic"); my_devType = json_string("lamp.basic");
bcast = json_string("'00000000-0000-0000-0000-000000000000"); bcast = json_string("'00000000-0000-0000-0000-000000000000");
any_any = json_string("any.any"); // any_any = json_string("any.any");
/* Manage alive notifications */ /* Manage alive notifications */
...@@ -414,7 +414,7 @@ int main(int argc, char **argv) { ...@@ -414,7 +414,7 @@ int main(int argc, char **argv) {
if ( parseHeader(jroot, &jversion, &jsource, &jtarget, &jmsgType, &jdevType, if ( parseHeader(jroot, &jversion, &jsource, &jtarget, &jmsgType, &jdevType,
&jaction, &jcipher, &jsignature, &jtimestamp) &jaction, &jcipher, &jsignature, &jtimestamp)
&& (json_equal(jtarget, my_uuid) || json_equal(jtarget, bcast)) && (json_equal(jtarget, my_uuid) || json_equal(jtarget, bcast))
&& (json_equal(jdevType, my_devType) || json_equal(jdevType, any_any)) // && (json_equal(jdevType, my_devType) || json_equal(jdevType, any_any)) // xAAL v0.4 remove this filter
&& json_equal(jversion, json_string(xAAL_VERSION)) && json_equal(jversion, json_string(xAAL_VERSION))
&& json_equal(jmsgType, json_string("request")) ) { && json_equal(jmsgType, json_string("request")) ) {
/* ok, this is a request for me */ /* ok, this is a request for me */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment