Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

'ETHERNET_SERVER_SEND_MAX_SIZE' was not declared in this scope #16

Closed
vaelen opened this issue Nov 15, 2022 · 2 comments
Closed

'ETHERNET_SERVER_SEND_MAX_SIZE' was not declared in this scope #16

vaelen opened this issue Nov 15, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@vaelen
Copy link

vaelen commented Nov 15, 2022

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.

khoih-prog added a commit that referenced this issue Nov 15, 2022
### 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](#16)
@khoih-prog
Copy link
Owner

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

@khoih-prog khoih-prog added the bug Something isn't working label Nov 15, 2022
@vaelen
Copy link
Author

vaelen commented Nov 16, 2022

Thanks! It is working well for me now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants