Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
wcampbell0x2a committed Aug 17, 2020
2 parents 8f8959f + 4afcffc commit bd2b8f5
Show file tree
Hide file tree
Showing 16 changed files with 768 additions and 455 deletions.
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: rust
sudo: required
dist: trusty
addons:
apt:
packages:
- libssl-dev
cache: cargo
rust:
- stable
matrix:
allow_failures:
- rust: nightly

before_cache: |
if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
cargo install cargo-tarpaulin
fi
script:
- cargo clean
- cargo build
- cargo test

after_success: |
if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID
fi
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0] - 2020-08-16
- Add License file (MIT) and prepare Cargo.toml file for release
- Cleanup of many functions relating to parsing data
- Add faux testing for testing the code without a saleae device

## [0.0.1] - 2020-01-18
- Support for many common saleae functions, withholding from implementing the more advance data collection commands
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
[package]
name = "saleae"
version = "0.0.1"
version = "0.1.0"
authors = ["wcampbell"]
edition = "2018"
description = "a rust library for interacting with saleae devices"
keywords = ["logic", "saleae", "api", "re", "reverse"]
maintenance = { status = "actively-developed" }
repository = "https://github.com/wcampbell0x2a/rust-saleae"
license = "GPL-3.0"
license = "MIT"
readme = "README.md"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bufstream = "0.1.1"
anyhow = "1.0.26"
enum_derive = "0.1.7"
custom_derive = "0.1.7"
faux = "0.0.4"

[dev-dependencies]
#faux = "0.0.3"
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# Saleae
[![Latest Version](https://img.shields.io/crates/v/saleae.svg)](https://crates.io/crates/saleae)
[![Rust Documentation](https://docs.rs/saleae/badge.svg)](https://docs.rs/saleae)
[![Build Status](https://travis-ci.org/wcampbell0x2a/rust-saleae.svg?branch=dev)](https://travis-ci.org/wcampbell0x2a/rust-saleae)
[![Coverage Status](https://coveralls.io/repos/github/wcampbell0x2a/rust-saleae/badge.svg?branch=dev)](https://coveralls.io/github/wcampbell0x2a/rust-saleae?branch=dev)

This library provides a Rust API for the Saleae devices when running the Logic
program.

The API is based on the documentation provided here: [SaleaeSocketAPI](https://github.com/saleae/SaleaeSocketApi)

## Note
This library isn't complete, as there are more functions that need implementations.

## Changelog

See [CHANGELOG.md](https://github.com/wcampbell0x2a/saleae-rs/blob/master/CHANGELOG.md)
11 changes: 4 additions & 7 deletions examples/example.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
use saleae;

use saleae::Client;
use saleae::PerformanceOption;
use std::net::TcpStream;
use saleae::{Client, Connection};
use std::thread;
use std::time::Duration;

fn main() {
let mut conn = Client::new(TcpStream::connect("127.0.0.1:10429").unwrap()).unwrap();
let mut conn = Client::new(Connection::new("127.0.0.1:10429")).unwrap();
let response0 = conn.get_performance();
println!("get_performance: {}", response0.unwrap());

Expand All @@ -30,7 +27,7 @@ fn main() {
let response6 = conn.start_capture_block_until_finished();
println!("longer waiting is complete: {:?}", response6.unwrap());

let response = conn.set_capture_seconds(10);
let response = conn.set_capture_seconds(10.1);
println!("set_capture_seconds: {:?}", response.unwrap());

let response4 = conn.start_capture();
Expand Down Expand Up @@ -65,7 +62,7 @@ fn main() {

let sample_rate = &response13[1];

let response14 = conn.set_sample_rate(&sample_rate);
let response14 = conn.set_sample_rate(sample_rate);
println!("set_sample_rate: {:?}", response14.unwrap());

let response15 = conn.get_sample_rate();
Expand Down
Loading

0 comments on commit bd2b8f5

Please sign in to comment.