@@ -46,7 +46,6 @@ uint8_t AudioOutputManager::HandleGetCurrentOutput()
46
46
47
47
CHIP_ERROR AudioOutputManager::HandleGetOutputList (AttributeValueEncoder & aEncoder)
48
48
{
49
- // TODO: Insert code here
50
49
return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
51
50
for (auto const & outputInfo : this ->mOutputs )
52
51
{
@@ -58,16 +57,16 @@ CHIP_ERROR AudioOutputManager::HandleGetOutputList(AttributeValueEncoder & aEnco
58
57
59
58
bool AudioOutputManager::HandleRenameOutput (const uint8_t & index, const chip::CharSpan & name)
60
59
{
61
- // TODO: Insert code here
62
60
bool audioOutputRenamed = false ;
63
61
64
62
for (OutputInfoType & output : mOutputs )
65
63
{
66
64
if (output.index == index )
67
65
{
68
66
audioOutputRenamed = true ;
69
- memcpy (this ->Data (index ), name.data (), name.size ());
70
- output.name = chip::CharSpan (this ->Data (index ), name.size ());
67
+ const size_t len = std::min (mBufMax , name.size ());
68
+ memcpy (this ->Data (index ), name.data (), len);
69
+ output.name = chip::CharSpan (this ->Data (index ), len);
71
70
}
72
71
}
73
72
@@ -76,7 +75,6 @@ bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::C
76
75
77
76
bool AudioOutputManager::HandleSelectOutput (const uint8_t & index)
78
77
{
79
- // TODO: Insert code here
80
78
bool audioOutputSelected = false ;
81
79
for (OutputInfoType & output : mOutputs )
82
80
{
0 commit comments