Code Monkey home page Code Monkey logo

Comments (9)

jcw avatar jcw commented on June 13, 2024

Committed, thanks.

from ethercard.

rawouter avatar rawouter commented on June 13, 2024

Hi there!

First post so: thanks a lot for the work, I'm using this lib for a while now! Best one IMO :-)

I was actually using the following hack to cope with this issue, because I want to send the packets to the network broadcast IP, not full broadcast (i.e. 192.168.1.255) :

if ((dip[0] & 0xF0) == 0xE0 || dip[3] == 0xFF)

Thanks!
R.

from ethercard.

thefrip avatar thefrip commented on June 13, 2024

Indeed, works as well. But I thought the partial broadcast was not
working on the card, only the full one?

Le 01/11/2012 20:54, RaphYot a écrit :

Hi there!

First post so: thanks a lot for the work, I'm using this lib for a
while now! Best one IMO :-)

I was actually using the following hack to cope with this issue,
because I want to send the packets to the network broadcast IP, not
full broadcast (i.e. 192.168.1.255) :

if ((dip[0] & 0xF0) == 0xE0 || dip[3] == 0xFF)

Thanks!
R.


Reply to this email directly or view it on GitHub
#59 (comment).

from ethercard.

thefrip avatar thefrip commented on June 13, 2024

You are welcome.

Le 01/11/2012 10:19, Jean-Claude Wippler a écrit :

Committed, thanks.


Reply to this email directly or view it on GitHub
#59 (comment).

from ethercard.

rawouter avatar rawouter commented on June 13, 2024

I can send broadcast packet that way without issue. The only problem I see is that it's just a partial solution as without the mask you don't know the real broadcast address.

What kind of issue do you mean? With the new lib it seems I'm not receiving my network broadcast anymore on the arduino (although I enabled broadcast), but it was working on an older project so I suppose this should be feasible.

from ethercard.

jcw avatar jcw commented on June 13, 2024

I'd be happy to change it to a single-byte check, and just make 255.255.255.0 the default netmask that way. Ought to work for msot cases.

from ethercard.

shagru avatar shagru commented on June 13, 2024

I am having problem with sendUdp() and I traced the problem to this line
if ((dip[0] & 0xF0) == 0xE0 || ((long) dip) == 0xFFFFFFFF)
EtherCard::copyMac(gPB + ETH_DST_MAC, allOnes);
After commenting out this line, and sendUdp() works nicely. With this line, the sending would fail. The problem is reported in the following post by others as well...
http://jeelabs.net/boards/7/topics/1179

Does anyone know what the problem is?

from ethercard.

jnogues avatar jnogues commented on June 13, 2024

I'm try use sendTcp() and doesn't work, but if comment the line proposed for shagru, then works OK.
Thanks for your trick, but why is not change in the library?

from ethercard.

comotion avatar comotion commented on June 13, 2024

The problem @shagru has might be related to the multicast check (I don't know) but @jnogues makes no sense, those lines are unrelated to sendTcp()

I also have the problem that UDP broadcast has a mac of 0x00000000, and the proposed fix doesn't work for me because I do

  ether.sendUdp((char*) buf, pos, srcport, ether.broadcastip, dstport);

Would the fix be more correct if the check was for ether.broadcastip?

    if ((dip[0] & 0xF0) == 0xE0 || *((unsigned long*) dip) == 0xFFFFFFFF 
            || (memcmp(dip, EtherCard::broadcastip, 4) == 0)) //not subnet broadcast
        EtherCard::copyMac(gPB + ETH_DST_MAC, allOnes);

?

from ethercard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.