Skip to content

Commit 47efe94

Browse files
committed
little rejigging for packaging
1 parent ff76351 commit 47efe94

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

Cargo.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,26 @@
33
name = "hackrf"
44
version = "0.0.1"
55
authors = ["Adam Greig <[email protected]>"]
6+
description = "Rust bindings for libhackrf"
7+
repository = "https://github.com/adamgreig/hackrf-rs"
8+
homepage = "https://github.com/adamgreig/hackrf-rs"
9+
readme = "README.md"
10+
keywords = ["SDR", "ffi", "hackrf"]
11+
license = "MIT"
12+
13+
[lib]
14+
name = "hackrf"
15+
path = "src/lib.rs"
16+
test = false
17+
doctest = false
18+
bench = false
19+
doc = true
20+
plugin = false
21+
22+
[[bin]]
23+
name = "hackrf_demo"
24+
path = "src/demo.rs"
25+
test = false
26+
doctest = false
27+
bench = false
28+
doc = false

src/main.rs renamed to src/demo.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ fn main() {
5555
println!("bw2={}", bw2);
5656

5757
println!("Setting up RX stream");
58-
let mut rx_cb = |buffer: &[u8]| -> bool {
59-
println!("rx");
58+
let mut rx_cb = |_: &[u8]| -> bool {
59+
println!("rx cb");
6060
true
6161
};
6262
hackrf::start_rx(&mut device, &mut rx_cb).unwrap();
@@ -70,8 +70,8 @@ fn main() {
7070

7171

7272
println!("Setting up TX stream");
73-
let mut tx_cb = |buffer: &mut[u8]| -> bool {
74-
println!("tx");
73+
let mut tx_cb = |_: &mut[u8]| -> bool {
74+
println!("tx cb");
7575
true
7676
};
7777
hackrf::start_tx(&mut device, &mut tx_cb).unwrap();

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ pub fn close(device: HackRFDevice) -> Result<(), HackRFError> {
7878
/// inside Rust after resolving memory stuff, so that users don't need to
7979
/// write unsafe code.
8080
extern "C" fn rx_cb(transfer: *mut ffi::hackrf_transfer) -> libc::c_int {
81-
println!("rx_cb");
8281
let data = unsafe { &*transfer };
8382
let valid_length = data.valid_length as uint;
8483
let buffer: &[u8] = unsafe {
@@ -96,7 +95,6 @@ extern "C" fn rx_cb(transfer: *mut ffi::hackrf_transfer) -> libc::c_int {
9695
/// inside Rust after resolving memory stuff, so that users don't need to
9796
/// write unsafe code.
9897
extern "C" fn tx_cb(transfer: *mut ffi::hackrf_transfer) -> libc::c_int {
99-
println!("tx_cb");
10098
let data = unsafe { &*transfer };
10199
let buffer_length = data.buffer_length as uint;
102100
let buffer: &mut[u8] = unsafe {

0 commit comments

Comments
 (0)