Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 82 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,83 @@
[alias]
test_ip = "test --test ipv4_tests -- --ignored --test-threads=1"
test_ip = "test --test ipv4_tests -- --ignored --test-threads=1"

[target.'cfg(all())']
rustflags = [
# BEGIN - Embark standard lints v6 for Rust 1.55+
# do not change or add/remove here, but one can add exceptions after this section
# for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
"-Dunsafe_code",
"-Wclippy::all",
"-Wclippy::await_holding_lock",
"-Wclippy::char_lit_as_u8",
"-Wclippy::checked_conversions",
"-Wclippy::dbg_macro",
"-Wclippy::debug_assert_with_mut_call",
"-Wclippy::doc_markdown",
"-Wclippy::empty_enum",
"-Wclippy::enum_glob_use",
"-Wclippy::exit",
"-Wclippy::expl_impl_clone_on_copy",
"-Wclippy::explicit_deref_methods",
"-Wclippy::explicit_into_iter_loop",
"-Wclippy::fallible_impl_from",
"-Wclippy::filter_map_next",
"-Wclippy::flat_map_option",
"-Wclippy::float_cmp_const",
"-Wclippy::fn_params_excessive_bools",
"-Wclippy::from_iter_instead_of_collect",
"-Wclippy::if_let_mutex",
"-Wclippy::implicit_clone",
"-Wclippy::imprecise_flops",
# to be enabled at a later date
# "-Wclippy::indexing_slicing",
"-Wclippy::inefficient_to_string",
"-Wclippy::invalid_upcast_comparisons",
"-Wclippy::large_digit_groups",
"-Wclippy::large_stack_arrays",
"-Wclippy::large_types_passed_by_value",
"-Wclippy::let_unit_value",
"-Wclippy::linkedlist",
"-Wclippy::lossy_float_literal",
"-Wclippy::macro_use_imports",
"-Wclippy::manual_ok_or",
"-Wclippy::map_err_ignore",
"-Wclippy::map_flatten",
"-Wclippy::map_unwrap_or",
"-Wclippy::match_same_arms",
"-Wclippy::match_wild_err_arm",
"-Wclippy::match_wildcard_for_single_variants",
"-Wclippy::mem_forget",
"-Wclippy::missing_enforced_import_renames",
"-Wclippy::mut_mut",
"-Wclippy::mutex_integer",
"-Wclippy::needless_borrow",
"-Wclippy::needless_continue",
"-Wclippy::needless_for_each",
"-Wclippy::option_option",
"-Wclippy::path_buf_push_overwrite",
"-Wclippy::ptr_as_ptr",
"-Wclippy::rc_mutex",
"-Wclippy::ref_option_ref",
"-Wclippy::rest_pat_in_fully_bound_structs",
"-Wclippy::same_functions_in_if_condition",
"-Wclippy::semicolon_if_nothing_returned",
"-Wclippy::single_match_else",
"-Wclippy::string_add_assign",
"-Wclippy::string_add",
"-Wclippy::string_lit_as_bytes",
"-Wclippy::string_to_string",
"-Wclippy::todo",
"-Wclippy::trait_duplication_in_bounds",
"-Wclippy::unimplemented",
"-Wclippy::unnested_or_patterns",
"-Wclippy::unused_self",
"-Wclippy::useless_transmute",
"-Wclippy::verbose_file_reads",
"-Wclippy::zero_sized_map_values",
"-Wfuture_incompatible",
"-Wnonstandard_style",
"-Wrust_2018_idioms",
"-Wunexpected_cfgs",
# END - Embark standard lints v6 for Rust 1.55+
]
9 changes: 9 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
- name: Build
run: cargo build --verbose

- name: Clippy
run: cargo clippy

- name: Run tests
run: cargo test --verbose

Expand All @@ -38,6 +41,9 @@ jobs:
- name: Build
run: cargo build --verbose

- name: Clippy
run: cargo clippy

- name: Run tests
run: cargo test --verbose

Expand All @@ -49,6 +55,9 @@ jobs:
- name: Build
run: cargo build --verbose

- name: Clippy
run: cargo clippy

- name: Run tests
run: cargo test --verbose

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "sacn"
description = "A Rust implementation of the ANSI E1.31 Streaming ACN protocol, tested against protocol version ANSI E1.31-2018."
version = "0.11.1"
edition = "2024"
rust-version = "1.88"
readme = "README.md"
keywords = ["acn", "sacn", "dmx", "e131", "ansi"]
authors = ["Lukas Schmierer <lukas.schmierer@lschmierer.de>", "Paul Lancaster <paul@lancasterzone.com>"]
Expand Down
2 changes: 0 additions & 2 deletions examples/demo_rcv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
pub mod error;
use error::errors::{DemoError, Result};

extern crate sacn;

use sacn::packet::ACN_SDT_MULTICAST_PORT;
use sacn::receive::{DMXData, DiscoveredSacnSource, SacnReceiver};

Expand Down
2 changes: 0 additions & 2 deletions examples/demo_src/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
pub mod error;
use error::errors::Result;

extern crate sacn;

use sacn::packet::{ACN_SDT_MULTICAST_PORT, UNIVERSE_CHANNEL_CAPACITY};
use sacn::source::SacnSource;

Expand Down
3 changes: 0 additions & 3 deletions examples/simple-receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
//
// Simply listens on the given universe and shows the current data.

extern crate crossterm;
extern crate sacn;

use crossterm::style::Print;
use crossterm::{cursor, execute, queue, terminal};
use std::io::{self, Stdout, Write};
Expand Down
2 changes: 0 additions & 2 deletions examples/sine-wave-sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
//
// Uses the sACN library to send a sine wave on all channels on universe 1 to localhost.

extern crate sacn;

use sacn::packet::{ACN_SDT_MULTICAST_PORT, UNIVERSE_CHANNEL_CAPACITY};
use sacn::source::SacnSource;

Expand Down
18 changes: 9 additions & 9 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,30 +84,30 @@ pub mod errors {
#[error("Limit for the number of supported sources has been reached: {0}")]
SourcesExceededError(usize),

/// A source was discovered by a receiver with the announce_discovery_flag set to true.
/// A source was discovered by a receiver with the `announce_discovery_flag` set to true.
///
/// # Arguments
/// The name of the source discovered.
#[error("Source discovered with announce_discovery_flag set to true: {0}")]
SourceDiscovered(String),

/// Attempted to exceed the capacity of a single universe (packet::UNIVERSE_CHANNEL_CAPACITY).
/// Attempted to exceed the capacity of a single universe (`packet::UNIVERSE_CHANNEL_CAPACITY`).
///
/// # Arguments
/// Length of data provided.
#[error("Attempted to exceed the capacity of a single universe, data len: {0}")]
ExceedUniverseCapacity(usize),

/// Attempted to use illegal universe, outwith allowed range of [E131_MIN_MULTICAST_UNIVERSE, E131_MAX_MULTICAST_UNIVERSE]
/// + E131_DISCOVERY_UNIVERSE inclusive
/// Attempted to use illegal universe, outwith allowed range of [`E131_MIN_MULTICAST_UNIVERSE`, `E131_MAX_MULTICAST_UNIVERSE`]
/// + `E131_DISCOVERY_UNIVERSE` inclusive
///
/// # Arguments
/// u16: The provided universe.
#[error("Attempted to use an illegal universe: {0}")]
IllegalUniverse(u16),

/// Attempted to use illegal universe as the sync universe, outwith allowed range of [E131_MIN_MULTICAST_UNIVERSE, E131_MAX_MULTICAST_UNIVERSE]
/// + E131_DISCOVERY_UNIVERSE inclusive
/// Attempted to use illegal universe as the sync universe, outwith allowed range of [`E131_MIN_MULTICAST_UNIVERSE`, `E131_MAX_MULTICAST_UNIVERSE`]
/// + `E131_DISCOVERY_UNIVERSE` inclusive
///
/// # Arguments
/// u16: The provided synchronization universe.
Expand Down Expand Up @@ -160,7 +160,7 @@ pub mod errors {
OutOfSequence(u8, u8, isize),

/// A source terminated a universe and this was detected when trying to receive data.
/// This is only returned if the announce_stream_termination flag is set to true (default false).
/// This is only returned if the `announce_stream_termination` flag is set to true (default false).
///
/// # Arguments
/// Uuid: The CID of the source which sent the termination packet.
Expand All @@ -169,7 +169,7 @@ pub mod errors {
#[error("Source terminated universe, source cid: {0}, universe: {1}")]
UniverseTerminated(Uuid, u16),

/// A source universe timed out as no data was received on that universe within E131_NETWORK_DATA_LOSS_TIMEOUT as per ANSI E1.31-2018 Section 6.7.1.
/// A source universe timed out as no data was received on that universe within `E131_NETWORK_DATA_LOSS_TIMEOUT` as per ANSI E1.31-2018 Section 6.7.1.
///
/// # Arguments
/// uuid: The CID of the source which timed out.
Expand Down Expand Up @@ -208,7 +208,7 @@ pub mod errors {
/// such as by creating a new source.
///
/// # Arguments
/// String: A message providing further details (if any) as to why the SourceCorrupt error was returned.
/// String: A message providing further details (if any) as to why the `SourceCorrupt` error was returned.
#[error(
"The sACN source has corrupted due to an internal panic! and should no longer be used, {0}"
)]
Expand Down
13 changes: 0 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,6 @@ pub mod sacn_parse_pack_error;
/// The errors used within the sACN crate, parse/pack errors are seperated out into sacn_parse_pack_error.
pub mod error;

extern crate libc;
/// The library is built on top of socket2 to provide the underlying UDP networking interface.
extern crate socket2;

/// The core crate is used for string processing during packet parsing/packing as well as to provide access to the Hash trait.
extern crate core;

/// The byteorder crate is used for marshalling data on/off the network in Network Byte Order.
extern crate byteorder;

/// The uuid crate is used for working with/generating UUIDs which sACN uses as part of the cid field in the protocol.
extern crate uuid;

/// The packet module handles the sACN packets including parsing/packing and sACN related constants.
pub mod packet;

Expand Down
Loading