MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / igmpsend

Function igmpsend

Arduino/libraries/Ethernet2/src/utility/socket.cpp:326–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326uint16_t igmpsend(SOCKET s, const uint8_t * buf, uint16_t len)
327{
328 uint8_t status=0;
329 uint16_t ret=0;
330
331 if (len > w5500.SSIZE)
332 ret = w5500.SSIZE; // check size not to exceed MAX size.
333 else
334 ret = len;
335
336 if (ret == 0)
337 return 0;
338
339 w5500.send_data_processing(s, (uint8_t *)buf, ret);
340 w5500.execCmdSn(s, Sock_SEND);
341
342 while ( (w5500.readSnIR(s) & SnIR::SEND_OK) != SnIR::SEND_OK )
343 {
344 status = w5500.readSnSR(s);
345 if (w5500.readSnIR(s) & SnIR::TIMEOUT)
346 {
347 /* in case of igmp, if send fails, then socket closed */
348 /* if you want change, remove this code. */
349 close(s);
350 return 0;
351 }
352 }
353
354 w5500.writeSnIR(s, SnIR::SEND_OK);
355 return ret;
356}
357
358uint16_t bufferData(SOCKET s, uint16_t offset, const uint8_t* buf, uint16_t len)
359{

Callers

nothing calls this directly

Calls 3

send_data_processingMethod · 0.80
execCmdSnMethod · 0.80
closeFunction · 0.70

Tested by

no test coverage detected