http - add hprint128 - to simplify printing and sending to http response...

This commit is contained in:
btsimonh
2022-02-10 22:06:46 +00:00
parent dd25a5a993
commit 04f28b3d6e
2 changed files with 14 additions and 0 deletions

View File

@ -352,6 +352,17 @@ int poststr(http_request_t *request, const char *str){
return postany(request, str, strlen(str));
}
int hprintf128(http_request_t *request, const char *fmt, ...){
va_list argList;
BaseType_t taken;
char tmp[128];
va_start(argList, fmt);
vsprintf(tmp, fmt, argList);
va_end(argList);
return postany(request, tmp, strlen(tmp));
}
int HTTP_ProcessPacket(http_request_t *request) {
int i, j;
char tmpA[128];

View File

@ -39,6 +39,9 @@ int HTTP_ProcessPacket(http_request_t *request);
void http_setup(http_request_t *request, const char *type);
int poststr(http_request_t *request, const char *str);
// poststr with format - for results LESS THAN 128
int hprintf128(http_request_t *request, const char *fmt, ...);
enum {
HTTP_ANY = -1,
HTTP_GET = 0,