21
21
#include < app/icd/client/DefaultICDClientStorage.h>
22
22
#include < crypto/DefaultSessionKeystore.h>
23
23
#include < crypto/RawKeySessionKeystore.h>
24
+ #include < string>
24
25
25
26
using namespace ::chip;
26
27
using namespace ::chip::app;
@@ -36,31 +37,32 @@ CHIP_ERROR ICDListCommand::RunCommand()
36
37
return CHIP_ERROR_NO_MEMORY;
37
38
}
38
39
app::DefaultICDClientStorage::ICDClientInfoIteratorWrapper clientInfoIteratorWrapper (iter);
39
- fprintf (stderr, " +-----------------------------------------------------------------------------+\n " );
40
- fprintf (stderr, " | %-75s |\n " , " Known ICDs:" );
41
- fprintf (stderr, " +-----------------------------------------------------------------------------+\n " );
42
- fprintf (stderr, " | %20s | %15s | %15s | %16s |\n " , " Fabric Index:Node ID" , " Start Counter" , " Counter Offset" ,
43
- " MonitoredSubject" );
40
+ fprintf (stderr, " +------------------------------------------------------------------------------------------ +\n " );
41
+ fprintf (stderr, " | %-88s |\n " , " Known ICDs:" );
42
+ fprintf (stderr, " +------------------------------------------------------------------------------------------ +\n " );
43
+ fprintf (stderr, " | %20s | %15s | %15s | %16s | %10s | \n " , " Fabric Index:Node ID" , " Start Counter" , " Counter Offset" ,
44
+ " MonitoredSubject" , " ClientType " );
44
45
45
46
while (iter->Next (info))
46
47
{
47
- fprintf (stderr, " +-----------------------------------------------------------------------------+\n " );
48
- fprintf (stderr, " | %3" PRIu32 " :" ChipLogFormatX64 " | %15" PRIu32 " | %15" PRIu32 " | " ChipLogFormatX64 " |\n " ,
48
+ fprintf (stderr, " +------------------------------------------------------------------------------------------ +\n " );
49
+ fprintf (stderr, " | %3" PRIu32 " :" ChipLogFormatX64 " | %15" PRIu32 " | %15" PRIu32 " | " ChipLogFormatX64 " | %10u | \n " ,
49
50
static_cast <uint32_t >(info.peer_node .GetFabricIndex ()), ChipLogValueX64 (info.peer_node .GetNodeId ()),
50
- info.start_icd_counter , info.offset , ChipLogValueX64 (info.monitored_subject ));
51
+ info.start_icd_counter , info.offset , ChipLogValueX64 (info.monitored_subject ),
52
+ static_cast <uint8_t >(info.client_type ));
51
53
52
54
static_assert (std::is_same<decltype (CHIPCommand::sSessionKeystore ), Crypto::RawKeySessionKeystore>::value,
53
55
" The following BytesToHex can copy/encode the key bytes from sharedKey to hexadecimal format, which only "
54
56
" works for RawKeySessionKeystore" );
55
57
Encoding::BytesToHex (info.aes_key_handle .As <Crypto::Symmetric128BitsKeyByteArray>(), Crypto::kAES_CCM128_Key_Length ,
56
58
icdAesKeyHex, sizeof (icdAesKeyHex), chip::Encoding::HexFlags::kNullTerminate );
57
- fprintf (stderr, " | aes key: %60s |\n " , icdAesKeyHex);
59
+ fprintf (stderr, " | aes key: %60s |\n " , icdAesKeyHex);
58
60
Encoding::BytesToHex (info.hmac_key_handle .As <Crypto::Symmetric128BitsKeyByteArray>(), Crypto::kHMAC_CCM128_Key_Length ,
59
61
icdHmacKeyHex, sizeof (icdHmacKeyHex), chip::Encoding::HexFlags::kNullTerminate );
60
- fprintf (stderr, " | hmac key: %60s |\n " , icdHmacKeyHex);
62
+ fprintf (stderr, " | hmac key: %60s |\n " , icdHmacKeyHex);
61
63
}
62
64
63
- fprintf (stderr, " +-----------------------------------------------------------------------------+\n " );
65
+ fprintf (stderr, " +------------------------------------------------------------------------------------------ +\n " );
64
66
SetCommandExitStatus (CHIP_NO_ERROR);
65
67
return CHIP_NO_ERROR;
66
68
}
0 commit comments