simple IR2 driver for sending captures from flipper zero

* test

* Update drv_ir2.c

* fx

* fx

* fx

* qq

* test3

* tok

* test duty

* fx

* hdr

* fx

* fx

* tr

* n header

* tr

* tr

* fx

* fx

* test

* tr

tr

* fx

* simpler

* fx

* test

* fx

* dbg

* tr

* tr

* fx

* fx

* fx

* tr

* fx

* pin select

* fx

* fx

* Update drv_ir2.c

* Update drv_ir2.c

* try

* Update drv_ir2.c

* Update drv_ir2.c

* fx

* Update drv_ir2.c

* args len

* http_fn_cmd_tool: len

* better buffer handling

* try lager buffer

* clear

* Update drv_ir2.c

* long packet self tests

* Update drv_ir2.c

* Update drv_ir2.c

* alternate alias

* Queue size

* fx

* fx

* disable

* sample
This commit is contained in:
openshwprojects
2024-07-06 00:42:25 +02:00
committed by GitHub
parent f7dbf2a1be
commit e1f8e59e13
13 changed files with 565 additions and 9 deletions

View File

@ -1548,6 +1548,7 @@ int http_fn_cmd_tool(http_request_t* request) {
poststr(request, "Remember that some commands are added after a restart when a driver is activated... <br>");
commandLen = http_getArg(request->url, "cmd", tmpA, sizeof(tmpA));
addLogAdv(LOG_ERROR, LOG_FEATURE_HTTP, "http_fn_cmd_tool: len %i",commandLen);
if (commandLen) {
poststr(request, "<br>");
// all log printfs made by command will be sent also to request

View File

@ -91,7 +91,25 @@ static void tcp_client_thread(beken_thread_arg_t arg)
request.received = buf;
request.receivedLenmax = INCOMING_BUFFER_SIZE - 2;
request.responseCode = HTTP_RESPONSE_OK;
request.receivedLen = recv(fd, request.received, request.receivedLenmax, 0);
request.receivedLen = 0;
while (1) {
int remaining = request.receivedLenmax - request.receivedLen;
int received = recv(fd, request.received + request.receivedLen, remaining, 0);
if (received <= 0) {
break;
}
request.receivedLen += received;
if (received < remaining) {
break;
}
// grow by 1024
request.receivedLenmax += 1024;
request.received = (char*)realloc(request.received, request.receivedLenmax+2);
if (request.received == NULL) {
// no memory
return;
}
}
request.received[request.receivedLen] = 0;
request.reply = reply;