Skip to content

Releases: ethercrab-rs/ethercrab

v0.3.1

19 Oct 22:01
Compare
Choose a tag to compare

Housekeeping release. Please see release notes for v0.3.0.

v0.3.0

19 Oct 22:00
Compare
Choose a tag to compare

Added

  • #91 Add support for "cross" topologies, e.g. with EK1122.

  • #102 PDU retry behaviour is now configurable between no retries, a limited count, or retrying
    forever with the RetryBehaviour struct and associated ClientConfig.retry_behaviour option.

  • #103 Added optional serde feature to enable ser/de of some EtherCrab items.

  • #104 Implement std::error::Error for ethercrab::error::Error when the std feature is
    enabled.

  • #107 Add watchdog fields to Register enum: WatchdogDivider, PdiWatchdog
    SyncManagerWatchdog, SyncManagerWatchdogStatus SyncManagerWatchdogCounter,
    PdiWatchdogCounter.

  • #113 SlaveState now implements PduRead so can now be read directly, e.g.

    let (status, _wkc) =
        Command::fprd(slave.configured_address(), RegisterAddress::AlStatus.into())
            .receive::<SlaveState>(&client)
            .await?;

Changed

  • #92 If no slave devices are detected, Client::init will no longer exit with an error.
  • (breaking) #101 SendableFrame::send_blocking and SendableFrame::send must now return the
    number of bytes sent over the network.
  • (breaking) #101 SendableFrame::write_ethernet_packet is no longer pub. Instead, use
    SendableFrame::send_blocking or SendableFrame::send.
  • #103 Removed inner smoltcp::error::Error from PduError::Ethernet and PduError::CreateFrame
    as these don't add much meaning to the variant.
  • (breaking) #109 Make all methods on PduLoop private.
  • (breaking) #113 Command::{code,address,parse} are no longer pub.
  • (breaking) #119 Changed SlaveState::Unknown to SlaveState::Other(u8) to better represent
    unknown or different states of multiple slaves (e.g. when sending a BRD).

Removed

  • (breaking) #99 All PDU methods on Client (Client::bwr, Client::fprd) have been
    removed. Instead, use the same methods on Command like Command::bwr, Command::fprd etc.

v0.2.1

31 Jul 20:48
Compare
Choose a tag to compare

Fixed

  • #84 GroupSlave::iter will now panic instead of completing early if a slave device is already
    borrowed.

Added

  • #83 Add SlaveRef::identity method to get the vendor ID, hardware revision, etc of a slave
    device.

Changed

  • #84 The SlaveGroupState trait is now not-doc-hidden so the GroupSlave::slave method is more
    easily accessible.

v0.2.0

31 Jul 12:41
Compare
Choose a tag to compare

Added

  • #47 Add the ability to read/write registers/SDOs from grouped slave devices, with the methods
    SlaveRef::register_read, SlaveRef::register_write, SlaveRef::sdo_read and
    SlaveRef::sdo_write.
  • #30 Added Copy, Clone, PartialEq and Eq implementations to Error and PduError.
  • #1 Added SlaveGroup::len and SlaveGroup::is_empty methods.
  • #29 Implement Display for Error, PduError, MailboxError, EepromError,
    VisibleStringError and PduValidationError
  • (breaking) #31 Added a ClientConfig argument to Client::new to allow configuration of
    various EtherCrab behaviours.
  • #55 Added Client::init_single_group to reduce boilerplate when only using a single group of
    devices.
  • #55 Removed MSRV commitment (was 1.68)
  • #59 Added SendableFrame::send_blocking method.

Removed

  • (breaking) #75 Client::request_slave_state is removed. Groups should be transitioned into
    the various states individually using into_op or into_safe_op.
  • (breaking) #75 SlaveGroup::new is removed. Slave groups can be created with
    SlaveGroup::default() instead
  • (breaking) #45 The SlaveGroupContainer trait is no longer needed and has been removed.

Changed

  • (breaking) #75 Client::init no longer takes a groups argument and now requires
    G: Default.

  • (breaking) #75 SlaveGroups no longer configure using a closure - instead use
    SlaveGroup::iter or SlaveGroup::slave to configure slave devices inline.

  • (breaking) #75 SlaveGroups now have a type state. Use into_safe_op and into_op to
    transition from PRE-OP as provided by Client::init into run mode.

  • #47 Slave sdo_read and sdo_write methods no longer require the use of SubIndex. For single
    accesses, a raw u8 can be passed instead for cleaner configuration code.

  • (breaking) #47 SlaveGroup::slave and SlaveGroup::iter (was slaves) now requires the
    passing of a Client reference when called.

  • (breaking) #47 SlaveGroup::slaves is renamed to SlaveGroup::iter

  • (breaking) #47 Grouped slaves that were previously represented as GroupSlaves are now
    represented as SlaveRef<'_, SlavePdi<'_>> instead. GroupSlave is removed.

  • (breaking) #47 The io(), inputs() and outputs() methods on grouped slaves have been
    renamed to io_raw(), inputs_raw() and outputs_raw() respecitively.

  • (breaking) #47 The Slave.name and Slave.identity fields have been replaced with methods
    of the same name.

  • (breaking) #45 The grouping closure passed to Client::init now requires a
    &dyn SlaveGroupHandle to be returned. This is a sealed trait only implemented for SlaveGroups
    and allows some internal refactors by erasing the const generics from SlaveGroup.

  • (breaking) #32 To mitigate some internal issues, PduStorage now requires N (the number
    of storage elements) to be a power of two.

  • (breaking) #33 send_frames_blocking is removed. It is replaced with
    PduTx::next_sendable_frame which can be used to send any available frames in a loop until it
    returns None.

  • (breaking) #30 Removed PduError::Encode variant.

  • (breaking) #25 Renamed pdu_rx to receive_frame to mirror send_frames_blocking.

  • (breaking) #20 Changed the way the client, tx and rx instances are initialised to only allow
    one TX and RX to exist.

    Before

    static PDU_STORAGE: PduStorage<MAX_FRAMES, MAX_PDU_DATA> = PduStorage::new();
    static PDU_LOOP: PduLoop = PduLoop::new(PDU_STORAGE.as_ref());
    
    async fn main_app(ex: &LocalExecutor<'static>) -> Result<(), Error> {
        let client = Arc::new(Client::new(&PDU_LOOP, Timeouts::default()));
    
        ex.spawn(tx_rx_task(INTERFACE, &client).unwrap()).detach();
    }

    After

    static PDU_STORAGE: PduStorage<MAX_FRAMES, MAX_PDU_DATA> = PduStorage::new();
    
    async fn main_app(ex: &LocalExecutor<'static>) -> Result<(), Error> {
        let (tx, rx, pdu_loop) = PDU_STORAGE.try_split().expect("can only split once");
    
        let client = Arc::new(Client::new(pdu_loop, Timeouts::default()));
    
        ex.spawn(tx_rx_task(INTERFACE, tx, rx).unwrap()).detach();
    }
  • (breaking) #16 Remove TIMER/TIMEOUT generic parameter. std environments will now use
    the timer provided by smol (async-io). no_std environments will use embassy-time.

  • (breaking) #9 Rename the fields of some variants in ethercrab::error::Error to make them
    less confusing.

  • (breaking) #2 Rename slave_group::Configurator to SlaveGroupRef.

  • (breaking) #1 SlaveGroup::slaves now returns an iterator over each slave with IO in the
    group, instead of a plain slave.

Fixed

  • #28 Fix abort code parsing for expedited SDO responses.
  • #26 🎉 EtherCrab now works on stable Rust. The MSRV is 1.68.
  • #23 Strip trailing null bytes (\0) in strings read from SII
  • #14 Fixed various overflow/arithmetic bugs in distributed clock time calculations and PDI
    configuration
  • #6 Fixed topology detection not stopping at first upstream fork when there is a slave device
    before the fork.
  • #6 Internal bugfixes to topology discovery code.
  • #2 Fixed multiple group PDI mapping calculation during initialisation.
  • [#57] Fixed a buffer size calculation crash when reading SDOs.

v0.1.0

03 Jan 19:38
Compare
Choose a tag to compare
v0.1.0 Pre-release
Pre-release

Added

  • Initial release