+ sprintf((char *)tx_buf, "{ \"0\":\"%d\", \"1\":\"%d\", \"2\":\"%d\"}",
+ GET_LED_STATUS(status.led_status, 0),
+ GET_LED_STATUS(status.led_status, 1),
+ GET_LED_STATUS(status.led_status, 2));
+
+ http_sendOk(client, HTTP_CONTENT_JSON);
+ netconn_write(client, tx_buf, strlen((char *)tx_buf), NETCONN_COPY);
+ return 0;
+}
+
+
+#define CGI_MSG_CMD_KEY "msg"
+
+static int cgi_displayMsg(struct netconn *client, const char *name, char *recv_buf, size_t recv_len)
+{
+ (void)recv_buf;
+ (void)recv_len;
+ (void)name;
+
+ char *query_str = strstr(name, "?") + 1;
+ size_t query_str_len = strlen(query_str);
+
+ int len = http_tokenizeGetRequest(query_str, query_str_len);
+
+ LOG_INFO("Found %d key/value pair\n", len);
+
+ if (http_getValue(query_str, query_str_len, CGI_MSG_CMD_KEY, key_value, sizeof(key_value)) > 0)
+ {
+
+ LOG_INFO("Found key %s = %s\n", CGI_MSG_CMD_KEY, key_value);
+
+ gfx_bitmapClear(lcd_bitmap);
+ text_style(lcd_bitmap, STYLEF_BOLD | STYLEF_UNDERLINE, STYLEF_BOLD | STYLEF_UNDERLINE);
+ text_xprintf(lcd_bitmap, 0, 0, TEXT_CENTER | TEXT_FILL, "BeRTOS Simple Http Server");
+ text_style(lcd_bitmap, 0, STYLEF_MASK);
+ text_xprintf(lcd_bitmap, 2, 0, TEXT_CENTER | TEXT_FILL, "Your message:");
+ text_xprintf(lcd_bitmap, 10, 0, TEXT_CENTER, "%s", key_value);
+
+ lcd_hx8347_blitBitmap(lcd_bitmap);
+
+ http_sendOk(client, HTTP_CONTENT_JSON);
+ return 0;
+ }
+
+ http_sendInternalErr(client, HTTP_CONTENT_JSON);