Skip to content

Commit 62d9b51

Browse files
Update Notecard API from upstream schema changes (1b455b06d542089d79ff7f6bc4465ae3d206cf42) (#142)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent f46588e commit 62d9b51

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

notecard/dfu.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,21 @@
1313

1414

1515
@validate_card_object
16-
def get(card, length=None, offset=None):
16+
def get(card, binary=None, length=None, offset=None):
1717
"""Retrieve downloaded firmware data from the Notecard for use with IAP host MCU firmware updates.
1818
1919
Args:
2020
card (Notecard): The current Notecard object.
21+
binary (bool): If `true`, the Notecard will return firmware data in the binary I/O buffer instead of the response `payload` field. This allows for larger data transfers and more efficient processing. When `true`, the response will include `cobs`, `length`, and `status` (MD5 hash) fields instead of `payload`. Learn more in this guide on Sending and Receiving Large Binary Objects.
2122
length (int): The number of bytes of firmware data to read and return to the host. Set to `0` to verify that the Notecard is in DFU mode without attempting to retrieve data.
2223
offset (int): The offset to use before performing a read of firmware data.
2324
2425
Returns:
2526
dict: The result of the Notecard request.
2627
"""
2728
req = {"req": "dfu.get"}
29+
if binary is not None:
30+
req["binary"] = binary
2831
if length is not None:
2932
req["length"] = length
3033
if offset is not None:

0 commit comments

Comments
 (0)