Motion Master 6.0.0-alpha.111
Next-generation motion control software
Loading...
Searching...
No Matches
spoe_frame.h File Reference
#include <cstddef>
#include <cstdint>
#include <expected>
#include <optional>
#include <span>
#include <string>
#include <vector>
Include dependency graph for spoe_frame.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mm::comm::spoe::FrameHeader
 
struct  mm::comm::spoe::Frame
 

Namespaces

namespace  mm
 
namespace  mm::comm
 
namespace  mm::comm::spoe
 

Enumerations

enum class  mm::comm::spoe::MessageType : uint8_t {
  mm::comm::spoe::kSdoRead = 0x01 , mm::comm::spoe::kSdoWrite = 0x02 , mm::comm::spoe::kPdoFrame = 0x03 , mm::comm::spoe::kPdoControl = 0x04 ,
  mm::comm::spoe::kSdoBatchRead = 0x06 , mm::comm::spoe::kFirmwareUpdate = 0x0B , mm::comm::spoe::kFileRead = 0x0C , mm::comm::spoe::kFileWrite = 0x0D ,
  mm::comm::spoe::kStateControl = 0x0E , mm::comm::spoe::kStateRead = 0x0F , mm::comm::spoe::kParamList = 0x10 , mm::comm::spoe::kParamDesc = 0x11 ,
  mm::comm::spoe::kParamSubDesc = 0x12 , mm::comm::spoe::kParamFullDesc = 0x13 , mm::comm::spoe::kServerInfo = 0x20 , mm::comm::spoe::kDeviceLocate = 0x21 ,
  mm::comm::spoe::kWatchdogTimeout = 0x22
}
 The message types the firmware handles. A reply carries the type of its request. More...
 

Functions

std::expected< std::vector< uint8_t >, std::string > mm::comm::spoe::encodeFrame (const Frame &frame)
 Encodes frame. Fails when the data part is larger than kMaxDataSize.
 
std::optional< FrameHeader > mm::comm::spoe::decodeHeader (std::span< const uint8_t > bytes)
 

Variables

constexpr std::size_t mm::comm::spoe::kHeaderSize = 7
 Message type u8, sequence id u16, status u16, data length u16.
 
constexpr std::size_t mm::comm::spoe::kMaxDataSize = 512
 MAX_FRAME_SIZE in the firmware: the size of its buffer for the data part.