@@ -27,19 +27,19 @@ LOG_MODULE_REGISTER(LOG_DOMAIN);
27
27
#include <net/net_pkt.h>
28
28
#include <net/websocket_console.h>
29
29
30
- #define NVT_NUL 0
31
- #define NVT_LF 10
32
- #define NVT_CR 13
30
+ #define NVT_NUL 0
31
+ #define NVT_LF 10
32
+ #define NVT_CR 13
33
33
34
- #define WS_CONSOLE_STACK_SIZE CONFIG_WEBSOCKET_CONSOLE_STACK_SIZE
35
- #define WS_CONSOLE_PRIORITY CONFIG_WEBSOCKET_CONSOLE_PRIO
36
- #define WS_CONSOLE_TIMEOUT K_MSEC(CONFIG_WEBSOCKET_CONSOLE_SEND_TIMEOUT)
37
- #define WS_CONSOLE_LINES CONFIG_WEBSOCKET_CONSOLE_LINE_BUF_NUMBERS
38
- #define WS_CONSOLE_LINE_SIZE CONFIG_WEBSOCKET_CONSOLE_LINE_BUF_SIZE
39
- #define WS_CONSOLE_TIMEOUT K_MSEC(CONFIG_WEBSOCKET_CONSOLE_SEND_TIMEOUT)
40
- #define WS_CONSOLE_THRESHOLD CONFIG_WEBSOCKET_CONSOLE_SEND_THRESHOLD
34
+ #define WS_CONSOLE_STACK_SIZE CONFIG_WEBSOCKET_CONSOLE_STACK_SIZE
35
+ #define WS_CONSOLE_PRIORITY CONFIG_WEBSOCKET_CONSOLE_PRIO
36
+ #define WS_CONSOLE_TIMEOUT K_MSEC(CONFIG_WEBSOCKET_CONSOLE_SEND_TIMEOUT)
37
+ #define WS_CONSOLE_LINES CONFIG_WEBSOCKET_CONSOLE_LINE_BUF_NUMBERS
38
+ #define WS_CONSOLE_LINE_SIZE CONFIG_WEBSOCKET_CONSOLE_LINE_BUF_SIZE
39
+ #define WS_CONSOLE_TIMEOUT K_MSEC(CONFIG_WEBSOCKET_CONSOLE_SEND_TIMEOUT)
40
+ #define WS_CONSOLE_THRESHOLD CONFIG_WEBSOCKET_CONSOLE_SEND_THRESHOLD
41
41
42
- #define WS_CONSOLE_MIN_MSG 2
42
+ #define WS_CONSOLE_MIN_MSG 2
43
43
44
44
/* These 2 structures below are used to store the console output
45
45
* before sending it to the client. This is done to keep some
@@ -177,7 +177,7 @@ static int ws_console_out(int c)
177
177
lb -> buf [lb -> len ++ ] = (char )c ;
178
178
179
179
if (c == '\n' || lb -> len == WS_CONSOLE_LINE_SIZE - 1 ) {
180
- lb -> buf [lb -> len - 1 ] = NVT_CR ;
180
+ lb -> buf [lb -> len - 1 ] = NVT_CR ;
181
181
lb -> buf [lb -> len ++ ] = NVT_LF ;
182
182
ws_rb_switch ();
183
183
yield = true;
@@ -236,13 +236,13 @@ static inline void ws_handle_input(struct net_pkt *pkt)
236
236
input -> line [len ] = NVT_NUL ;
237
237
238
238
/* LF/CR will be removed if only the line is not NUL terminated */
239
- if (input -> line [len - 1 ] != NVT_NUL ) {
240
- if (input -> line [len - 1 ] == NVT_LF ) {
241
- input -> line [len - 1 ] = NVT_NUL ;
239
+ if (input -> line [len - 1 ] != NVT_NUL ) {
240
+ if (input -> line [len - 1 ] == NVT_LF ) {
241
+ input -> line [len - 1 ] = NVT_NUL ;
242
242
}
243
243
244
- if (input -> line [len - 2 ] == NVT_CR ) {
245
- input -> line [len - 2 ] = NVT_NUL ;
244
+ if (input -> line [len - 2 ] == NVT_CR ) {
245
+ input -> line [len - 2 ] = NVT_NUL ;
246
246
}
247
247
}
248
248
0 commit comments