MrTaco
03.05.2009, 17:40
Ich benutze die lib von Pascal Stang
hier die seite http://www.mil.ufl.edu/~chrisarnold/components/microcontrollerBoard/AVR/avrlib/docs/html/main.html
Ich mus einen Ethernetframe hinzufügen für die variabel "packet".
Jedoch wie?
char str1[] = "Ethernetframe";
char *p = "Ethernetframe";
und dann übergeben?
00385 void enc28j60PacketSend(unsigned int len, unsigned char* packet)
00386 {
00387 // Set the write pointer to start of transmit buffer area
00388 enc28j60Write(EWRPTL, TXSTART_INIT);
00389 enc28j60Write(EWRPTH, TXSTART_INIT>>8);
00390 // Set the TXND pointer to correspond to the packet size given
00391 enc28j60Write(ETXNDL, (TXSTART_INIT+len));
00392 enc28j60Write(ETXNDH, (TXSTART_INIT+len)>>8);
00393
00394 // write per-packet control byte
00395 enc28j60WriteOp(ENC28J60_WRITE_BUF_MEM, 0, 0x00);
00396
00397 // copy the packet into the transmit buffer
00398 enc28j60WriteBuffer(len, packet);
00399
00400 // send the contents of the transmit buffer onto the network
00401 enc28j60WriteOp(ENC28J60_BIT_FIELD_SET, ECON1, ECON1_TXRTS);
00402 }
hier die seite http://www.mil.ufl.edu/~chrisarnold/components/microcontrollerBoard/AVR/avrlib/docs/html/main.html
Ich mus einen Ethernetframe hinzufügen für die variabel "packet".
Jedoch wie?
char str1[] = "Ethernetframe";
char *p = "Ethernetframe";
und dann übergeben?
00385 void enc28j60PacketSend(unsigned int len, unsigned char* packet)
00386 {
00387 // Set the write pointer to start of transmit buffer area
00388 enc28j60Write(EWRPTL, TXSTART_INIT);
00389 enc28j60Write(EWRPTH, TXSTART_INIT>>8);
00390 // Set the TXND pointer to correspond to the packet size given
00391 enc28j60Write(ETXNDL, (TXSTART_INIT+len));
00392 enc28j60Write(ETXNDH, (TXSTART_INIT+len)>>8);
00393
00394 // write per-packet control byte
00395 enc28j60WriteOp(ENC28J60_WRITE_BUF_MEM, 0, 0x00);
00396
00397 // copy the packet into the transmit buffer
00398 enc28j60WriteBuffer(len, packet);
00399
00400 // send the contents of the transmit buffer onto the network
00401 enc28j60WriteOp(ENC28J60_BIT_FIELD_SET, ECON1, ECON1_TXRTS);
00402 }