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