17 if (argv.size() < 2) {
23 key += std::to_string(
static_cast<int>(
static_resource->current_model_id));
25 MA_STORAGE_SET_STR(ret,
static_resource->device->getStorage(), key, argv[1]);
29 encoder.
write(
"info", argv.size() < 2 ?
"" : argv[1]);
31 transport.
send(
reinterpret_cast<const char*
>(encoder.
data()), encoder.
size());
39 if (argv.size() < 1) {
45 key += std::to_string(
static_cast<int>(
static_resource->current_model_id));
47 MA_STORAGE_GET_STR(
static_resource->device->getStorage(), key, value,
"");
51 encoder.
write(
"info", value);
53 transport.
send(
reinterpret_cast<const char*
>(encoder.
data()), encoder.
size());
Definition: ma_codec_base.h:14
virtual ma_err_t end()=0
Encoder type for end.
virtual const void * data() const =0
Encoder type for get data.
virtual ma_err_t begin()=0
Encoder type for begin.
virtual ma_err_t write(const std::string &key, int8_t value)=0
Encoder type for write int8_t value.
virtual const size_t size() const =0
Encoder type for get size.
Definition: ma_transport.h:12
virtual size_t send(const char *data, size_t length) noexcept=0
#define MA_AT_CMD_INFO
Definition: ma_definations.h:67
@ MA_MSG_TYPE_RESP
Definition: ma_types.h:252
ma_err_t
Definition: ma_types.h:21
@ MA_OK
Definition: ma_types.h:23
@ MA_EINVAL
Definition: ma_types.h:28
Definition: algorithm.hpp:11
void storeInfo(const std::vector< std::string > &argv, Transport &transport, Encoder &encoder)
Definition: info.hpp:13
void readInfo(const std::vector< std::string > &argv, Transport &transport, Encoder &encoder)
Definition: info.hpp:34
#define static_resource
Definition: resource.hpp:64