Added support for setImage command for .bmp files

Implemented code for displaying .bmp images with the steImage command.
This commit is contained in:
Roelandts_Gert
2023-11-20 14:19:19 +01:00
committed by Sander Speetjens
parent e34b2855ba
commit 26f2655e3f
2 changed files with 9 additions and 7 deletions

View File

@@ -119,8 +119,13 @@ static err_t echo_recv( void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t er
check = 1;
}
else if( strncmp(tcp_buffer, "setImages", 9) == 0 ) {
else if( strncmp(tcp_buffer, "setImage", 8) == 0 ) {
char filename[len - 8];
for (int i = 0; i < len - 9; i++) {
filename[i] = tcp_buffer[i+9];
}
filename[sizeof(filename)-1] = '\0';
lcd_draw_img_from_fs(filename, 10, 10);
check = 1;
}
else if( strncmp(tcp_buffer, "exit", 4) == 0 ) {