Motion Master
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
base.cc File Reference
#include "base.h"
#include <loguru.h>
#include <unordered_map>
#include <unordered_set>
Include dependency graph for base.cc:

Namespaces

namespace  mm
 
namespace  mm::comm
 
namespace  mm::comm::base
 

Functions

void mm::comm::base::from_json (const nlohmann::json &j, UiPdoMapping &p)
 Deserialize a JSON object into a UiPdoMapping structure. More...
 
void mm::comm::base::from_json (const nlohmann::json &j, UiConfigJson &r)
 Deserialize a JSON object into a UiConfigJson structure. More...
 
std::string mm::comm::base::convertParameterValueToString (const ParameterValue &value)
 Converts a ParameterValue to a string representation. More...
 
void mm::comm::base::assignGroupsToParameters (std::vector< Parameter > &parameters)
 Assigns group names to parameters based on their index and subindex. More...
 
void mm::comm::base::logParametersMap (const std::unordered_map< Parameter::Address, Parameter > &parametersMap, bool sortParameters=true)
 Logs the contents of a map of parameters with an option to sort them. More...
 
std::vector< std::uint8_t > mm::comm::base::readCompleteDeviceFile (Device &device, const std::string &filename, const std::chrono::steady_clock::duration expiryTime=std::chrono::milliseconds(20000))
 Reads a file from the device, supporting both complete and multipart zipped files. More...
 
void mm::comm::base::writeDeviceFileInOptionalParts (Device &device, const std::string &filename, const std::vector< std::uint8_t > &data, std::function< void(uint8_t, std::string)> progressCallback=nullptr, const std::chrono::steady_clock::duration expiryTime=std::chrono::milliseconds(30000))
 Write a file to a device, splitting it into parts if necessary. More...
 
void mm::comm::base::removeDeviceFileOrParts (Device &device, const std::string &filename, const std::chrono::steady_clock::duration expiryTime=std::chrono::milliseconds(20000))
 Removes a file from the device, including handling multipart files if applicable. More...
 
void mm::comm::base::writeFirmwarePackage (Device &device, const std::vector< std::uint8_t > &data, const std::vector< std::string > &skipFiles={}, std::function< void(uint8_t, std::string)> progressCallback=nullptr, const std::chrono::steady_clock::duration expiryTime=std::chrono::milliseconds(60000))
 Writes a firmware package to the given device. More...
 

Variables

std::set< std::string > mm::comm::base::kNonPartedFileNames
 Set of filenames that are always stored as complete files and can be read directly. More...