|
@@ -205,7 +205,7 @@ void nvcan::run()
|
|
if((frame.can_id&0x40000000)!= 0)msg.isRemote = true;
|
|
if((frame.can_id&0x40000000)!= 0)msg.isRemote = true;
|
|
else msg.isRemote = false;
|
|
else msg.isRemote = false;
|
|
msg.nLen = frame.len;
|
|
msg.nLen = frame.len;
|
|
- if((frame.len<9)&&(frame.len>0))memcpy(msg.data,frame.data,frame.len);
|
|
|
|
|
|
+ if((frame.len<64)&&(frame.len>0))memcpy(msg.data,frame.data,frame.len);
|
|
if(mMsgRecvBuf[i].size()<BUF_SIZE)
|
|
if(mMsgRecvBuf[i].size()<BUF_SIZE)
|
|
{
|
|
{
|
|
mMsgRecvBuf[i].push_back(msg);
|
|
mMsgRecvBuf[i].push_back(msg);
|
|
@@ -235,6 +235,7 @@ void nvcan::run()
|
|
|
|
|
|
struct canfd_frame framesend[2500];
|
|
struct canfd_frame framesend[2500];
|
|
|
|
|
|
|
|
+
|
|
for(int nch =0;nch<currmax;nch++)
|
|
for(int nch =0;nch<currmax;nch++)
|
|
{
|
|
{
|
|
int nsend = 0;
|
|
int nsend = 0;
|
|
@@ -266,11 +267,18 @@ void nvcan::run()
|
|
if(nsend > 0)
|
|
if(nsend > 0)
|
|
{
|
|
{
|
|
for(i=0;i<nsend;i++)
|
|
for(i=0;i<nsend;i++)
|
|
- if (write(s[nch], &framesend[i],16) != 16) {
|
|
|
|
|
|
+ {
|
|
|
|
+ int nsendbyte = 16;
|
|
|
|
+ if(framesend[i].len>8)
|
|
|
|
+ {
|
|
|
|
+ nsendbyte = CANFD_MTU;
|
|
|
|
+ }
|
|
|
|
+ if (write(s[nch], &framesend[i],nsendbyte) != nsendbyte) {
|
|
mivlog->error("write error 1");
|
|
mivlog->error("write error 1");
|
|
perror("write error 1.");
|
|
perror("write error 1.");
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|