mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
AP_HAL: added IP4_STR_LEN
This commit is contained in:
parent
4e49481d3a
commit
07fee626d9
@ -360,8 +360,7 @@ ssize_t SOCKET_CLASS_NAME::recv(void *buf, size_t size, uint32_t timeout_ms)
|
|||||||
*/
|
*/
|
||||||
void SOCKET_CLASS_NAME::last_recv_address(const char *&ip_addr, uint16_t &port) const
|
void SOCKET_CLASS_NAME::last_recv_address(const char *&ip_addr, uint16_t &port) const
|
||||||
{
|
{
|
||||||
// 16 bytes for aaa.bbb.ccc.ddd with null term
|
static char buf[IP4_STR_LEN];
|
||||||
static char buf[16];
|
|
||||||
auto *str = last_recv_address(buf, sizeof(buf), port);
|
auto *str = last_recv_address(buf, sizeof(buf), port);
|
||||||
ip_addr = str;
|
ip_addr = str;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#error "Don't include Socket.hpp directly"
|
#error "Don't include Socket.hpp directly"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define IP4_STR_LEN 16
|
||||||
|
|
||||||
class SOCKET_CLASS_NAME {
|
class SOCKET_CLASS_NAME {
|
||||||
public:
|
public:
|
||||||
SOCKET_CLASS_NAME(bool _datagram);
|
SOCKET_CLASS_NAME(bool _datagram);
|
||||||
|
Loading…
Reference in New Issue
Block a user