zw.wang | 96c5d4e | 2025-07-01 11:35:13 +0800 | [diff] [blame^] | 1 | #ifndef _WEFOTA_SOCKET_H_
|
| 2 | #define _WEFOTA_SOCKET_H_
|
| 3 |
|
| 4 | #include <arpa/inet.h>
|
| 5 |
|
| 6 |
|
| 7 | int create_udp_socket(void);
|
| 8 | void close_udp_socket(int sock);
|
| 9 | int init_server_addr(struct sockaddr_in* addr, const char* ip, int port);
|
| 10 | int send_message(int sock, const void* msg, size_t len, struct sockaddr_in* server_addr);
|
| 11 | int receive_message(int sock, void* response, size_t response_size, struct sockaddr_in* server_addr);
|
| 12 | int set_recv_timeout(int sock, int timeout_sec);
|
| 13 |
|
| 14 | #endif |