Changes are cosmetic - and maybe very minor code size - but not functional.
_reg_read() was calling struct.packinto() with an incorrect number of
arguments but it seems like MicroPython didn't mind, as result is correct
for both versions.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
If send completes before the first call to poll_send(), the driver could
get stuck in _sync_wait(). This had much less impact before rp2 port went
tickless, as _sync_wait(will_irq=True) calls machine.idle() which may not
wake very frequently on a tickless port.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
According to the docs, only freq_khz was needed for working output.
However:
- Without output_power setting, no output from SX1262 antenna (theory:
output routed to the SX1261 antenna).
- SF,BW,etc. settings were different from the SX127x power on defaults, so
modems with an identical configuration were unable to communicate.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
- Fix binary data `Content-type` header and data `Content-Length`
calculation.
- Fix query length when data is included.
- Fix `json` and `text` methods of `ClientResponse` to read
`Content-Length` size
Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
MicroPython now supplies SSL/TLS functionality in a new built-in `tls`
module. The `ssl` module is now implemented purely in Python, in this
repository. Other libraries are updated to work with this scheme.
Signed-off-by: Felix Dörre <felix@dogcraft.de>
There don't seem to be any MQTT implementations that expect an empty
username (instead of the field missing), so the check for unused `user` can
be simplified.
Signed-off-by: Felix Dörre <felix@dogcraft.de>
Implement `aiohttp` with `ClientSession`, websockets and `SSLContext`
support.
Only client is implemented and API is mostly compatible with CPython
`aiohttp`.
Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
Allows modifying current line, adding/deleting characters in the middle
etc. Includes home/end keys to move to start/end of current line.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This is the last remaining use of the "options" feature. Nothing in the
main repo which `require()`'s this package sets it.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
- Add config for [tool.ruff.format] to pyproject.toml.
- Update pre-commit to run both ruff and ruff-format.
- Update a small number of files that change with ruff's rules.
- Update CI.
- Simplify codeformat.py just forward directly to "ruff format"
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This adds verifygitlog.py from the main repo, adds it to GitHub workflows,
and also pre-commit.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
PCRE is marked as EOL and won't receive any new security update.
Convert the re module to PCRE2 API to enforce security. Additional
dependency is now needed with uctypes due to changes in how PCRE2 return
the match_data in a pointer and require special handling.
The converted module is tested with the test_re.py with no regression.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The `--format` flag was changed to `--output-format` in the recent update.
Pin to this version to prevent further updates from breaking (e.g. through new rules or other changes).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Chunked detection does not work as generators never have an `__iter__`
attribute. They do have `__next__`.
Example that now works with this commit:
def read_in_chunks(file_object, chunk_size=4096):
while True:
data = file_object.read(chunk_size)
if not data:
break
yield data
file = open(filename, "rb")
r = requests.post(url, data=read_in_chunks(file))
Previously a BufferedCharacteristic could only be read by the client, where
it should have been writeable. This makes it support all ops (read / write
/ write-with-response, etc).
Adds a test to check the max_len and append functionality of
BufferedCharacteristic.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
In micropython/micropython#11239 we added support for passing data to
gatts_indicate (to make it match gatts_notify).
This adds the same to aioble.
Also update the documentation to mention this (and fix some mistakes and
add a few more examples).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
- If no reset pin was set, calling standby() in the constructor
would enable the TCXO (XOSC) before the timeout was correctly set.
- This manifested as a BUSY timeout on the STM32WL5, first time after power
on reset.
- Clean up the general handling of BUSY timeouts, but also add some safety
margin to the base timeout just in case (not an issue, is only a stop-gap
to prevent the modem blocking indefinitely.)
Signed-off-by: Angus Gratton <angus@redyak.com.au>
For unknown reason, power output in this configuration is lower than it
should be (including when compared to the STM32Cube C libraries running on
the same board.
Suspect either the Nucleo board antenna switch or the power amplifier
registers are being set wrong, but the actual root cause remains elusive...
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Support depends on hardware support in MicroPython.
Also includes some tweaks in the SX126x base class, to deal with slightly
different platform configuration on STM32WL55, longer timeouts, tx_ant
options, etc.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Also adds some global ignores for manifest files (which have implicit
imports) and the multitests (which have the same).
Other F821 fixes or accommodations are in the parent commits to this
commit.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
As-written this code is unreachable (return statement two line above),
so this change is really just to make the linter happy.
Found by Ruff checking F821.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This is a change just to make the linter happy, the code
probably would have run OK without it.
Found by Ruff checking F821.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
These were probably intentional missing names, however raising
NotImplementedError or KeyError is more explicit than trying to call an
unknown function.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Looks like copy-pasta from bmi270 driver.
There is a soft reset capability documented in the BMM150 datasheet, but it
uses different register bits and I don't have a BMM150 at hand to test it.
Found by Ruff checking F821.
Signed-off-by: Angus Gratton <angus@redyak.com.au>