Motion Master
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
spoe.h File Reference
#include <atomic>
#include <boost/asio.hpp>
#include <chrono>
#include <nlohmann/json.hpp>
#include <string>
#include "base.h"
#include "core/util.h"
Include dependency graph for spoe.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::Message
 
struct  mm::comm::spoe::ServerInfo
 Contains information about the server's protocol version and monitoring mode. More...
 
class  mm::comm::spoe::DeviceParameterRefresher
 Concrete refresher that uploads parameters from a device. More...
 
class  mm::comm::spoe::Device
 Handles TCP communication with SOMANET devices over SPoE. More...
 

Namespaces

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

Enumerations

enum class  mm::comm::spoe::SpoeMessageType : uint8_t {
  mm::comm::spoe::SDO_READ = 0x01 , mm::comm::spoe::SDO_WRITE = 0x02 , mm::comm::spoe::PDO_RXTX_FRAME , mm::comm::spoe::PDO_CONTROL = 0x04 ,
  mm::comm::spoe::SDO_BATCH_READ = 0x06 , mm::comm::spoe::FIRMWARE_UPDATE = 0x0B , mm::comm::spoe::FILE_READ = 0x0C , mm::comm::spoe::FILE_WRITE = 0x0D ,
  mm::comm::spoe::STATE_CONTROL , mm::comm::spoe::STATE_READ = 0x0F , mm::comm::spoe::PARAM_LIST = 0x13 , mm::comm::spoe::SERVER_INFO = 0x20
}
 Enumeration of SPoE message types used in the protocol. More...
 
enum class  mm::comm::spoe::SpoeMessageRequestStatus : uint8_t { mm::comm::spoe::OK = 0x00 , mm::comm::spoe::FIRST = 0x80 , mm::comm::spoe::MIDDLE = 0xC0 , mm::comm::spoe::LAST = 0x40 }
 Status codes representing the state of an SPoE request message. More...
 
enum class  mm::comm::spoe::SpoeMessageParamListErrorStatus : uint8_t { mm::comm::spoe::SUCCESS_ACK = 0x58 , mm::comm::spoe::ERR = 0x63 , mm::comm::spoe::BUSY_INDICATION = 0x28 }
 Error status codes returned when reading the parameter list via SPoE. More...
 
enum class  mm::comm::spoe::SpoeMessageSdoStatus : uint16_t {
  mm::comm::spoe::NO_ERR = 0x0000 , mm::comm::spoe::GENERIC = 0x0001 , mm::comm::spoe::NOT_FOUND = 0x0002 , mm::comm::spoe::READ_ONLY = 0x0003 ,
  mm::comm::spoe::WRITE_ONLY = 0x0004 , mm::comm::spoe::WRONG_TYPE = 0x0005 , mm::comm::spoe::INVALID_LIST = 0x0006 , mm::comm::spoe::INSUFFICIENT_BUFFER = 0x0007 ,
  mm::comm::spoe::VALUEINFO_UNAVAILABLE = 0x0008 , mm::comm::spoe::UNKNOWN_OR_UNSUPPORTED = 0x0009 , mm::comm::spoe::LOCAL_TRANSFER = 0x000A , mm::comm::spoe::UNSUPPORTED_ACCESS = 0x000B ,
  mm::comm::spoe::SI0_NOT_ZERO = 0x000C , mm::comm::spoe::SUB_NOT_FOUND = 0x000D
}
 Status codes returned during SDO (Service Data Object) read and write operations. More...
 
enum class  mm::comm::spoe::SpoeMessageFileErrorStatus : uint8_t {
  mm::comm::spoe::SUCCESS_ACK = 0x58 , mm::comm::spoe::UNDEFINED = 0x00 , mm::comm::spoe::NOT_FOUND = 0x01 , mm::comm::spoe::ACCESS_DENIED = 0x02 ,
  mm::comm::spoe::STORAGE_FULL = 0x03 , mm::comm::spoe::ILLEGAL_REQ = 0x04 , mm::comm::spoe::PACKET_NUMBER = 0x05 , mm::comm::spoe::ALREADY_EXISTS = 0x06 ,
  mm::comm::spoe::NO_USER = 0x07 , mm::comm::spoe::BOOTSTRAP_ONLY = 0x08 , mm::comm::spoe::NOT_BOOTSTRAP = 0x09 , mm::comm::spoe::NO_RIGHTS = 0x0A ,
  mm::comm::spoe::PROGRAM_ERROR = 0x0B , mm::comm::spoe::BUSY = 0x0C , mm::comm::spoe::FILENAME_LEN = 0x0D , mm::comm::spoe::TIMEOUT = 0x0E ,
  mm::comm::spoe::FLASH_BUSY = 0x28 , mm::comm::spoe::COMMUNICATION_BRIDGE_ERROR = 0x63
}
 Error status codes returned when reading or writing a file via SPoE message. More...
 
enum class  mm::comm::spoe::SpoeMessagePacketStatus : uint8_t { mm::comm::spoe::OK = 0x00 , mm::comm::spoe::FIRST = 0x80 , mm::comm::spoe::MIDDLE = 0xC0 , mm::comm::spoe::LAST = 0x40 }
 Packet status codes for SPoE messages. More...
 
enum class  mm::comm::spoe::PdoMode : uint8_t { mm::comm::spoe::NONE = 0 , mm::comm::spoe::MONITOR , mm::comm::spoe::CONTROL = 2 }
 Defines the modes for Process Data Object (PDO) communication over SPoE. More...
 

Functions

 mm::comm::spoe::NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE (Message, type, id, status, size, data)
 
Message mm::comm::spoe::parseMessage (const std::vector< uint8_t > &buffer)
 Parses a raw SPoE message buffer into a structured SpoeMessage. More...
 
std::vector< uint8_t > mm::comm::spoe::serializeSpoeMessage (const Message &message)
 Serializes an SpoeMessage object into a byte buffer. More...