Skip to content

Commit fe35349

Browse files
Update Notecard API from upstream schema changes (fb55b1c5788f41e0979e663a83cddfdfb301bfc2) (#136)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent fd011e6 commit fe35349

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

notecard/card.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def auxSerial(card, duration=None, limit=None, max=None, minutes=None, mode=None
117117
card (Notecard): The current Notecard object.
118118
duration (int): If using `"mode": "accel"`, specify a sampling duration for the Notecard accelerometer.
119119
limit (bool): If `true`, along with `"mode":"gps"` the Notecard will disable concurrent modem use during GPS tracking.
120-
max (int): The maximum amount of data to send per session, in bytes. This is typically set to the size of the receive buffer on the host minus `1`. For example, `note-arduino` uses a buffer size of `(SERIALRXBUFFER_SIZE - 1)`.
120+
max (int): The maximum amount of data, in bytes, that can be sent in a single transmission before the Notecard pauses to allow the host to process incoming data. This value should be set to the size of the host's serial receive buffer minus `1`, which represents the number of bytes the host can absorb before the sender must delay due to the absence of flow control. For example, `note-arduino`` uses a buffer size of `(SERIALRXBUFFER_SIZE - 1)`.
121121
minutes (int): When using `"mode": "notify,dfu"`, specify an interval for notifying the host.
122122
mode (str): The AUX mode. Must be one of the following:
123123
ms (int): The delay in milliseconds before sending a buffer of `max` size.

notecard/web.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,13 @@ def post(card, async_=None, binary=None, body=None, content=None, file=None, max
154154

155155

156156
@validate_card_object
157-
def put(card, async_=None, body=None, content=None, file=None, max=None, name=None, note=None, offset=None, payload=None, route=None, seconds=None, status=None, total=None, verify=None):
157+
def put(card, async_=None, binary=None, body=None, content=None, file=None, max=None, name=None, note=None, offset=None, payload=None, route=None, seconds=None, status=None, total=None, verify=None):
158158
"""Perform a simple HTTP or HTTPS `PUT` request against an external endpoint, and returns the response to the Notecard.
159159
160160
Args:
161161
card (Notecard): The current Notecard object.
162162
async_ (bool): If `true`, the Notecard performs the web request asynchronously, and returns control to the host without waiting for a response from Notehub.
163+
binary (bool): If `true`, the Notecard will send all the data in the binary buffer to the specified proxy route in Notehub. Learn more in this guide on Sending and Receiving Large Binary Objects.
163164
body (dict): The JSON body to send with the request.
164165
content (str): The MIME type of the body or payload of the response. Default is `application/json`.
165166
file (str): The name of the local-only Database Notefile (`.dbx`) to be used if the web request is issued asynchronously and you wish to store the response.
@@ -180,6 +181,8 @@ def put(card, async_=None, body=None, content=None, file=None, max=None, name=No
180181
req = {"req": "web.put"}
181182
if async_ is not None:
182183
req["async"] = async_
184+
if binary is not None:
185+
req["binary"] = binary
183186
if body:
184187
req["body"] = body
185188
if content:

0 commit comments

Comments
 (0)