ark::canbus::SdoUpload::Manager

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


This class manages transferring data from the host to the remote.

It automatically chooses Segmented, or Block transfer based on expected amount of data. The remote determines if it responds with expedited.

Methods

  • Manager(size_t block_threshold, uint8_t block_segments)

  • void setup(uint16_t index, uint8_t subindex, size_t expected_size)
    Sets up for transfer.

    This class manages transferring data from the host to the remote. It automatically chooses Segmented, or Block transfer based on expected amount of data. The remote determines if it responds with expedited.

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 & reply)
    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.

    Returns an empty vector if transfer is complete.

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

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

  • const core::ByteBuffer & buffer()
    Returns the core::ByteBuffer of the upload from the remote.

  • const void * data()
    Returns the data of the upload from the remote.

  • size_t size()
    Returns the size of the data of the upload from the remote.