Skip to content

Commit

Permalink
reuse first chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed Feb 21, 2024
1 parent 5af4400 commit 214e77c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/ds/d500/hw_monitor_extended_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ namespace librealsense
{
std::vector< uint8_t > recv_msg;

// send first command with 0/0 on param4, as we don't know the table size
// actual size will be returned as part for the response header and will be used
// to calculate the extended loop range
// send first command with 0/0 on param4, this should get the first chunk withoud knowing
// the actual table size, actual size will be returned as part for the response header and
// will be used to calculate the extended loop range
auto ans = hw_monitor::send(cmd, p_response, locked_transfer);
recv_msg.insert(recv_msg.end(), ans.begin(), ans.end());

Expand All @@ -67,13 +67,10 @@ namespace librealsense

if (recv_msg_length > HW_MONITOR_BUFFER_SIZE)
{
// currently we assume HKR sends only the table size when sending 0/0 chunks command above.
// in the future the FW should send chunk 1 in 0/0 command and then we can use it here.
// meaning remove the 'clear' and start the loop from 1

recv_msg.clear();
uint16_t overall_chunks = get_number_of_chunks( recv_msg_length );
for( int i = 0; i < overall_chunks; ++i )

// Since we already have the first chunk we start the loop from index 1
for( int i = 1; i < overall_chunks; ++i )
{
// chunk number is in param4
cmd.param4 = compute_chunks_param( overall_chunks, i );
Expand Down

0 comments on commit 214e77c

Please sign in to comment.