changes for rmac field which ist not a pointer anymore.

FossilOrigin-Name: 08bba10bce17f15c02e6542bf41d1f9be56c16b1010cb71298a62c1717401622
This commit is contained in:
7u83@mail.ru 2014-07-28 04:47:53 +00:00
parent 8378a8152d
commit 0947bdb5b9
1 changed files with 14 additions and 5 deletions

View File

@ -30,11 +30,20 @@ void cwmsg_init(struct cwmsg * cwmsg, uint8_t *buffer, int type, int seqnum, str
cwmsg->buffer=buffer;
cwmsg->trnsprthdr=buffer;
#ifdef WITH_RMAC_SUPPORT
//#ifdef WITH_RMAC_SUPPORT
int rmaclen;
if (radioinfo->rmac){
rmaclen=(*radioinfo->rmac)+1;
memcpy(buffer+8,radioinfo->rmac,rmaclen);
if (radioinfo->rmac[0]){
/* we assume the radio mac is already aligned */
rmaclen=(*radioinfo->rmac);
printf ("Adding rmac len %d\n",rmaclen);
printf ("Real copy woul dbe %d\n",rmaclen/8+8);
memcpy(buffer+8,radioinfo->rmac,rmaclen/8+8);
cwmsg->flags=CWTH_FLAGS_M;
}
else
@ -45,7 +54,7 @@ void cwmsg_init(struct cwmsg * cwmsg, uint8_t *buffer, int type, int seqnum, str
hlen+=rmaclen;
if (hlen%4)
hlen = (hlen>>2)*4+4;
#endif
//#endif
cwmsg->ctrlhdr=cwmsg->trnsprthdr+hlen;