X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/92b76dca553a98a228f368f8ff6eedc25e33b870..d659fb1c5ce646e10820cfd349d8a4220d1ee67d:/lincan/src/write_rtl.c diff --git a/lincan/src/write_rtl.c b/lincan/src/write_rtl.c index a1d4647..70af511 100644 --- a/lincan/src/write_rtl.c +++ b/lincan/src/write_rtl.c @@ -47,8 +47,10 @@ ssize_t can_write_rtl_posix(struct rtl_file *fptr, const char *buffer, qends = canuser->qends; msg_flags=msg_buff->flags; - /* Automatic selection of extended format if "extended" set and ID>2047 */ - if (extended) if (msg_buff->id & ~0x7ffl ) msg_flags |= MSG_EXT; + + /* Automatic selection of extended format if ID>2047 */ + if (msg_buff->id & ~0x7ffl & MSG_ID_MASK ) msg_flags |= MSG_EXT; + /* has been dependent on "extended" option */ /* If the output buffer is full, return immediately in case O_NONBLOCK * has been specified or loop until space becomes available. @@ -82,8 +84,11 @@ ssize_t can_write_rtl_posix(struct rtl_file *fptr, const char *buffer, while (bytes_to_copy >= sizeof(struct canmsg_t)) { bytes_to_copy -= sizeof(struct canmsg_t); msg_flags=msg_buff->flags; - /* Automatic selection of extended format if "extended" set and ID>2047 */ - if (extended) if (msg_buff->id & ~0x7ffl ) msg_flags |= MSG_EXT; + + /* Automatic selection of extended format if ID>2047 */ + if (msg_buff->id & ~0x7ffl & MSG_ID_MASK ) msg_flags |= MSG_EXT; + /* has been dependent on "extended" option */ + /* Get slot */ if(canque_get_inslot4id(qends, &qedge, &slot, 0, msg_buff->id, 0) < 0) break;