备份
authorp15692025051 <846603105@qq.com>
Sat, 11 Jan 2025 07:08:44 +0000 (15:08 +0800)
committerp15692025051 <846603105@qq.com>
Sat, 11 Jan 2025 07:08:44 +0000 (15:08 +0800)
2.sdk/Helios_SDK/services/microPython/extmod/moduwebsocket.c
2.sdk/project/7PIN/audio/didianguanji.mp3 [new file with mode: 0644]

index a2ea4f2..ac10a39 100644 (file)
@@ -34,7 +34,8 @@
 #include "extmod/moduwebsocket.h"
 
 #if MICROPY_PY_UWEBSOCKET
-
+#include "mperrno.h"
+#include "mphal.h"
 #include "helios_debug.h"
 
 #define QPY_WS_LOG(msg, ...)      custom_log("websocket", msg, ##__VA_ARGS__)
@@ -124,6 +125,7 @@ STATIC mp_uint_t websocket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int
 
                 int to_recv = 0;
                 size_t sz = self->buf[1] & 0x7f;
+                //mp_printf(&mp_plat_print, "[uwebsocket] websocket_read sz = %d \r\n", sz);
                 if (sz == 126) {
                     // Msg size is next 2 bytes
                     to_recv += 2;
@@ -155,6 +157,7 @@ STATIC mp_uint_t websocket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int
                 if ((self->buf_pos & 3) == 2) {
                     // First two bytes are message length
                     self->msg_sz = (self->buf[0] << 8) | self->buf[1];
+                    mp_printf(&mp_plat_print, "[uwebsocket] websocket_read FRAME_OPT self->buf:%02X %02X \r\n",self->buf[0],self->buf[1]);
                 }
                 if (self->buf_pos >= 4) {
                     // Last 4 bytes is mask
@@ -179,6 +182,7 @@ STATIC mp_uint_t websocket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int
 
                 size_t sz = MIN(size, self->msg_sz);
                 out_sz = stream_p->read(self->sock, buf, sz, errcode);
+                mp_printf(&mp_plat_print, "[uwebsocket] websocket_read CONTROL sz=%d,out_sz=%d,size=%d\r\n", sz,out_sz,size);
                 if (out_sz == 0 || out_sz == MP_STREAM_ERROR) {
                     return out_sz;
                 }
diff --git a/2.sdk/project/7PIN/audio/didianguanji.mp3 b/2.sdk/project/7PIN/audio/didianguanji.mp3
new file mode 100644 (file)
index 0000000..9fec2d4
Binary files /dev/null and b/2.sdk/project/7PIN/audio/didianguanji.mp3 differ