Skip to content

Commit 97f3d0f

Browse files
committed
Merge remote-tracking branch 'adafruit/main'
2 parents b57fdef + 648c141 commit 97f3d0f

File tree

11 files changed

+124
-38
lines changed

11 files changed

+124
-38
lines changed

.github/actions/deps/external/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ runs:
2525
inputs.port != 'espressif'
2626
uses: carlosperate/arm-none-eabi-gcc-action@v1
2727
with:
28-
release: '12.3.Rel1'
28+
release: '13.2.Rel1'
2929

3030
# espressif
3131
- name: Get espressif toolchain

locale/circuitpython.pot

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,15 @@ msgstr ""
10181018
msgid "Failed to acquire mutex, err 0x%04x"
10191019
msgstr ""
10201020

1021+
#: ports/raspberrypi/common-hal/mdns/Server.c
1022+
msgid "Failed to add service TXT record"
1023+
msgstr ""
1024+
1025+
#: shared-bindings/mdns/Server.c
1026+
msgid ""
1027+
"Failed to add service TXT record; non-string or bytes found in txt_records"
1028+
msgstr ""
1029+
10211030
#: shared-module/rgbmatrix/RGBMatrix.c
10221031
msgid "Failed to allocate %q buffer"
10231032
msgstr ""

locale/pt_BR.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgstr ""
66
"Project-Id-Version: PACKAGE VERSION\n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
9-
"PO-Revision-Date: 2023-10-29 05:03+0000\n"
9+
"PO-Revision-Date: 2023-11-01 07:01+0000\n"
1010
"Last-Translator: Wellington Terumi Uemura <[email protected]>\n"
1111
"Language-Team: \n"
1212
"Language: pt_BR\n"
@@ -3042,7 +3042,7 @@ msgstr "dtype deve ser flutuante ou complexo"
30423042

30433043
#: extmod/ulab/code/ndarray_operators.c
30443044
msgid "dtype of int32 is not supported"
3045-
msgstr ""
3045+
msgstr "dtype de int32 não é suportado"
30463046

30473047
#: py/objdeque.c
30483048
msgid "empty"
@@ -3919,7 +3919,7 @@ msgstr "operação não é compatível com o tipo informado"
39193919

39203920
#: extmod/ulab/code/ndarray_operators.c
39213921
msgid "operation not supported for the input types"
3922-
msgstr ""
3922+
msgstr "a operação não é suportada para os tipos de entrada"
39233923

39243924
#: py/modbuiltins.c
39253925
msgid "ord expects a character"

locale/zh_Latn_pinyin.po

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ msgstr ""
77
"Project-Id-Version: circuitpython-cn\n"
88
"Report-Msgid-Bugs-To: \n"
99
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
10-
"PO-Revision-Date: 2023-10-16 23:54+0000\n"
10+
"PO-Revision-Date: 2023-11-01 07:01+0000\n"
1111
"Last-Translator: hexthat <[email protected]>\n"
1212
"Language-Team: Chinese Hanyu Pinyin\n"
1313
"Language: zh_Latn_pinyin\n"
1414
"MIME-Version: 1.0\n"
1515
"Content-Type: text/plain; charset=UTF-8\n"
1616
"Content-Transfer-Encoding: 8bit\n"
1717
"Plural-Forms: nplurals=1; plural=0;\n"
18-
"X-Generator: Weblate 5.1\n"
18+
"X-Generator: Weblate 5.2-dev\n"
1919

2020
#: main.c
2121
msgid ""
@@ -191,7 +191,7 @@ msgstr "%q chángdù bìxū >= %d"
191191

192192
#: py/objmodule.c py/runtime.c
193193
msgid "%q moved from %q to %q"
194-
msgstr ""
194+
msgstr "%q cóng %q yídòngdào %q"
195195

196196
#: py/argcheck.c
197197
msgid "%q must be %d"
@@ -233,7 +233,7 @@ msgstr ""
233233

234234
#: shared-bindings/warnings/__init__.c
235235
msgid "%q must be a subclass of %q"
236-
msgstr ""
236+
msgstr "%q bìxūshì %q de zǐlèi"
237237

238238
#: ports/espressif/common-hal/analogbufio/BufferedIn.c
239239
msgid "%q must be array of type 'H'"
@@ -272,7 +272,7 @@ msgstr "%q chāochū fànwéi"
272272

273273
#: py/objmodule.c py/runtime.c
274274
msgid "%q renamed %q"
275-
msgstr ""
275+
msgstr "%q zhòngmìngmíngwéi %q"
276276

277277
#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c
278278
msgid "%q step cannot be zero"
@@ -309,7 +309,7 @@ msgstr "%q[%u] děngdài jìshù zhīwài de shūrù"
309309
#: py/runtime.c
310310
#, c-format
311311
msgid "%s"
312-
msgstr ""
312+
msgstr "%s"
313313

314314
#: ports/espressif/common-hal/espidf/__init__.c
315315
#, c-format
@@ -423,7 +423,7 @@ msgstr "'await' wèiyú hánshù zhīwài"
423423

424424
#: py/compile.c
425425
msgid "'break'/'continue' outside loop"
426-
msgstr ""
426+
msgstr "'zhōngduàn'/'jìxù' wài xúnhuán"
427427

428428
#: py/compile.c
429429
msgid "'data' requires at least 2 arguments"
@@ -465,7 +465,7 @@ msgstr ", zài %q\n"
465465
#: shared-bindings/epaperdisplay/EPaperDisplay.c
466466
#: shared-bindings/framebufferio/FramebufferDisplay.c
467467
msgid ".show(x) removed. Use .root_group = x"
468-
msgstr ""
468+
msgstr "show(x) yǐ shānchú. Shǐyòng .root_group = x"
469469

470470
#: py/objcomplex.c
471471
msgid "0.0 to a complex power"
@@ -2542,7 +2542,7 @@ msgstr "gètǐ hé xiǎoxíng cāngkù guǎnlǐjú yìchū"
25422542

25432543
#: py/compile.c
25442544
msgid "async for/with outside async function"
2545-
msgstr ""
2545+
msgstr "yòngyú / yǔ wàibù yìbù hánshù de yìbù"
25462546

25472547
#: extmod/ulab/code/numpy/numerical.c
25482548
msgid "attempt to get (arg)min/(arg)max of empty sequence"
@@ -2554,7 +2554,7 @@ msgstr "chángshì huòqǔ kōng xùliè de argmin/ argmax"
25542554

25552555
#: py/objstr.c
25562556
msgid "attributes not supported"
2557-
msgstr ""
2557+
msgstr "bù zhīchí de shǔxìng"
25582558

25592559
#: extmod/ulab/code/ulab_tools.c
25602560
msgid "axis is out of bounds"
@@ -2750,7 +2750,7 @@ msgstr "bùnéng yǐn hán de jiāng '%q' zhuǎnhuàn wèi 'bool'"
27502750

27512751
#: py/runtime.c
27522752
msgid "can't import name %q"
2753-
msgstr ""
2753+
msgstr "wúfǎ dǎorù míngchēng %q"
27542754

27552755
#: py/emitnative.c
27562756
msgid "can't load from '%q'"
@@ -2804,11 +2804,11 @@ msgstr "wúfǎ cóng shǒudòng zìduàn guīgé qiēhuàn dào zìdòng zìduà
28042804

28052805
#: py/objcomplex.c
28062806
msgid "can't truncate-divide a complex number"
2807-
msgstr ""
2807+
msgstr "shùliàng fùzá"
28082808

28092809
#: extmod/moductypes.c
28102810
msgid "can't unambiguously get sizeof scalar"
2811-
msgstr ""
2811+
msgstr "Wúfǎ míngquè de huòdé biāoliàng de dàxiǎo"
28122812

28132813
#: extmod/modasyncio.c
28142814
msgid "can't wait"
@@ -2900,7 +2900,7 @@ msgstr "yīn tè hé wū yīn tè de bǐ jiào"
29002900

29012901
#: py/objcomplex.c
29022902
msgid "complex divide by zero"
2903-
msgstr ""
2903+
msgstr "fùshù chúyǐ língdù"
29042904

29052905
#: py/objfloat.c py/parsenum.c
29062906
msgid "complex values not supported"
@@ -3016,7 +3016,7 @@ msgstr "dtype bì xū shì fú diǎn xíng huò fù shù"
30163016

30173017
#: extmod/ulab/code/ndarray_operators.c
30183018
msgid "dtype of int32 is not supported"
3019-
msgstr ""
3019+
msgstr "bù zhīchí int32 de dtype"
30203020

30213021
#: py/objdeque.c
30223022
msgid "empty"
@@ -3159,7 +3159,7 @@ msgstr "zìtǐ bìxū wèi 2048 zì jié"
31593159

31603160
#: extmod/moddeflate.c
31613161
msgid "format"
3162-
msgstr ""
3162+
msgstr "Géshì"
31633163

31643164
#: py/objstr.c
31653165
msgid "format requires a dict"
@@ -3403,7 +3403,7 @@ msgstr "Jiàngé bìxū zài %s-%s fànwéi nèi"
34033403

34043404
#: py/compile.c
34053405
msgid "invalid arch"
3406-
msgstr ""
3406+
msgstr "wúxiàode cúndàng"
34073407

34083408
#: shared-bindings/bitmaptools/__init__.c
34093409
#, c-format
@@ -3488,7 +3488,7 @@ msgstr ""
34883488

34893489
#: py/argcheck.c
34903490
msgid "keyword argument(s) not implemented - use normal args instead"
3491-
msgstr ""
3491+
msgstr "wèi shíxiàn guānjiànzì cānshù - gǎiyòng pǔtōng cānshù"
34923492

34933493
#: py/emitinlinethumb.c py/emitinlinextensa.c
34943494
msgid "label '%q' not defined"
@@ -3586,15 +3586,15 @@ msgstr "jìyì tǐ fēnpèi shībài, duī bèi suǒdìng"
35863586

35873587
#: py/objarray.c
35883588
msgid "memoryview offset too large"
3589-
msgstr ""
3589+
msgstr "memoryview piānyíliàng guòdà"
35903590

35913591
#: py/objarray.c
35923592
msgid "memoryview: length is not a multiple of itemsize"
35933593
msgstr "nèi cún shì tú: cháng dù bú shì xiàng mù huà de bèi shù"
35943594

35953595
#: extmod/modtime.c
35963596
msgid "mktime needs a tuple of length 8 or 9"
3597-
msgstr ""
3597+
msgstr "mktime xūyào cháng dùwéi 8 huò 9 de yuánzǔ"
35983598

35993599
#: extmod/ulab/code/numpy/linalg/linalg.c
36003600
msgid "mode must be complete, or reduced"
@@ -3642,7 +3642,7 @@ msgstr "míngchēng wèi dìngyì"
36423642

36433643
#: py/persistentcode.c
36443644
msgid "native code in .mpy unsupported"
3645-
msgstr ""
3645+
msgstr "bù zhīchí .mpy zhōngde běnjī dàimǎ"
36463646

36473647
#: py/asmthumb.c
36483648
msgid "native method too big"
@@ -3887,7 +3887,7 @@ msgstr "gěi dìng lèixíng bù zhīchí gāi cāozuò"
38873887

38883888
#: extmod/ulab/code/ndarray_operators.c
38893889
msgid "operation not supported for the input types"
3890-
msgstr ""
3890+
msgstr "shūrù lèixíng bù zhīchí cāozuò"
38913891

38923892
#: py/modbuiltins.c
38933893
msgid "ord expects a character"
@@ -4129,7 +4129,7 @@ msgstr "yuán wèi tú (source_bitmap) de zhí de shù mù (value_count) bì xū
41294129

41304130
#: extmod/modre.c
41314131
msgid "splitting with sub-captures"
4132-
msgstr ""
4132+
msgstr "shǐyòng zi bǔhuò jìnxíng chāifēn"
41334133

41344134
#: py/objstr.c
41354135
msgid "start/end indices"
@@ -4145,7 +4145,7 @@ msgstr "bù zhīchí liú cāozuò"
41454145

41464146
#: py/objarray.c py/objstr.c
41474147
msgid "string argument without an encoding"
4148-
msgstr ""
4148+
msgstr "búdài biānmǎ de zìfúchuàn cānshù"
41494149

41504150
#: py/objstrunicode.c
41514151
msgid "string index out of range"
@@ -4186,7 +4186,7 @@ msgstr "uctypes miáoshù fú zhōng de yǔfǎ cuòwù"
41864186

41874187
#: extmod/modtime.c
41884188
msgid "ticks interval overflow"
4189-
msgstr ""
4189+
msgstr "fēnshí jiàngé yìchū"
41904190

41914191
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
41924192
msgid "timeout duration exceeded the maximum supported value"
@@ -4392,7 +4392,7 @@ msgstr "zhí fàn wéi wài de mù biāo"
43924392

43934393
#: extmod/moddeflate.c
43944394
msgid "wbits"
4395-
msgstr ""
4395+
msgstr "fànwéi"
43964396

43974397
#: shared-bindings/is31fl3741/FrameBuffer.c
43984398
msgid "width must be greater than zero"

ports/espressif/common-hal/mdns/Server.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,25 @@ mp_obj_t common_hal_mdns_server_find(mdns_server_obj_t *self, const char *servic
208208
return MP_OBJ_FROM_PTR(tuple);
209209
}
210210

211-
void common_hal_mdns_server_advertise_service(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_int_t port) {
211+
void common_hal_mdns_server_advertise_service(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_int_t port, const char *txt_records[], size_t num_txt_records) {
212212
if (mdns_service_exists(service_type, protocol, NULL)) {
213213
mdns_service_port_set(service_type, protocol, port);
214214
} else {
215+
// TODO: Add support for TXT record
216+
/* NOTE: The `mdns_txt_item_t *txt` argument of mdns_service_add uses a struct
217+
* that splits out the TXT record into keys and values, though it seems little
218+
* is done with those fields aside from concatenating them with an optional
219+
* equals sign and calculating the total length of the concatenated string.
220+
*
221+
* There should be little issue with the underlying implementation to populate
222+
* the mdns_txt_item_t struct with only a key containing exactly the desired TXT
223+
* record. As long as the underlying implementation calculates the length of the
224+
* key + NULL value correctly, it should work.
225+
*
226+
* Ref: RFC 6763, section 6.1:
227+
* > The format of each constituent string within the DNS TXT record is a single
228+
* > length byte, followed by 0-255 bytes of text data.
229+
*/
215230
mdns_service_add(NULL, service_type, protocol, port, NULL, 0);
216231
}
217232
}

ports/raspberrypi/common-hal/mdns/Server.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "py/runtime.h"
3131
#include "shared/runtime/interrupt_char.h"
3232
#include "shared-bindings/mdns/RemoteService.h"
33+
#include "shared-bindings/mdns/Server.h"
3334
#include "shared-bindings/wifi/__init__.h"
3435
#include "supervisor/shared/tick.h"
3536

@@ -295,7 +296,27 @@ mp_obj_t common_hal_mdns_server_find(mdns_server_obj_t *self, const char *servic
295296
return MP_OBJ_FROM_PTR(tuple);
296297
}
297298

298-
void common_hal_mdns_server_advertise_service(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_int_t port) {
299+
STATIC void srv_txt_cb(struct mdns_service *service, void *ptr) {
300+
mdns_server_obj_t *self = ptr;
301+
err_t res;
302+
for (size_t i = 0; i < self->num_txt_records; i++) {
303+
res = mdns_resp_add_service_txtitem(service, self->txt_records[i], strlen(self->txt_records[i]));
304+
if (res != ERR_OK) {
305+
mp_raise_RuntimeError(MP_ERROR_TEXT("Failed to add service TXT record"));
306+
return;
307+
}
308+
}
309+
}
310+
311+
STATIC void assign_txt_records(mdns_server_obj_t *self, const char *txt_records[], size_t num_txt_records) {
312+
size_t allowed_num_txt_records = MDNS_MAX_TXT_RECORDS < num_txt_records ? MDNS_MAX_TXT_RECORDS : num_txt_records;
313+
self->num_txt_records = allowed_num_txt_records;
314+
for (size_t i = 0; i < allowed_num_txt_records; i++) {
315+
self->txt_records[i] = txt_records[i];
316+
}
317+
}
318+
319+
void common_hal_mdns_server_advertise_service(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_int_t port, const char *txt_records[], size_t num_txt_records) {
299320
enum mdns_sd_proto proto = DNSSD_PROTO_UDP;
300321
if (strcmp(protocol, "_tcp") == 0) {
301322
proto = DNSSD_PROTO_TCP;
@@ -313,7 +334,9 @@ void common_hal_mdns_server_advertise_service(mdns_server_obj_t *self, const cha
313334
if (existing_slot < MDNS_MAX_SERVICES) {
314335
mdns_resp_del_service(NETIF_STA, existing_slot);
315336
}
316-
int8_t slot = mdns_resp_add_service(NETIF_STA, self->instance_name, service_type, proto, port, NULL, NULL);
337+
338+
assign_txt_records(self, txt_records, num_txt_records);
339+
int8_t slot = mdns_resp_add_service(NETIF_STA, self->instance_name, service_type, proto, port, srv_txt_cb, self);
317340
if (slot < 0) {
318341
mp_raise_RuntimeError(MP_ERROR_TEXT("Out of MDNS service slots"));
319342
return;

ports/raspberrypi/common-hal/mdns/Server.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@
3030

3131
#include "lwip/apps/mdns_opts.h"
3232

33+
#define MDNS_MAX_TXT_RECORDS 32
34+
3335
typedef struct {
3436
mp_obj_base_t base;
3537
const char *hostname;
3638
const char *instance_name;
3739
char default_hostname[sizeof("cpy-XXXXXX")];
3840
const char *service_type[MDNS_MAX_SERVICES];
41+
size_t num_txt_records;
42+
const char *txt_records[MDNS_MAX_TXT_RECORDS];
3943
// Track if this object owns access to the underlying MDNS service.
4044
bool inited;
4145
} mdns_server_obj_t;

ports/stm/boards/thunderpack_v12/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ LONGINT_IMPL = NONE
1111
SPI_FLASH_FILESYSTEM = 1
1212
EXTERNAL_FLASH_DEVICES = GD25Q16C
1313

14+
CIRCUITPY_AESIO = 0
1415
CIRCUITPY_BITMAPTOOLS = 0
1516
CIRCUITPY_BLEIO_HCI = 0
17+
CIRCUITPY_BUSDEVICE = 0
1618
CIRCUITPY_NVM = 1
1719
CIRCUITPY_SYNTHIO = 0
1820
CIRCUITPY_ZLIB = 0

0 commit comments

Comments
 (0)