Skip to content

Format is are to parse, we need a token.... #1

@RobertLRead

Description

@RobertLRead

Dear Geoff,

I'm a little stuck. The parsing code seems to look for a token (and open bracket '['). The "cJSON_printStruct" produces the below example. It looks like a bracket is opening arrays, which is fine. I like your idea of using a simple prefix toekn to start each line. However, it is unclear to me where in cJSON_PrintStruct I would add this. The buffer manipulation is opaque.

I'm tempted to say that at line 1793 I could change:
strcpy(prefix,"");
to
strcpy(prefix,"[");
and that might work---but I'm unclear if I need to change byte counts in that case.

Maybe you can fix this or give me some guidance as to the best place to fix it.

Name. Experiment#1 TimeStamp. 1680759024 DryRun. false Nonce. 357 MaxDeltaC. 5 [ States.State.Name. Warmup [ States.State.Phases.Duration. 3600 States.State.Phases.Fan.Speed. 20 States.State.Phases.Heater.Temp. 400 States.State.Phases.Heater.Current. 10 States.State.Phases.Heater.Ramp. 40 States.State.Phases.Stack.Temp. 400 States.State.Phases.Stack.Current. 60 States.State.Phases.Stack.Ramp. 5 [ States.State.Name. Cooldown [ States.State.Phases.Duration. -1 States.State.Phases.Fan.Speed. 30 States.State.Phases.Heater.Temp. 35 States.State.Phases.Heater.Current. 10 States.State.Phases.Heater.Ramp. 4 States.State.Phases.Stack.Temp. 35 States.State.Phases.Stack.Current. 0 States.State.Phases.Stack.Ramp. 1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions