tcp_cmd
convert text to english
This commit is contained in:
@@ -22,20 +22,21 @@ void tcp_cmd_write(struct tcp_pcb* pcb, const char* str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void tcp_cmd_print_header(struct tcp_pcb* pcb) {
|
void tcp_cmd_print_header(struct tcp_pcb* pcb) {
|
||||||
tcp_cmd_write(pcb, " Welcome bij de TCP CMD Interface\r\n"
|
tcp_cmd_write(pcb, " Welcome to the TCP CMD interface\r\n"
|
||||||
"(Typ help voor een lijst van de commando's! X om te sluiten)\r\n"
|
"(Type help for a list of the commands! exit to close)\r\n"
|
||||||
"============================================================\r\n"
|
"============================================================\r\n"
|
||||||
"User: ");
|
"$>");
|
||||||
}
|
}
|
||||||
|
|
||||||
void tcp_cmd_print_help(struct tcp_pcb* pcb) {
|
void tcp_cmd_print_help(struct tcp_pcb* pcb) {
|
||||||
tcp_cmd_write(pcb, "help : laat lijst zien met alle commando's\r\n"
|
tcp_cmd_write(pcb,
|
||||||
"text : geeft tekst mee die op LCD komt (uw_text)\r\n"
|
"help : shows a list of commands\r\n"
|
||||||
"color : kleur achtergrond van scherm (255 255 255)\r\n"
|
"text \"<text>\" : puts text on the lcd\r\n"
|
||||||
"textColor : kleur van tekst (255 255 255)\r\n"
|
"color <r> <g> <b> : set the background color of the lcd\r\n"
|
||||||
"listImages: laat een lijst zien van de mogelijke afbeeldingen\r\n"
|
"textColor <r> <g> <b> : set the color of the text\r\n"
|
||||||
"setImage : veranderd te afbeelding (naam_afbeelding)\r\n"
|
"listImages : shows a list with images in the filesystem\r\n"
|
||||||
"exit : sluit de verbinding\r\n");
|
"setImage <image_name> : put an image on the screen\r\n"
|
||||||
|
"exit : closes the connection\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static err_t tcp_cmd_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err) {
|
static err_t tcp_cmd_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err) {
|
||||||
@@ -65,7 +66,6 @@ static err_t tcp_cmd_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t
|
|||||||
tcp_recved(pcb, p->tot_len);
|
tcp_recved(pcb, p->tot_len);
|
||||||
pc = (char*)p->payload;
|
pc = (char*)p->payload;
|
||||||
len = p->tot_len;
|
len = p->tot_len;
|
||||||
|
|
||||||
|
|
||||||
if (!strncmp(pc, "help", 4)) {
|
if (!strncmp(pc, "help", 4)) {
|
||||||
check = 1;
|
check = 1;
|
||||||
@@ -78,7 +78,6 @@ static err_t tcp_cmd_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t
|
|||||||
lcd_clear_text();
|
lcd_clear_text();
|
||||||
lcd_display_text(text, 10, 10, result_txt, result_bg, LCD_FONT24);
|
lcd_display_text(text, 10, 10, result_txt, result_bg, LCD_FONT24);
|
||||||
|
|
||||||
|
|
||||||
check = 1;
|
check = 1;
|
||||||
} else if (!strncmp(pc, "color", 5)) {
|
} else if (!strncmp(pc, "color", 5)) {
|
||||||
for (size_t i = 0; i < 3; i++) {
|
for (size_t i = 0; i < 3; i++) {
|
||||||
@@ -162,7 +161,7 @@ static err_t tcp_cmd_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!check && (strncmp(pc, "\r\n", 2) != 0)) {
|
if (!check && (strncmp(pc, "\r\n", 2) != 0)) {
|
||||||
tcp_cmd_write(pcb, "Onbestaand commando: help voor lijst van commando's\r\n");
|
tcp_cmd_write(pcb, "Nonexistent command: help for list of commands\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
|
|||||||
Reference in New Issue
Block a user