Skip to content

Commit

Permalink
Merge pull request #69 from jrvanwhy/rm-ipc
Browse files Browse the repository at this point in the history
Remove the IPC drivers and test infrastructure.
  • Loading branch information
torfmaster authored Feb 8, 2019
2 parents 1eba2c1 + 30340ed commit 25fae0e
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 401 deletions.
55 changes: 0 additions & 55 deletions examples/ble_ess.rs

This file was deleted.

39 changes: 0 additions & 39 deletions examples/hardware_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,18 @@
extern crate alloc;

use alloc::string::String;
use alloc::vec::Vec;
use tock::console::Console;
use tock::ipc;
use tock::ipc::IpcClientCallback;
use tock::ipc::ServerHandle;
use tock::timer;
use tock::timer::Duration;

fn main() {
let mut server_buf = ipc::reserve_shared_buffer();
let mut my_buf = ipc::reserve_shared_buffer();

let mut console = Console::new();

// This sleep is neccessary to assure, that during installation of
// the client/server pair the tests are only run once.
timer::sleep(Duration::from_ms(3000));

console.write(String::from("[test-results]\n"));
let mut string = String::from("heap_test = \"Heap ");
string.push_str("works.\"\n");
console.write(string);

let mut server = ServerHandle::discover_service(String::from("hardware_test_server")).unwrap();
let mut payload: [u8; 32] = [0; 32];
let m = String::from("client");
let b = m.as_bytes();
let l = b.len();
payload[..l].clone_from_slice(b);

let mut handle = server.share(&mut server_buf).unwrap();
handle.write_bytes(&payload);

let mut callback = IpcClientCallback::new(|_: usize, _: usize| {
handle.read_bytes(&mut my_buf.buffer);
let filtered = my_buf
.buffer
.iter()
.cloned()
.filter(|&x| x != 0)
.collect::<Vec<_>>();
let s = String::from_utf8_lossy(&filtered);
console.write(String::from(s).clone());
console.write(String::from("test=\"done\"\n"));
});

let handle = server.subscribe_callback(&mut callback);
server.notify().unwrap();

for _ in 0.. {
timer::sleep(Duration::from_ms(500))
}
handle.unwrap();
}
38 changes: 0 additions & 38 deletions examples/hardware_test_server.rs

This file was deleted.

41 changes: 0 additions & 41 deletions examples/ipcclient.rs

This file was deleted.

35 changes: 0 additions & 35 deletions examples/ipcserver.rs

This file was deleted.

10 changes: 0 additions & 10 deletions run_ipc_example.sh

This file was deleted.

49 changes: 0 additions & 49 deletions src/ipc/ble_ess.rs

This file was deleted.

82 changes: 0 additions & 82 deletions src/ipc/client.rs

This file was deleted.

7 changes: 0 additions & 7 deletions src/ipc/mod.rs

This file was deleted.

Loading

0 comments on commit 25fae0e

Please sign in to comment.