mirror of
https://github.com/n5ac/smartsdr-dsp.git
synced 2025-12-06 03:01:59 +01:00
Eliminate control characters from rx_string. All control characters are replaced by 0x7F which is an intermediary representation for a space
This commit is contained in:
parent
5cd5b63b7e
commit
39680f6139
|
|
@ -196,12 +196,17 @@ Circular_Float_Buffer TX4_cb = &tx4_cb;
|
||||||
void my_put_next_rx_char(void *callback_state, char c)
|
void my_put_next_rx_char(void *callback_state, char c)
|
||||||
{
|
{
|
||||||
char new_char[2];
|
char new_char[2];
|
||||||
if ( c == ' ' ) {
|
if ( (uint32) c < 32 || (uint32) c > 126 ) {
|
||||||
|
/* Treat all control chars as spaces */
|
||||||
|
output(ANSI_YELLOW "Non-valid RX_STRING char. ASCII code = %d\n", (uint32) c);
|
||||||
|
new_char[0] = (char) 0x7F;
|
||||||
|
} else if ( c == ' ' ) {
|
||||||
/* Encode spaces differently */
|
/* Encode spaces differently */
|
||||||
new_char[0] = (char) 0x7F;
|
new_char[0] = (char) 0x7F;
|
||||||
} else {
|
} else {
|
||||||
new_char[0] = c;
|
new_char[0] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
new_char[1] = 0;
|
new_char[1] = 0;
|
||||||
|
|
||||||
strncat(_rx_string, new_char, MAX_RX_STRING_LENGTH+4);
|
strncat(_rx_string, new_char, MAX_RX_STRING_LENGTH+4);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue