TCP Server #77

Merged
muellerr merged 52 commits from tcp-server into main 2023-09-21 18:11:38 +02:00
2 changed files with 7 additions and 4 deletions
Showing only changes of commit e4d8c0c9a7 - Show all commits

View File

@ -165,13 +165,16 @@ mod tests {
thread,
};
use crate::{tmtc::{ReceivesTcCore, TmPacketSource}, hal::std::tcp_server::ServerConfig, parsers::tests::{SIMPLE_PACKET, INVERTED_PACKET}};
use alloc::{collections::VecDeque, sync::Arc, vec::Vec, boxed::Box};
use crate::{
hal::std::tcp_server::ServerConfig,
parsers::tests::{INVERTED_PACKET, SIMPLE_PACKET},
tmtc::{ReceivesTcCore, TmPacketSource},
};
use alloc::{boxed::Box, collections::VecDeque, sync::Arc, vec::Vec};
use cobs::encode;
use super::TcpTmtcInCobsServer;
#[derive(Default, Clone)]
struct SyncTcCacher {
tc_queue: Arc<Mutex<VecDeque<Vec<u8>>>>,

View File

@ -156,7 +156,7 @@ pub(crate) mod tests {
}
}
pub (crate) fn encode_simple_packet(encoded_buf: &mut [u8], current_idx: &mut usize) {
pub(crate) fn encode_simple_packet(encoded_buf: &mut [u8], current_idx: &mut usize) {
encoded_buf[*current_idx] = 0;
*current_idx += 1;
*current_idx += encode(&SIMPLE_PACKET, &mut encoded_buf[*current_idx..]);