ark::canbus::SdoDownload::Method

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


Methods

  • Method()

  • Method(uint16_t index, uint8_t subindex, const core::ByteBuffer & data, size_t segment_size)
    Sets up for transfer.

  • core::ByteBuffer initiate_transfer()
    Begins the segmented transfer. Returns the data payload to send to the SSDO to initiate the transfer.

  • std::vector< core::ByteBuffer > continue_transfer(const core::ByteBuffer & packet)
    Receives the data from a CAN packet, and sends a request for additional data (if necessary, or an empty optional if the buffer is complete). The returned buffer vector is a set of CANopen payloads that should be sent to the SSDO that we are transferring data to.

    Send an empty packet to represent a timeout.

  • core::ByteBuffer abort_frame(uint32_t code)
    Synthesizes an abort frame.

  • uint32_t status()
    Returns the SDO result code, when complete.

  • uint16_t index()
    Returns the SDO index.

  • uint8_t subindex()
    Returns the SDO sub-index.

  • bool complete()
    Returns whether the transfer is complete.

  • void status(uint32_t status)
    Sets the status code, and marks the SDO as completed.

  • void segment_size(size_t size)
    Sets the segment size.

  • size_t segment_size()
    Returns the segment size.

  • const std::vector< uint8_t > next_segment()
    Returns a vector of the next segment.

  • bool final_segment()
    Returns true if the next segment will be the final segment.

  • auto remaining()
    Returns the number of bytes remaining.

  • void ack_segment(bool set_status)
    Acknowledge a segment, and move to the next segment to transfer.