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

Version 0.7

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/C/branches/version-0.7@2338 b32b6428-25c9-4566-ad07-03861ab6144f
parent 742d6fab
Branches
No related tags found
No related merge requests found
......@@ -325,7 +325,7 @@ bool xAAL_read_bus(const xAAL_businfo_t *bus,
if (cmsg == NULL) {
if (xAAL_error_log) fprintf(xAAL_error_log, "CBOR error in message; code %d, position %lu\n", cresult.error.code, cresult.error.position);
return false;
} else if ( !cbor_isa_array(cmsg) || cbor_array_is_indefinite(cmsg) || (cbor_array_size(cmsg)!=5) ) {
} else if ( !cbor_isa_array(cmsg) || (cbor_array_size(cmsg)!=5) ) {
if (xAAL_error_log) fprintf(xAAL_error_log, "Received message is not a cbor definite array[5]\n");
cbor_decref(&cmsg);
return false;
......@@ -339,12 +339,12 @@ bool xAAL_read_bus(const xAAL_businfo_t *bus,
*/
/* version */
cversion = cbor_move(cbor_array_get(cmsg, 0));
if ( !cbor_isa_uint(cversion) || (cbor_int_get_width(cversion)!=CBOR_INT_8) ) {
if ( !cbor_isa_uint(cversion) ) {
if (xAAL_error_log) fprintf(xAAL_error_log, "Invalid 'version' field in xAAL message\n");
cbor_decref(&cmsg);
return false;
}
if ( cbor_get_uint8(cversion) != xAAL_VERSION ) {
if ( cbor_get_int(cversion) != xAAL_VERSION ) {
if (xAAL_error_log) fprintf(xAAL_error_log, "Invalid 'version' value in xAAL message\n");
cbor_decref(&cmsg);
return false;
......@@ -435,7 +435,7 @@ bool xAAL_read_bus(const xAAL_businfo_t *bus,
if (cpayload == NULL) {
if (xAAL_error_log) fprintf(xAAL_error_log, "CBOR error in payload; code %d, position %lu\n", cresult.error.code, cresult.error.position);
return false;
} else if (!cbor_isa_array(cpayload) || cbor_array_is_indefinite(cpayload) || (cbor_array_size(cpayload)<4) || (cbor_array_size(cpayload)>5) ) {
} else if (!cbor_isa_array(cpayload) || (cbor_array_size(cpayload)<4) || (cbor_array_size(cpayload)>5) ) {
if (xAAL_error_log) fprintf(xAAL_error_log, "Decoded 'payload' field is not a cbor defined array[4|5]\n");
cbor_decref(&cpayload);
cbor_decref(ctargets);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment