@@ -177,6 +177,10 @@ bool ReadValue(Json::Value jsonValue)
177
177
return false ;
178
178
}
179
179
180
+ uint16_t ReadUint16 (Json::Value jsonValue){
181
+ return static_cast <uint16_t >(jsonValue.asUInt ());
182
+ }
183
+
180
184
// TODO: This should be moved to a method of P256Keypair
181
185
CHIP_ERROR LoadKeypairFromRaw (ByteSpan private_key, ByteSpan public_key, Crypto::P256Keypair & keypair)
182
186
{
@@ -205,6 +209,7 @@ void TestHarnessDACProvider::Init(const char * filepath)
205
209
static constexpr char kFirmwareInfoKey [] = " firmware_information" ;
206
210
static constexpr char kIsSuccessKey [] = " is_success_case" ;
207
211
static constexpr char kDescription [] = " description" ;
212
+ static constexpr char kPid [] = " basic_info_pid" ;
208
213
209
214
std::ifstream json (filepath, std::ifstream::binary);
210
215
if (!json)
@@ -272,6 +277,11 @@ void TestHarnessDACProvider::Init(const char * filepath)
272
277
data.description .SetValue (ReadValue (root[kDescription ], buf, sizeof (buf)));
273
278
}
274
279
280
+ if (root.isMember (kPid ))
281
+ {
282
+ data.pid .SetValue (ReadUint16 (root[kPid ]));
283
+ }
284
+
275
285
Init (data);
276
286
}
277
287
@@ -288,6 +298,8 @@ void TestHarnessDACProvider::Init(const TestHarnessDACProviderData & data)
288
298
289
299
// TODO: We need a real example FirmwareInformation to be populated.
290
300
mFirmwareInformation = data.firmwareInformation .HasValue () ? data.firmwareInformation .Value () : ByteSpan ();
301
+
302
+ mPid = data.pid .ValueOr (0x8000 );
291
303
}
292
304
293
305
CHIP_ERROR TestHarnessDACProvider::GetDeviceAttestationCert (MutableByteSpan & out_dac_buffer)
0 commit comments