FastLED 3.10.6
Loading...
Searching...
No Matches

◆ buildDeviceInfo()

fl::json autoresearch::flex_io::buildDeviceInfo ( fl::u8 instance)
inline

Build the device-info JSON returned by the flexIoDeviceInfo RPC.

Shape:

{
"bus": "FLEX_IO",
"instance": 0,
"driverName": "I2S_SPI", // whatever IChannelDriver::getName() returns
"silicon": "ESP32",
"idfVersion": "5.5.4",
"supportedByBuild": true // false when no BusTraits<FLEX_IO, N> for this silicon
}

Definition at line 127 of file AutoResearchFlexIo.h.

127 {
128 fl::json info = fl::json::object();
129 info.set("bus", "FLEX_IO");
130 info.set("instance", static_cast<int64_t>(instance));
131 // firstDriverName gives the most-preferred registered driver's
132 // name — on classic ESP32 this is typically "I2S_SPI" for the
133 // FLEX_IO slot; on P4/C6/etc. "PARLIO"; on S3 "LCD_CLOCKLESS".
134 info.set("driverName", firstDriverName());
135 // Full driver list so the host can pick the FLEX_IO-bound one by
136 // name if firstDriverName isn't the FLEX_IO owner.
137 fl::json names_arr = fl::json::array();
138 for (const auto& n : registeredDriverNames()) {
139 names_arr.push_back(n);
140 }
141 info.set("registeredDriverNames", names_arr);
142 info.set("silicon", siliconName());
143 info.set("idfVersion", idfVersion());
144 info.set("supportedByBuild",
146 return info;
147}
void set(const fl::string &key, const json &value) FL_NO_EXCEPT
Definition json.h:866
void push_back(const json &value) FL_NO_EXCEPT
Definition json.h:918
static json object() FL_NO_EXCEPT
Definition json.h:857
static json array() FL_NO_EXCEPT
Definition json.h:853
static string from_literal(const char *literal) FL_NO_EXCEPT
fl::vector< fl::string > registeredDriverNames() FL_NO_EXCEPT
Return the list of registered driver names.
fl::string idfVersion() FL_NO_EXCEPT
ESP-IDF version string, or "n/a" on non-ESP32 targets.
fl::string firstDriverName() FL_NO_EXCEPT
Convenience — first non-empty driver name, or "<none>" if empty.
fl::string siliconName() FL_NO_EXCEPT
Platform identification string derived from build-time macros.

References fl::json::array(), firstDriverName(), FL_NO_EXCEPT, fl::string::from_literal(), idfVersion(), fl::json::object(), fl::json::push_back(), registeredDriverNames(), fl::json::set(), and siliconName().

+ Here is the call graph for this function: