Motion Master
Loading...
Searching...
No Matches
base.cc File Reference
#include "base.h"
#include <loguru.h>
#include <algorithm>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
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.
void mm::comm::base::from_json (const nlohmann::json &j, UiConfigJson &r)
 Deserialize a JSON object into a UiConfigJson structure.
std::string mm::comm::base::convertParameterValueToString (const ParameterValue &value)
 Converts a ParameterValue to a string representation.
void mm::comm::base::assignGroupsToParameters (std::vector< Parameter > &parameters)
 Assigns group names to parameters based on their index and subindex.
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.
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.
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.
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.
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.

Variables

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