sdbusplus:通過(guò)ObjectManager讀取數(shù)據(jù)_風(fēng)靜如云的博客-CSDN博客文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-639210.html
讀取的是pair類型的數(shù)據(jù)結(jié)構(gòu),操作起來(lái)略有繁瑣,可以通過(guò)如下方法,將讀到的數(shù)據(jù)轉(zhuǎn)換為json格式:文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-639210.html
//dbusGetObj.h
#pragma once
#include <string>
#include <vector>
#include <tuple>
#include <variant>
#include <map>
#include <sdbusplus/message/native_types.hpp>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using DbusVariantType = std::variant<
std::vector<std::tuple<std::string, std::string, std::string>>,
std::vector<std::string>,
std::vector<double>,
std::string,
int64_t,
uint64_t,
double,
int32_t,
uint32_t,
int16_t,
uint16_t,
uint8_t,
bool,
std::vector<uint32_t>,
到了這里,關(guān)于sdbusplus:通過(guò)ObjectManager讀取json格式數(shù)據(jù)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!