質問編集履歴

1

コメントを追記

2022/08/29 14:11

投稿

yuusakuri
yuusakuri

スコア6

test CHANGED
File without changes
test CHANGED
@@ -109,7 +109,7 @@
109
109
  SerialBT.print(i);
110
110
  SerialBT.printf("', ");
111
111
  SerialBT.printf("parsedCommand.name: '");
112
- SerialBT.print(parsedCommand->name);
112
+ SerialBT.print(parsedCommand->name);//ここではstと出力される
113
113
  SerialBT.printf("'");
114
114
  SerialBT.println("");
115
115
  bool isParamName = splitedReceivedString[i][0] == '-';
@@ -117,7 +117,7 @@
117
117
  parsedCommand->paramsCount++;
118
118
  parsedCommand->params[parsedCommand->paramsCount - 1].name = splitedReceivedString[i];
119
119
  } else {
120
- parsedCommand->params[parsedCommand->paramsCount - 1].value = splitedReceivedString[i]; //この行を消すとparsedCommand->nameは'st'のまま
120
+ parsedCommand->params[parsedCommand->paramsCount - 1].value = splitedReceivedString[i]; //問題のか所。この行を消すとparsedCommand->nameは'st'のままだが、残すとi:1の際にparsedCommand->nameが1111111となる。
121
121
  }
122
122
  }
123
123
 
@@ -125,7 +125,7 @@
125
125
  SerialBT.printf("Debug: Line: '");
126
126
  logout;
127
127
  SerialBT.printf("parsedCommand.name: '");
128
- SerialBT.print(parsedCommand->name);
128
+ SerialBT.print(parsedCommand->name); // ここで1111111と出力されるが、stと出力されるのを想定している。
129
129
  SerialBT.printf("'");
130
130
  SerialBT.println("");
131
131
  SerialBT.printf("parsedCommand.paramsCount: '");