This is not covered by the present integration tests for serial (uart/usb/shell) transport. The optimized parameters are given to the transport on initialization by parsing the FW file name.
|
line_length, line_buffers, max_smp_encoded_frame_size = map(int, match.groups()) |
|
async with SMPClient( |
|
SMPSerialTransport( |
|
max_smp_encoded_frame_size=max_smp_encoded_frame_size, |
|
line_length=line_length, |
|
line_buffers=line_buffers, |
|
), |
See the DUT FW files themselves: https://github.com/intercreate/smpclient/tree/main/examples/duts/nrf52840dk_nrf52840/usb
Likewise, the USB transport upload file test is using default values:
|
async with SMPClient(SMPSerialTransport(), port) as client: |
Defaults:
|
max_smp_encoded_frame_size: int = 256, |
|
line_length: int = 128, |
|
line_buffers: int = 2, |
On the other hand, the BLE tests do use the MCUMgr parameters. That works because MTU is given by the BLE MTU, the the mcumgr params give the max frame size, allowing for efficient fragmentation.
What's missing with the serial transport is knowledge of the "line_length", AKA MTU. mcumgr params do not provide the MTU.
This is mostly relevant for USB transports where uploads and downloads can be very slow if the buffer sizes are smaller than what the FW provides. Like 9KBps vs 50KBps with correct MTUs.
CC @aldenhaase
This is not covered by the present integration tests for serial (uart/usb/shell) transport. The optimized parameters are given to the transport on initialization by parsing the FW file name.
smpclient/examples/usb/upgrade.py
Line 57 in dcace1a
smpclient/examples/usb/upgrade.py
Lines 109 to 114 in dcace1a
See the DUT FW files themselves: https://github.com/intercreate/smpclient/tree/main/examples/duts/nrf52840dk_nrf52840/usb
Likewise, the USB transport upload file test is using default values:
smpclient/examples/usb/upload_file.py
Line 67 in dcace1a
Defaults:
smpclient/smpclient/transport/serial.py
Lines 74 to 76 in dcace1a
On the other hand, the BLE tests do use the MCUMgr parameters. That works because MTU is given by the BLE MTU, the the mcumgr params give the max frame size, allowing for efficient fragmentation.
What's missing with the serial transport is knowledge of the "line_length", AKA MTU. mcumgr params do not provide the MTU.
This is mostly relevant for USB transports where uploads and downloads can be very slow if the buffer sizes are smaller than what the FW provides. Like 9KBps vs 50KBps with correct MTUs.
CC @aldenhaase