#ifndef __HTTP_UTILS_H__
#define __HTTP_UTILS_H__

#ifdef  __cplusplus
extern "C" {
#endif
#include <stdbool.h>

int is_ip_legal(const char *ip);
int get_ip_by_domain(char *domain, char dest[16], int dest_len);
void progress_bar(long cur_size, long total_size);
int http_get(const char url[1024], const char path[256], char file_dest[512], int file_dest_len);
int http_post_uploadlog(char *url, char *msg_id, char *logfilename);
int http_get_getdevregisterstatus(char *url);
int http_post_getdevinfo(char *url, char *devcodetmp, char *devcode);
int http_download(char *url, char *msg_id,int task_id,char *filepath);
extern char devOwnSn[64];
extern char devOwnSn_save[64];
extern char dbSn[64];
extern char deviceSecrets[64];
extern bool openDoorWaited;
extern bool optBatchIn;
extern bool newappDownloaded;
extern void returnDevs_multy(char *args);
extern void repairReturnDevs_multy(char *args);
#ifdef  __cplusplus
}
#endif

#endif
