blob: 4c4511757cdbfde20a5cc50c8e4c3251a86beaed [file] [log] [blame]
#ifndef _WEFOTA_SOCKET_H_
#define _WEFOTA_SOCKET_H_
#include <arpa/inet.h>
int create_udp_socket(void);
void close_udp_socket(int sock);
int init_server_addr(struct sockaddr_in* addr, const char* ip, int port);
int send_message(int sock, const void* msg, size_t len, struct sockaddr_in* server_addr);
int receive_message(int sock, void* response, size_t response_size, struct sockaddr_in* server_addr);
int set_recv_timeout(int sock, int timeout_sec);
#endif