ark::canbus::SdoQueue

Defined in header “ark/canbus/canopen/sdo.hh”.


A queue of SDOs that needs to go out. If any SDO fails, all remaining SDOs in this queue are canceled.

Typedefs

  • using CompletionCallback = std::function< void(SdoState)>

Methods

  • void set_completion_callback(CompletionCallback callback)
    Set a callback to be invoked if the entire collection is completed, either successfully or in failure).

  • void mark_completed(SdoState state)
    Set to mark the entire queue as completed with the given state. Invokes the completion callback.

  • bool empty()
    Return true if the collection is empty.

  • void cancel()
    Cancel all remaining SDOs.

  • QueuedSdo pop_front()
    Pop the next SDO off the queue.

  • void push_upload(SdoIndex index, std::function< void(SdoResult)> callback, std::chrono::nanoseconds timeout)
    Adds an ‘upload’ SDO onto the queue.

  • void push_download(SdoIndex index, ark::core::ByteBuffer data, std::function< void(SdoResult)> callback, std::chrono::nanoseconds timeout)
    Adds an ‘download’ SDO onto the queue.