| 324 | } |
| 325 | |
| 326 | uint16_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 | |
| 358 | uint16_t bufferData(SOCKET s, uint16_t offset, const uint8_t* buf, uint16_t len) |
| 359 | { |
nothing calls this directly
no test coverage detected