void Control::serialize(JSON::Adapter& adapter) { JSON::Class root(adapter, "Control"); JSON_E(adapter, pids); JSON_E(adapter, sensors); JSON_E(adapter, actuators); JSON_T(adapter, setpoints); }
// each class requires a public serialize function void Wifi::serialize( JSON::Adapter& adapter ) { // this pattern is required JSON::Class root( adapter, "wifis" ); // Use the _E variant to able to add more instance JSON_E( adapter, ssidAndMac ); // this is the last member variable we serialize so use the _T variant JSON_T( adapter, dbm ); }