khoih-prog/Ethernet_Generic

'ETHERNET_SERVER_SEND_MAX_SIZE' was not declared in this scope

vaelen opened this issue · 2 comments

Error:

Ethernet_Generic/src/EthernetServer_Impl.h:364:81: error: 'ETHERNET_SERVER_SEND_MAX_SIZE' was not declared in this scope

If you don't enable large buffer support, then the ETHERNET_SERVER_SEND_MAX_SIZE constant is not defiend and the code doesn't compile.

EthernetServer_Impl.h:327:

// Don't use larger size or hang, max is 16K for 1 socket
#ifdef ETHERNET_LARGE_BUFFERS
  #if MAX_SOCK_NUM <= 1
    #define ETHERNET_SERVER_SEND_MAX_SIZE         16384
  #elif MAX_SOCK_NUM <= 2
    #define ETHERNET_SERVER_SEND_MAX_SIZE         8192
  #elif MAX_SOCK_NUM <= 4
    #define ETHERNET_SERVER_SEND_MAX_SIZE         4096
  #else
    #define ETHERNET_SERVER_SEND_MAX_SIZE         2048
  #endif
#endif

EthernetServer_Impl.h:364

   written =  Ethernet.socketSend(sockindex, buf, min(bytesRemaining, (size_t) ETHERNET_SERVER_SEND_MAX_SIZE) );

I didn't submit a PR because I'm not sure what the constant should be set to if large buffers is disabled.

Hi @vaelen

The new Ethernet_Generic v2.7.1 has just been published. Your contribution is noted in Contributions and Thanks.

Please have more rigorous tests to see if there still are some more bugs.

Best Regards,


Releases v2.7.1

  1. Auto-detect W5x00 and settings (ETHERNET_LARGE_BUFFERS, MAX_SOCK_NUM) to set MAX_SIZE to send. Check 'ETHERNET_SERVER_SEND_MAX_SIZE' was not declared in this scope #16

Thanks! It is working well for me now.