This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

6678网口与PC机通信的问题



在例程client中SendRawEth函数中,在传送码流send(sraw,(char *)pBuffer,PACKET_SIZE,0)之前,有一段程序是设置Source MAC,Destination MAC,这是MAC地址的意思吗

 for (i = 0; i < 6; i++)
  {
      src_mac[i] = 0x10 + i;
  }

     for (i = 0; i < 6; i++)
         dst_mac[i] = 0x20 + i + 2;

我的问题是网口发送数据时是按MAC地址发送的吗? 那DSP的MAC地址应该怎么设置呢?看了一些资料说用send函数需要先将套接字和一个地址绑定,在程序中没有看出这里的Source MAC(或者IP地址)和套接字绑定的程序啊?求指导!不胜感激!

 

  • C6678硬件网口原则上可以发送任意的数据,不会对MAC地址进行过滤,当然如果你想设定某个网口发送固定MAC地址的数据也是可以,这都是可以由软件配置即可。DSP的MAC地址可以通过配置MACSrcAddr register配置。