RTC接入
authorp15692025051 <846603105@qq.com>
Tue, 11 Mar 2025 09:32:41 +0000 (17:32 +0800)
committerp15692025051 <846603105@qq.com>
Tue, 11 Mar 2025 09:32:41 +0000 (17:32 +0800)
70 files changed:
2.sdk/Helios_SDK/Makefile
2.sdk/Helios_SDK/components/audio/audio.mk
2.sdk/Helios_SDK/components/audio/helios_audio_amr.c
2.sdk/Helios_SDK/components/audio/helios_audio_cfg_py.h [new file with mode: 0644]
2.sdk/Helios_SDK/components/audio/helios_audio_mp3.c
2.sdk/Helios_SDK/components/audio/helios_audio_py.c
2.sdk/Helios_SDK/components/audio/helios_audio_py.h
2.sdk/Helios_SDK/components/poc/bnd_xin/lib/broad.lib
2.sdk/Helios_SDK/components/poc/poc.c
2.sdk/Helios_SDK/components/poc/poc.h
2.sdk/Helios_SDK/components/poc/slpoc/src/modpoc_slpoc.c
2.sdk/Helios_SDK/config/autoconf.h
2.sdk/Helios_SDK/config/config.in
2.sdk/Helios_SDK/config/config.mk
2.sdk/Helios_SDK/driver/lcd/qpy_lcd.c
2.sdk/Helios_SDK/link.mk
2.sdk/Helios_SDK/main.py
2.sdk/Helios_SDK/peripheral/helios_wlan5803.h
2.sdk/Helios_SDK/plat.mk
2.sdk/Helios_SDK/sample/sample.c
2.sdk/Helios_SDK/services/microPython/config/config.in
2.sdk/Helios_SDK/services/microPython/extmod/vfs_lfsx.c
2.sdk/Helios_SDK/services/microPython/extmod/vfs_temp.c
2.sdk/Helios_SDK/services/microPython/microPython.mk
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/motor.py
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/audio_audio.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/audio_record.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/callbackdeal.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/callbackdeal.h
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/machine_iic.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/machine_iic_simulation.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/machine_rtc.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/misc_adc.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modai_rtc.c [new file with mode: 0644]
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modaudio.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modcelllocator.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/moddatacall.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/moddev.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/moddlms.c [new file with mode: 0644]
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modfota.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modgpio_encoder.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modlpm.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modnet.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modnetwork.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modqrcode.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modsms.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modsocket.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modutime.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modvoicecall.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modwlan.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modwlan_ASR5803.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/mpconfigport.h
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/umqtt.py
2.sdk/Helios_SDK/system/dev/helios_dev.h
2.sdk/Helios_SDK/system/esim/helios_esim.h
2.sdk/Helios_SDK/system/fota/helios_fota.h
2.sdk/Helios_SDK/system/fs/helios_fs.h
2.sdk/Helios_SDK/system/hal/helios_audio.h
2.sdk/Helios_SDK/system/hal/helios_lpm.h
2.sdk/Helios_SDK/system/hal/helios_pin.h
2.sdk/Helios_SDK/system/hal/helios_pwm.h
2.sdk/Helios_SDK/system/hal/helios_rtc.h
2.sdk/Helios_SDK/system/lwip/ASR_1606/include/sockets.h
2.sdk/Helios_SDK/system/mbedtls/port/helios/src/timing_alt.c
2.sdk/Helios_SDK/system/network/helios_datacall.h
2.sdk/Helios_SDK/system/network/helios_lwm2m.h
2.sdk/Helios_SDK/system/network/helios_nw.h
2.sdk/Helios_SDK/system/network/helios_voicecall.h
2.sdk/Helios_SDK/system/os/helios_os.h
2.sdk/Helios_SDK/system/system.mk

index 5de35b1..f1b5029 100644 (file)
@@ -70,7 +70,7 @@ CROSS = arm-none-eabi
 endif
 
 # if Unisoc platform
-ifeq ($(strip $(PLAT)), $(filter $(PLAT),Unisoc Unisoc_8910_R05))
+ifeq ($(strip $(PLAT)), $(filter $(PLAT),Unisoc Unisoc_8910_R05 Unisoc_8910_R06))
 ifeq ($(HOST),win32)
 ifneq ($(strip $(ARM_GCC_COMPILER_PATH)),)
 export COMPILER_PATH = $(strip $(ARM_GCC_COMPILER_PATH))
@@ -99,8 +99,18 @@ endif
 CROSS = arm-none-eabi
 endif
 
+# if ASR_1803sc platform
+ifeq ($(PLAT),ASR_1803sc)
+ifeq ($(HOST),win32)
+ifneq ($(strip $(ARM_GCC_COMPILER_PATH)),)
+export COMPILER_PATH = $(strip $(ARM_GCC_COMPILER_PATH))
+endif
+endif
+CROSS = arm-none-eabi
+endif
+
 # if Unisoc_8850 platform
-ifeq ($(PLAT),Unisoc_8850)
+ifeq ($(strip $(PLAT)), $(filter $(PLAT),Unisoc_8850 Unisoc_8850_R02))
 ifeq ($(HOST),win32)
 ifneq ($(strip $(ARM_GCC_COMPILER_PATH)),)
 export COMPILER_PATH = $(strip $(ARM_GCC_COMPILER_PATH))
@@ -119,6 +129,26 @@ endif
 CROSS = arm-none-eabi
 endif
 
+# if ASR_1602 platform
+ifeq ($(PLAT),ASR_1602)
+ifeq ($(HOST),win32)
+ifneq ($(strip $(ARM_GCC_COMPILER_PATH)),)
+export COMPILER_PATH = $(strip $(ARM_GCC_COMPILER_PATH))
+endif
+endif
+CROSS = arm-none-eabi
+endif
+
+# if ASR_1609 platform
+ifeq ($(PLAT),ASR_1609)
+ifeq ($(HOST),win32)
+ifneq ($(strip $(ARM_GCC_COMPILER_PATH)),)
+export COMPILER_PATH = $(strip $(ARM_GCC_COMPILER_PATH))
+endif
+endif
+CROSS = arm-none-eabi
+endif
+
 # if EIGEN platform
 ifeq ($(PLAT),EIGEN)
 ifeq ($(HOST),win32)
@@ -140,6 +170,26 @@ endif
 CROSS = nds32le-elf
 endif
 
+# if EIGEN_718 platform
+ifeq ($(PLAT),EIGEN_718)
+ifeq ($(HOST),win32)
+ifneq ($(strip $(ARM_GCC_COMPILER_PATH)),)
+export COMPILER_PATH = $(strip $(ARM_GCC_COMPILER_PATH))
+endif
+endif
+CROSS = arm-none-eabi
+endif
+
+# if aic8800 platform
+ifeq ($(PLAT),aic8800m40)
+ifeq ($(HOST),win32)
+ifneq ($(strip $(ARM_GCC_COMPILER_PATH_9)),)
+export COMPILER_PATH = $(strip $(ARM_GCC_COMPILER_PATH_9))
+endif
+endif
+CROSS = arm-none-eabi
+endif
+
 export COMPILER_BIN_PATH = $(COMPILER_PATH)/bin/
 
 ifneq ($(PLAT),Qualcomm)
@@ -152,6 +202,7 @@ export OBJCOPY = $(COMPILER_BIN_PATH)$(CROSS)-objcopy
 export SIZE = $(COMPILER_BIN_PATH)$(CROSS)-size
 export STRIP = $(COMPILER_BIN_PATH)$(CROSS)-strip
 export GDB = $(COMPILER_BIN_PATH)$(CROSS)-gdb
+export OBJDUMP = $(COMPILER_BIN_PATH)$(CROSS)-objdump
 else
 COMPILER_TOOLS_BIN_PATH = $(COMPILER_PATH)/tools/bin/
 export AS = $(COMPILER_BIN_PATH)$(CROSS)-as
@@ -269,7 +320,11 @@ export GLOBAL_INCS :=
 export GLOBAL_DEFINE :=
 
 ifeq ($(CFLAGS_USER),)
-CFLAGS_USER = -W -Wall -Werror -fno-strict-aliasing -ffunction-sections -fdata-sections -g -Os
+ifeq ($(PLAT),aic8800m40)
+       CFLAGS_USER = -W -Wall -fno-strict-aliasing -ffunction-sections -fdata-sections -g -Os
+else
+       CFLAGS_USER = -W -Wall -Werror -fno-strict-aliasing -ffunction-sections -fdata-sections -g -Os
+endif
 endif
 
 LDFLAGS_O = -Os
index 4cd1623..d245de5 100644 (file)
@@ -121,9 +121,8 @@ GLOBAL_INCS += \
 
 endif
 
-
-ifeq ($(CONFIG_AUDIO_MP3), y)
-
+_result := $(sort $(filter y,$(CONFIG_AUDIO_MP3) $(CONFIG_AUDIO_RECORD_MP3)))
+ifeq (y,$(_result))
 $(NAME)_SRCS +=    \
                        helios_audio_mp3.c \
                   mp3/mp3_dec/src/pvmp3_alias_reduction.cpp \
index c90d690..2b9f950 100644 (file)
@@ -50,10 +50,12 @@ cb_on_player aud_play_cb = NULL;
 static bool _audio_play_state = 0;
 
 
-#if (defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1803sc) || defined(BOARD_EC600MCN_CC_EXT) || defined(BOARD_EC600MCN_LF_SLPOC) \
-    ||defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8850_R02)|| defined(BOARD_EC600MCN_CC_EXT_TTS) || defined(BOARD_EC800MCN_CC_TTS) \
-    || defined(BOARD_EC800KCN_CC_TTS) || defined(BOARD_EC600KCN_CC_TTS) || defined(PLAT_ASR_1609) || defined(BOARD_EC800MCN_LF_CCG)) \
-       || defined(BOARD_EC600MCN_LF_SPISD)
+#if (defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1803sc) ||defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8850_R02) \
+       || defined(PLAT_ASR_1602)  || defined(PLAT_ASR_1609) \
+    || defined(BOARD_EC600MCN_CC_EXT_TTS) || defined(BOARD_EC800MCN_CC_TTS) \
+    || defined(BOARD_EC800MCN_LF_CCG)) || defined(BOARD_EC800MCN_LF) || defined(BOARD_EC800MCN_GD)\
+       || defined(BOARD_EC600MCN_CC_EXT) || defined(BOARD_EC600MCN_LF_SLPOC) \
+       || defined(BOARD_EC600MCN_LF_SPISD) || defined(BOARD_EC600MCN_LF)
 
 #define USR_HELIOS_AUDIO 1
 
diff --git a/2.sdk/Helios_SDK/components/audio/helios_audio_cfg_py.h b/2.sdk/Helios_SDK/components/audio/helios_audio_cfg_py.h
new file mode 100644 (file)
index 0000000..72bdff2
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __HELIOS_AUDIO_CFG_PY_H__
+#define __HELIOS_AUDIO_CFG_PY_H__
+
+#if CONFIG_AUDIO_RECORD_MP3
+       #ifndef CONFIG_AUDIO_MP3
+               #define CONFIG_ONLY_USE_RECORD_MP3  (1)
+       #endif
+#endif
+
+
+#endif
\ No newline at end of file
index fad2cdd..7b91b87 100644 (file)
@@ -22,10 +22,12 @@ static bool _audio_play_state = 0;
 static bool _mp3_stream_change_rate = false;
 
 
-#if (defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1803sc) || defined(BOARD_EC600MCN_CC_EXT) || defined(BOARD_EC600MCN_LF_SLPOC) \
-    ||defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8850_R02)|| defined(BOARD_EC600MCN_CC_EXT_TTS) || defined(BOARD_EC800MCN_CC_TTS) \
-    || defined(BOARD_EC800KCN_CC_TTS) || defined(BOARD_EC600KCN_CC_TTS) || defined(PLAT_ASR_1609) || defined(BOARD_EC800MCN_LF_CCG)) \
-       || defined(BOARD_EC600MCN_LF_SPISD)
+#if (defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1803sc) ||defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8850_R02) \
+       || defined(PLAT_ASR_1602)  || defined(PLAT_ASR_1609) \
+    || defined(BOARD_EC600MCN_CC_EXT_TTS) || defined(BOARD_EC800MCN_CC_TTS) \
+    || defined(BOARD_EC800MCN_LF_CCG)) || defined(BOARD_EC800MCN_LF) || defined(BOARD_EC800MCN_GD)\
+       || defined(BOARD_EC600MCN_CC_EXT) || defined(BOARD_EC600MCN_LF_SLPOC) \
+       || defined(BOARD_EC600MCN_LF_SPISD) || defined(BOARD_EC600MCN_LF)
 
 #define USR_HELIOS_AUDIO 1
 
@@ -44,7 +46,6 @@ typedef struct Helios_ring_buf_struct
 } Helios_ring_buf_t;
 
 Helios_ring_buf_t *Helios_ring_buf = NULL;
-Helios_ring_buf_t *pcm_ring_buf = NULL;
 
 static Helios_Mutex_t Helios_mp3_read_mutex = 0;
 static int open_flag = 1;
@@ -627,7 +628,7 @@ static int get_mp3_frame(void *buffer, uint32_t *size)
        memcpy(_header_buf_pre, buf, 4);
        return 0;
 }
-
+#ifndef CONFIG_ONLY_USE_RECORD_MP3
 int Helios_mp3_Clear_Cache()
 {
        if (0 != Helios_mp3_read_mutex)
@@ -647,7 +648,7 @@ int Helios_mp3_get_cache_size()
                Helios_Mutex_Unlock(Helios_mp3_read_mutex);
        return ret;
 }
-
+#endif
 #define Helios_PCM_TASK_CONTINUE (0x01)
 #define Helios_PCM_STOP (0x02)
 #define Helios_PCM_TASK_MASK (Helios_PCM_STOP | Helios_PCM_TASK_CONTINUE)
@@ -673,6 +674,8 @@ void Helios_wait(void)
 
 int Helios_play_stream_start(unsigned int rate, unsigned int ch, unsigned short *pcm_buf, unsigned int frameByteSize)
 {
+#ifndef CONFIG_ONLY_USE_RECORD_MP3
+
        int ret = 0;
        int _count = 100;
        static unsigned int rate_pre = 0; 
@@ -729,7 +732,7 @@ int Helios_play_stream_start(unsigned int rate, unsigned int ch, unsigned short
                return -1;
        }
        Helios_Flag_Release(dec_pcm_flag_Ref, Helios_PCM_TASK_CONTINUE, Helios_FLAG_OR);
-
+#endif
        return 0;
 }
 
@@ -763,7 +766,6 @@ int Helios_mp3_dec(void)
        int is_silence = 0;
        char is_mutex = 0;
        char _change_tmp = 1;
-       int pcm_frame_len = 320;
 
        buff = (unsigned char *)malloc(1024*2);
        Helios_pcm_outbuf = (unsigned short *)malloc(PCM_PINGPANG_BUF_LEN*2);
@@ -885,15 +887,6 @@ int Helios_mp3_dec(void)
                        __jump_cnt --;
                        continue;
                }
-               
-               // 使用ringbuffer 缓存,保证pcm底层数据发送是完整一帧(320 or 640 or other)
-               pcm_frame_len = mp3_sample_rate * sizeof(int16_t) * 20 / 1000;
-               Helios_rb_write(pcm_ring_buf, Helios_pcm_outbuf, length);
-               length = Helios_rb_data_space(pcm_ring_buf);
-               AUDLOGD("pcm_ring_buf data len:%d !!!\n", length);
-               length = length / pcm_frame_len * pcm_frame_len;
-               length = Helios_rb_read(pcm_ring_buf, Helios_pcm_outbuf, length);
-               AUDLOGD("Helios_rb_read len : %d\n", length);
 
                rc = Helios_play_stream_start(Helios_config.samplerate, Helios_config.channels, Helios_pcm_outbuf, length);
                
@@ -964,7 +957,6 @@ int Helios_mp3_dec(void)
        Helios_aud_stop_play_flag = 1;
        Helios_Mutex_Lock(Helios_mp3_read_mutex, HELIOS_WAIT_FOREVER);
        Helios_rb_init(Helios_ring_buf);
-       Helios_rb_init(pcm_ring_buf);
        Helios_Mutex_Unlock(Helios_mp3_read_mutex);
        return ret;
 }
@@ -1006,12 +998,6 @@ int Helios_mp3_stream_play(void)
                Helios_ring_buf = NULL;
        }
        Helios_Mutex_Unlock(Helios_mp3_read_mutex);
-
-       if (pcm_ring_buf)
-       {
-               free(pcm_ring_buf);
-               pcm_ring_buf = NULL;
-       }
        return 0;
 }
 
@@ -1082,16 +1068,7 @@ int Helios_play_mp3_stream_start(void *mp3_buff, int mp3_size)
                assert(Helios_ring_buf->rcond != 0);
        }
 
-       if (pcm_ring_buf == NULL) {
-               pcm_ring_buf = malloc(sizeof(Helios_ring_buf_t) + PCM_PINGPANG_BUF_LEN*4);
-               if (!pcm_ring_buf) {
-                       AUDLOGE("malloc pcm_ring_buf failed !!!\n");
-                       return -1;
-               }
-               Helios_rb_init(pcm_ring_buf);
-               pcm_ring_buf->capacity = PCM_PINGPANG_BUF_LEN*4;
-       }       
-
+       
        if (Helios_mp3_read_mutex == 0)
        {
                Helios_mp3_read_mutex = Helios_Mutex_Create();
@@ -1516,7 +1493,7 @@ int Helios_mp3_file_start(char *file_name, cb_on_player aud_cb)
 
 int Helios_mp3_file_stop()
 {
-       AUDLOGD("Helios_mp3_file_stop");
+       AUDLOGD("Helios_mp3_file_stop\n");
 
        int count = 0;
 #if defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1803sc)
@@ -1544,9 +1521,12 @@ int Helios_mp3_file_stop()
                Helios_msleep(15);
                count++;
        }
+#ifndef CONFIG_ONLY_USE_RECORD_MP3
 #ifdef USR_HELIOS_AUDIO
        Helios_mp3_Clear_Cache();
 #endif
+#endif
+
        AUDLOGD("mp3Stop finish");
        return 0;
 }
@@ -1556,11 +1536,11 @@ int helios_mp3_set_callback(cb_on_player aud_cb)
        aud_play_cb = aud_cb;
        return 0;
 }
-
+#ifndef CONFIG_ONLY_USE_RECORD_MP3
 void Helios_mp3_stream_close_flag(unsigned char value) {
        STREAM_IsNot_SwitchOff_Actively = value;
 }
-
+#endif
 
 
 struct mp3_file_list {
index be048c7..bc93f87 100644 (file)
@@ -143,7 +143,7 @@ int Helios_Audio_StreamPlayStart(Helios_AudStreamFormat format, const void *buf,
                                return(-1);
                        }
                        helios_stream_init_flag = HELIOS_INITED;
-                       // ²¥·ÅÒôÆµÊ±Ìø¹ýtagÊý¾Ý
+                       // 播放音频时跳过tag数据
                        total_cnt += sizeof(HELIOS_WAV_TAG);
 #if defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR_1602)
                        Helios_PCM_Play_Cb(write_hdl, __pcm_play_cb);
index 9a03526..09ac078 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __HELIOS_PY_AUDIO_H__
 #define __HELIOS_PY_AUDIO_H__
 
+#include "helios_audio_cfg_py.h"
+
 typedef int QuecOSStatus;
 typedef unsigned char OSA_STATUS;
 
@@ -15,7 +17,6 @@ typedef unsigned int size_t;
 #endif
 
 
-
 /**
  * AUDIO PLAY TYPE
  */
@@ -121,8 +122,9 @@ typedef void (*helios_audio_pa_cb_t)(unsigned int event);
 
 typedef void(*helios_cb_pcm_play)(void*, int);
 
-
+#if !defined(BOARD_EC600MCN_LE)
 void *Helios_PCM_Open(unsigned int channels, unsigned int samplerate, unsigned int flags);
+#endif
 int Helios_PCM_Close(void *handle);
 int Helios_PCM_Write(void *handle, void *data, unsigned int count);
 int Helios_PCM_Read(void *handle, void *data, unsigned int count);
index b1865bf..a61d092 100644 (file)
Binary files a/2.sdk/Helios_SDK/components/poc/bnd_xin/lib/broad.lib and b/2.sdk/Helios_SDK/components/poc/bnd_xin/lib/broad.lib differ
index d515cd8..3e1eb49 100644 (file)
@@ -150,6 +150,7 @@ static const poc_ops_t poc_ops = {
     .change_logininfo = broad_change_logininfo,
     .get_logininfo = broad_get_logininfo,
     .set_terminal_info = broad_set_terminal_info,
+    .register_sos_switch_cb = broad_register_sos_switch_cb,
     
        #endif
 };
index e76eb65..3e22f51 100644 (file)
@@ -220,6 +220,7 @@ typedef struct {
     int (*change_logininfo)(const char* account,const char* pwd);
     int (*get_logininfo)(char* account, char* pwd);
        int (*set_terminal_info)(int battery_level, int signal_level);
+       void (*register_sos_switch_cb)(sos_switch_cb cb);
 
     #endif
 #else
index 24b850d..073ec69 100644 (file)
@@ -386,6 +386,9 @@ STATIC mp_obj_t qpy_poc_joingroup(mp_obj_t args)
        
        poc_ops_t *poc_ops = poc_get_ops();
     int ret = -1;
+    if (poc_ops->get_loginstate() != 1) {
+        return mp_obj_new_int(-1);
+    }
     unsigned int gid = mp_obj_get_int(args);
     MP_THREAD_GIL_EXIT();
     ret = poc_ops->joingroup(gid);
@@ -398,6 +401,9 @@ STATIC mp_obj_t qpy_poc_leavegroup()
 {
        poc_ops_t *poc_ops = poc_get_ops();
     int ret = 0;
+    if (poc_ops->get_loginstate() != 1) {
+        return mp_obj_new_int(-1);
+    }
     MP_THREAD_GIL_EXIT();
     ret = poc_ops->leavegroup();
     MP_THREAD_GIL_ENTER();
index 7cb99e9..9e035d2 100644 (file)
@@ -4,46 +4,42 @@
  * Helios SDK Configuration
  *
  */
-
-
-#define PROJECT_NAME_G3_7PIN  1  //项目宏定义
-
-
-// #define CONFIG_LVGL_SPAN 1
-// #define CONFIG_LVGL_FS_HELIOS 1
-// #define CONFIG_LVGL_GIF_DECODE 1
-// #define CONFIG_LVGL_SPINNER 1
-//#define CONFIG_LCD 1
-// #define CONFIG_LVGL_ANIMIMG 1
-// #define CONFIG_LVGL_KEYBOARD 1
-// #define CONFIG_LVGL_CALENDAR 1
-// #define CONFIG_LVGL_LED 1
+#define PROJECT_NAME_C3_W8  1
+#define CONFIG_LVGL_SPAN 1
+#define CONFIG_LVGL_FS_HELIOS 1
+#define CONFIG_LVGL_GIF_DECODE 1
+#define CONFIG_LVGL_SPINNER 1
+#define CONFIG_LCD 1
+#define CONFIG_LVGL_ANIMIMG 1
+#define CONFIG_LVGL_KEYBOARD 1
+#define CONFIG_LVGL_CALENDAR 1
+#define CONFIG_LVGL_LED 1
 #define CONFIG_VIOCE_CALL 1
-// #define CONFIG_LVGL_FS_EXTFLASH_HELIOS 1
-// #define CONFIG_LVGL_TABVIEW 1
-//#define CONFIG_LVGL_LINE 1
-//#define CONFIG_LVGL 1
-// #define CONFIG_LVGL_CHART 1
-// #define CONFIG_LVGL_LIST 1
-// #define CONFIG_LVGL_MSGBOX 1
-// #define CONFIG_LVGL_ARC 1
-// #define CONFIG_LVGL_METER 1
-//#define CONFIG_LVGL_JPG_DECODE 1
-// #define CONFIG_LVGL_PNG_DECODE 1
-// #define CONFIG_LVGL_IMGBTN 1
+#define CONFIG_LVGL_FS_EXTFLASH_HELIOS 1
+#define CONFIG_LVGL_TABVIEW 1
+#define CONFIG_LVGL_LINE 1
+#define CONFIG_LVGL 1
+#define CONFIG_LVGL_CHART 1
+#define CONFIG_LVGL_LIST 1
+#define CONFIG_LVGL_MSGBOX 1
+#define CONFIG_LVGL_ARC 1
+#define CONFIG_LVGL_METER 1
+#define CONFIG_LVGL_JPG_DECODE 1
+#define CONFIG_LVGL_PNG_DECODE 1
+#define CONFIG_LVGL_IMGBTN 1
 //#define CONFIG_GH301x 1
-//#define CONFIG_HX3918 1
+#define CONFIG_HX3918 1
 #define CONFIG_MBEDTLS 1
-//#define CONFIG_SC7A20 1
-// #define CONFIG_LVGL_WIN 1
-// #define CONFIG_LVGL_COLORWHEEL 1
-// #define CONFIG_LVGL_CANVAS 1
-// #define CONFIG_LVGL_SPINBOX 1
-// #define CONFIG_LVGL_QRCODE 1
-// #define CONFIG_LVGL_TILEVIEW 1
-// #define CONFIG_LVGL_HANDLER_TASK_PRIORITY 80
-//#define CONFIG_CAMERA 1
-//#define CONFIG_JPEG 1
+#define CONFIG_SC7A20 1
+#define CONFIG_LVGL_WIN 1
+#define CONFIG_LVGL_COLORWHEEL 1
+#define CONFIG_LVGL_CANVAS 1
+#define CONFIG_LVGL_SPINBOX 1
+#define CONFIG_LVGL_QRCODE 1
+#define CONFIG_LVGL_TILEVIEW 1
+#define CONFIG_LVGL_HANDLER_TASK_PRIORITY 80
+#define CONFIG_CAMERA 1
+#define CONFIG_JPEG 1
 #define CONFIG_CAMERA_SAVEPHOTOS 1
 //菊风视频通话
-//#define CONFIG_juphoon 1
+#define CONFIG_juphoon 1
\ No newline at end of file
index 343bad7..862820b 100644 (file)
@@ -5,10 +5,11 @@ menu "System Configuration"
 source "../system/config.in"
 endmenu
 
-menu "EG810MCN_GA_VOLTE"
+menu "EG810MCN_GA_ALIPAY"
 source "../services/microPython/config/config.in"
 source "../components/poc/poc_option.in"
 source "../components/GH301x/GH301x_option.in"
+source "../components/HX3918/HX3918_option.in"
 source "../components/SC7A20/SC7A20_option.in"
 source "../components/juphoon/juphoon_option.in"
 endmenu
index 51c8722..b381c3b 100644 (file)
@@ -2,65 +2,65 @@
 # Automatically generated file; DO NOT EDIT.
 # Helios SDK Configuration
 #
-PROJECT_NAME_G3_7PIN=y
+PROJECT_NAME_C3_W8=y
 #
 # System Configuration
 #
 CONFIG_MBEDTLS=y
 
 #
-# EG810MCN_GA_VOLTE
+# EG810MCN_GA_ALIPAY
 #
-# CONFIG_LVGL=y
+CONFIG_LVGL=y
 
 #
 # lvgl option
 #
-# CONFIG_LVGL_PNG_DECODE=y
-# CONFIG_LVGL_GIF_DECODE is not set
-# CONFIG_LVGL_JPG_DECODE=y
-#CONFIG_LVGL_FS_HELIOS=y
+CONFIG_LVGL_PNG_DECODE=y
+CONFIG_LVGL_GIF_DECODE=y
+CONFIG_LVGL_JPG_DECODE=y
+CONFIG_LVGL_FS_HELIOS=y
 # CONFIG_LVGL_FS_SD_HELIOS is not set
-# CONFIG_LVGL_FS_EXTFLASH_HELIOS=y
+CONFIG_LVGL_FS_EXTFLASH_HELIOS=y
 # CONFIG_LVGL_CUSTOMER_FONT_SUPPORT is not set
-# CONFIG_LVGL_QRCODE=y
+CONFIG_LVGL_QRCODE=y
 # CONFIG_LVGL_FONT is not set
 # CONFIG_LVGL_ARC is not set
-#CONFIG_LVGL_IMGBTN=y
-#CONFIG_LVGL_LINE=y
-#CONFIG_LVGL_LIST=y
+CONFIG_LVGL_IMGBTN=y
+CONFIG_LVGL_LINE=y
+CONFIG_LVGL_LIST=y
 # CONFIG_LVGL_CHART is not set
 # CONFIG_LVGL_LED is not set
-# CONFIG_LVGL_CANVAS=y
-# CONFIG_LVGL_WIN=y
+CONFIG_LVGL_CANVAS=y
+CONFIG_LVGL_WIN=y
 # CONFIG_LVGL_TABVIEW is not set
-# CONFIG_LVGL_TILEVIEW=y
-# CONFIG_LVGL_MSGBOX=y
+CONFIG_LVGL_TILEVIEW=y
+CONFIG_LVGL_MSGBOX=y
 # CONFIG_LVGL_METER is not set
 # CONFIG_LVGL_CALENDAR is not set
 # CONFIG_LVGL_SPINNER is not set
 # CONFIG_LVGL_SPINBOX is not set
 # CONFIG_LVGL_ANIMIMG is not set
 # CONFIG_LVGL_COLORWHEEL is not set
-# CONFIG_LVGL_KEYBOARD=y
-# CONFIG_LVGL_SPAN=y
-# CONFIG_LVGL_HANDLER_TASK_PRIORITY=80
+CONFIG_LVGL_KEYBOARD=y
+CONFIG_LVGL_SPAN=y
+CONFIG_LVGL_HANDLER_TASK_PRIORITY=80
 # CONFIG_QRCODE is not set
-#CONFIG_CAMERA=y
+CONFIG_CAMERA=y
 # CONFIG_CAMERA_DECODE is not set
 CONFIG_CAMERA_SAVEPHOTOS=y
 # CONFIG_QUECTHING is not set
 # CONFIG_SPINAND is not set
 # CONFIG_RTMP is not set
-#CONFIG_JPEG=y
+CONFIG_JPEG=y
 # CONFIG_SPI_SDCARD is not set
 CONFIG_VIOCE_CALL=y
 # CONFIG_TTS is not set
-#CONFIG_LCD=y
+CONFIG_LCD=y
 # CONFIG_UART_SLIP is not set
 # CONFIG_POC is not set
 #CONFIG_GH301x=y
-#CONFIG_HX3918=y
-#CONFIG_SC7A20=y
-
-#CONFIG_juphoon=y
+CONFIG_HX3918=y
+CONFIG_SC7A20=y
+#菊风视频通话
+CONFIG_juphoon=y
\ No newline at end of file
index ad5bab7..37b8a36 100644 (file)
@@ -812,9 +812,11 @@ int QPY_SPILCD_Init(Helios_LCDInitStruct *init_data, QPY_LCDSPI_INFO spi_info)
 
     HeliosFILE *fp_e = Helios_fopen("E:/logo.bin","r");
        HeliosFILE *fp = Helios_fopen("U:/logo.bin","r");
-
-       if((fp_e == NULL && fp == NULL) || init_data->init_flag) //增加是否强制初始化的判断
-
+#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06)
+    if(fp == NULL) //展锐只要有外挂flash就会读取到logo.bin,此处做规避
+#else
+    if((fp_e == NULL && fp == NULL) || init_data->init_flag) //增加是否强制初始化的判断
+#endif
        {  
         Helios_msleep(5);
         Helios_GPIO_SetLevel(QPY_LCDStruct.spiInfo.RSTPin, HELIOS_LVL_LOW);
index 3f2d0a6..9ad2bcf 100644 (file)
@@ -40,7 +40,7 @@ ifeq ($(strip $(PLAT)),ECR6600)
        $(COMP_ARCHIVES) $(USER_ARCHIVES) -Wl,--no-whole-archive $(STD_LIBS) \
        -o $@ $(LDFLAGS)
 else
-       $(Q)$(LD) --whole-archive \
+       $(LD) --whole-archive \
        $(COMP_ARCHIVES) $(USER_ARCHIVES) --no-whole-archive $(STD_LIBS) \
        -o $@ $(LDFLAGS)
 endif
index 29669d0..021ed6e 100644 (file)
@@ -143,6 +143,7 @@ def make_proc():
     got_seq_params = False
     got_fw_name = False
     got_qpyver = False
+    sdk_ver_update = False
     app_entry = argv[3].replace('\\', '/')
 
     app_entry_chr_list = list(app_entry)
@@ -241,6 +242,8 @@ def make_proc():
                             else:
                                 cmd_str = cmd_str + ' ' + i
                                 got_qpyver = True
+                        elif i.startswith('UPD'):
+                            sdk_ver_update = True
                         else:
                             error_proc(i)
                             return
@@ -254,9 +257,10 @@ def make_proc():
                     got_fw_name = True
                     
     if got_fw_name:
-        version_content='#ifndef __QUECTEL_VERSION_H__\n#define __QUECTEL_VERSION_H__\n\n' + 'char mob_sw_rev[] = \"' + arg + '\";' + '\n\n#endif'
-        with open(abs_path + '\\system\\include\\quectel_version.h', 'w+') as f:
-            f.write(version_content)
+        if sdk_ver_update:
+            version_content='#ifndef __QUECTEL_VERSION_H__\n#define __QUECTEL_VERSION_H__\n\n' + 'const char mob_sw_rev[] = \"' + arg + '\";' + '\n\n#endif'
+            with open(abs_path + '\\system\\include\\quectel_version.h', 'w+') as f:
+                f.write(version_content)
         
     cmd_str = cmd_str + host_spec
     cmd_str = cmd_str + ' PY=' + argv[1]
index aa9d1e3..6b26a7a 100644 (file)
@@ -49,6 +49,7 @@ WHEN          WHO                     WHAT,WHERE,WHY
 #define HELIOS_MAC_LEN      6
 
 #define MAX_DEVICES 10
+#define MAX_BLACKMACNUM 16
 
 /* Definitions for error constants. */
 #define HELIOS_WLAN_5803W_OK            0     /*!< HELIOS 5803W value indicating success (no error) */
@@ -83,6 +84,10 @@ typedef enum
        HELIOS_5803W_2_4G_B,
        HELIOS_5803W_2_4G_B_G,  
        HELIOS_5803W_2_4G_B_G_N,
+#ifdef MICROPY_QPY_NETWORK_WLAN_962K
+       HELIOS_WIFI_5_0G_A_C, //5
+       HELIOS_WIFI_5_0G_A_X, //6
+#endif
 }Helios_WLAN_5803W_CHANNEL_MODE_TYPE;
 
 typedef struct 
@@ -97,6 +102,11 @@ typedef struct
        char   ssid[HELIOS_MAX_SSID+1];    //AP 
        char   pass[HELIOS_MAX_PASSWORD+1]; //AP
        char   mac[HELIOS_MAC_LEN+1];
+#if MICROPY_QPY_NETWORK_WLAN_962K
+       int        maxConnNum;
+       int        blackNum;
+       uint8_t  blacklist[MAX_BLACKMACNUM][HELIOS_MAC_LEN+1];
+#endif
 }Helios_WLAN_5803W_CFG   ;
 
 
@@ -198,6 +208,58 @@ int Helios_WLAN_5803W_AP_SetAllCfg(Helios_WLAN_5803W_CFG *wifi_cfg);
 
 int Helios_WLAN_5803W_SetDefaultNetworkCard(char *ip);
 
+#if MICROPY_QPY_NETWORK_WLAN_962K
+typedef enum 
+{
+       Helios_WLAN_AUTO_CHAN      = 0,
+       Helios_WLAN_2_4_G_CHAN_6   = 6,
+       Helios_WLAN_2_4_G_CHAN_7   = 7,
+       Helios_WLAN_2_4_G_CHAN_8   = 8,
+       Helios_WLAN_2_4_G_CHAN_9   = 9,
+       Helios_WLAN_2_4_G_CHAN_10  = 10,
+       Helios_WLAN_2_4_G_CHAN_11  = 11,
+       Helios_WLAN_5_0_G_CHAN_36  = 36,
+       Helios_WLAN_5_0_G_CHAN_40  = 40,
+       Helios_WLAN_5_0_G_CHAN_44  = 44,
+       Helios_WLAN_5_0_G_CHAN_48  = 48,
+       Helios_WLAN_5_0_G_CHAN_52  = 52,
+       Helios_WLAN_5_0_G_CHAN_56  = 56,
+       Helios_WLAN_5_0_G_CHAN_60  = 60,
+       Helios_WLAN_5_0_G_CHAN_64  = 64,
+       Helios_WLAN_5_0_G_CHAN_149 = 149,
+       Helios_WLAN_5_0_G_CHAN_153 = 153,
+       Helios_WLAN_5_0_G_CHAN_157 = 157,
+       Helios_WLAN_5_0_G_CHAN_161 = 161,
+       Helios_WLAN_5_0_G_CHAN_165 = 165,
+}Helios_WLAN_962K_CHANNEL_TYPE;
+
+#define CHECK_CHANNEL_VALUE(a) \
+    ((a) == Helios_WLAN_AUTO_CHAN || \
+     (a) == Helios_WLAN_2_4_G_CHAN_6 || \
+     (a) == Helios_WLAN_2_4_G_CHAN_7 || \
+     (a) == Helios_WLAN_2_4_G_CHAN_8 || \
+     (a) == Helios_WLAN_2_4_G_CHAN_9 || \
+     (a) == Helios_WLAN_2_4_G_CHAN_10 || \
+     (a) == Helios_WLAN_2_4_G_CHAN_11 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_36 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_40 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_44 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_48 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_52 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_56 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_60 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_64 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_149 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_153 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_157 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_161 || \
+     (a) == Helios_WLAN_5_0_G_CHAN_165 ? 0 : -1)
+
+int Helios_WLAN_5803W_GetMaxStaNum(void);
+
+int Helios_WLAN_5803W_GetBlackList(uint8_t mac_list[MAX_BLACKMACNUM][HELIOS_MAC_LEN+1], int *len);
+#endif
+
 #if 0
 
 int Helios_WLAN_5803W_AP_SetAuth(uint8_t auth);
index 298a314..48bfb66 100644 (file)
@@ -28,7 +28,7 @@ ifeq ($(CONFIG_CAMERA), y)
 USE_NANO_LIB = y
 endif
 
-ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),EC800GCN_LD EC600UCN_LB EC800GCN_TT EG800GLA_LD))
+ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),EC800GCN_LD EC600UCN_LB EC800GCN_TT EG800GLA_LD EG800GEU_LD))
 # $(info USE nano lib)
 USE_NANO_LIB = y
 endif
@@ -184,9 +184,11 @@ CFLAGS_PLAT =      -c -MMD -mcpu=cortex-r5 -mfloat-abi=soft \
                                
 DFLAGS_PLAT = _SYS_SELECT_H \
             __HELIOS_OS__ \
-            ENABLE_TRACE
+            ENABLE_TRACE \
+            _UNIX98_THREAD_MUTEX_ATTRIBUTES \
+                       _POSIX_THREADS
 
-STD_LIBS = $(COMPILER_PATH)/$(CROSS)/lib/thumb/v7/nofp/libc_nano.a \
+STD_LIBS = $(COMPILER_PATH)/$(CROSS)/lib/thumb/v7/nofp/libc.a \
                  $(COMPILER_PATH)/$(CROSS)/lib/libstdc++.a \
                  $(COMPILER_PATH)/$(CROSS)/lib/libg.a
 
index 67e336e..a496cac 100644 (file)
 #include "helios.h"
 #include "helios_debug.h"
 #include "helios_os.h"
+#include "helios_ai.h"
 
 #define app_debug(fmt, ...) custom_log(APP, fmt, ##__VA_ARGS__)
 
 static void AppSample(void *argv)
 {
     UNUSED(argv);
-
+       helios_ai_init(NULL, 0);
     while (1)
     {
         app_debug("app sample running ...\r\n");
@@ -31,4 +32,4 @@ static void AppSample(void *argv)
     }
 }
 
-application_init(AppSample, "AppSample", 2, 0);
+application_init(AppSample, "AppSample", 2, 10);
index 0518829..5dbc93f 100644 (file)
@@ -119,6 +119,12 @@ config USQLITE
 help 
     This is usqlite support.
 
+config LIBSSH2
+    bool "Enable libssh2" 
+    default n
+help 
+    This is libssh2 support.
+
 config JRTC
     bool "Enable jrtc" 
     default n
@@ -154,3 +160,15 @@ menu "SENSOR option"
 
     source "../services/microPython/config/sensor_option.in"
     endmenu
+
+config MICROPYTHON_EXTENSION
+    bool "Enable MicroPython extension‌ function" 
+    default n
+help 
+    This is micropython related optimization and debugging.'
+
+menu "MICROPYTHON_EXTENSION option"
+       depends on MICROPYTHON_EXTENSION
+
+       source "../services/microPython/config/micropython_extension_option.in"
+       endmenu
index b0fe6a0..549bc30 100644 (file)
@@ -158,8 +158,8 @@ STATIC void MP_VFS_LFSx(init_config)(MP_OBJ_VFS_LFSx * self, mp_obj_t bdev, size
 #endif
     uint32_t FlashPartiAddr = FlashPartiCtx->addr;
     size_t FlashPartiSize = FlashPartiCtx->size;
-    QUEC_QPY_LFS_LOG("addr:%x", FlashPartiAddr);
-    QUEC_QPY_LFS_LOG("size:%x", FlashPartiSize);
+    QUEC_QPY_LFS_LOG("addr:%x\r\n", FlashPartiAddr);
+    QUEC_QPY_LFS_LOG("size:%x\r\n", FlashPartiSize);
        self->info.LfsStartAddress = (FlashPartiAddr) / LFS_BLOCK_SIZE * LFS_BLOCK_SIZE;
 #if defined (QUECTEL_PY_LFS2)
     self->info.LfsEndAddress = ((FlashPartiAddr + FlashPartiSize) / LFS_BLOCK_SIZE) * LFS_BLOCK_SIZE;//lfs2block需要和物理空间完全对齐,否则镜像无法挂载
@@ -182,7 +182,7 @@ STATIC void MP_VFS_LFSx(init_config)(MP_OBJ_VFS_LFSx * self, mp_obj_t bdev, size
        config->block_count = bc;
 #endif
 
-#if !defined(PLAT_ASR) && !defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR_1602)
+#if !defined(PLAT_ASR) && !defined(PLAT_ASR_1606) && !defined(PLAT_ASR_1609) && !defined(PLAT_ASR_1602)
     #if LFS_BUILD_VERSION == 1
 #ifdef QUECTEL_PY_LFS1
        config->lookahead = 32 * ((config->block_count + 31) / 32);
@@ -246,7 +246,8 @@ STATIC mp_obj_t MP_VFS_LFSx(make_new)(const mp_obj_type_t * type, size_t n_args,
 #endif
 
 #if defined (QUECTEL_PY_LFS1) || defined (QUECTEL_PY_LFS2)
-#if defined(PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR_1602) || defined(PLAT_aic8800m40)
+#if defined(PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR_1602) || defined(PLAT_aic8800m40)\
+ || defined(PLAT_ASR_1803s)
        if(strcmp(src_data, "ext_fs") == 0) {
                //QUEC_QPY_LFS_LOG("ext fs spi port[%d], clk[%d]\n", args[LFS_MAKE_ARG_spi_port].u_int, args[LFS_MAKE_ARG_spi_clk].u_int);
                if(0 != Helios_EXTFS_Init(args[LFS_MAKE_ARG_spi_port].u_int, args[LFS_MAKE_ARG_spi_clk].u_int)) {
index 23802c9..b7aebdf 100644 (file)
@@ -120,7 +120,7 @@ STATIC mp_obj_t vfs_temp_make_new(const mp_obj_type_t *type, size_t n_args, size
        }
     else if(strcmp(partition_name, "sd_fs") == 0)
     {
-#if    defined(BOARD_EC800GCN_LD) || defined(BOARD_EC800GCN_TT) || defined(BOARD_EG800GLA_LD)
+#if    defined(BOARD_EC800GCN_LD) || defined(BOARD_EC800GCN_TT) || defined(BOARD_EG800GLA_LD) || defined(BOARD_EG800GEU_LD)
                mp_raise_ValueError("Not support.");
 #else
         uint8_t ret =0;
@@ -135,7 +135,7 @@ STATIC mp_obj_t vfs_temp_make_new(const mp_obj_type_t *type, size_t n_args, size
     return MP_OBJ_FROM_PTR(vfs);
 }
 
-#if    !(defined(BOARD_EC800GCN_LD) || defined(BOARD_EC800GCN_TT) || defined(BOARD_EG800GLA_LD))
+#if    !(defined(BOARD_EC800GCN_LD) || defined(BOARD_EC800GCN_TT) || defined(BOARD_EG800GLA_LD) || defined(BOARD_EG800GEU_LD))
 STATIC mp_obj_t vfs_temp_sd_set_det(mp_obj_t self_in,mp_obj_t gpio_n,mp_obj_t mode) 
 {
     mp_obj_vfs_temp_t *self = MP_OBJ_TO_PTR(self_in);
@@ -591,7 +591,7 @@ STATIC mp_obj_t vfs_temp_statvfs(mp_obj_t self_in, mp_obj_t path_in) {
 STATIC MP_DEFINE_CONST_FUN_OBJ_2(vfs_temp_statvfs_obj, vfs_temp_statvfs);
 
 STATIC const mp_rom_map_elem_t vfs_temp_locals_dict_table[] = {
-#if    !(defined(BOARD_EC800GCN_LD) || defined(BOARD_EC800GCN_TT) || defined(BOARD_EG800GLA_LD))
+#if    !(defined(BOARD_EC800GCN_LD) || defined(BOARD_EC800GCN_TT) || defined(BOARD_EG800GLA_LD) || defined(BOARD_EG800GEU_LD))
     { MP_ROM_QSTR(MP_QSTR_mount), MP_ROM_PTR(&vfs_temp_mount_obj) },
     { MP_ROM_QSTR(MP_QSTR_umount), MP_ROM_PTR(&vfs_temp_umount_obj) },
 #endif
@@ -606,7 +606,7 @@ STATIC const mp_rom_map_elem_t vfs_temp_locals_dict_table[] = {
     { MP_ROM_QSTR(MP_QSTR_rmdir), MP_ROM_PTR(&vfs_temp_rmdir_obj) },
     { MP_ROM_QSTR(MP_QSTR_stat), MP_ROM_PTR(&vfs_temp_stat_obj) },
     { MP_ROM_QSTR(MP_QSTR_statvfs), MP_ROM_PTR(&vfs_temp_statvfs_obj) },
-#if    !(defined(BOARD_EC800GCN_LD) || defined(BOARD_EC800GCN_TT) || defined(BOARD_EG800GLA_LD))
+#if    !(defined(BOARD_EC800GCN_LD) || defined(BOARD_EC800GCN_TT) || defined(BOARD_EG800GLA_LD) || defined(BOARD_EG800GEU_LD))
     { MP_ROM_QSTR(MP_QSTR_set_callback), MP_ROM_PTR(&vfs_temp_sd_set_callback_obj) },
     { MP_ROM_QSTR(MP_QSTR_set_det), MP_ROM_PTR(&vfs_temp_sd_set_det_obj) },
 #endif
index 5a4a52b..0578ed3 100644 (file)
@@ -272,6 +272,7 @@ QPY_SRCS = \
         ports/quectel/core/source/modVideoCall.c \
         ports/quectel/core/source/modVideoCall_juphoon.c \
         ports/quectel/core/source/modrsa.c \
+        ports/quectel/core/source/modsftp.c \
         ports/quectel/core/source/utils_crc32.c \
         ports/quectel/core/source/modwebserver.c \
         ports/quectel/core/source/http_parser.c \
@@ -282,6 +283,7 @@ QPY_SRCS = \
         ports/quectel/core/source/modG722.c \
         ports/quectel/core/source/modcan_mcp2515.c \
         ports/quectel/core/source/modextuart_wk2114.c \
+        ports/quectel/core/source/modgpio_encoder.c \
         ports/quectel/core/source/modextgpio_aw9523.c \
         ports/quectel/core/source/modalipay.c \
         ports/quectel/core/source/machine_key.c \
@@ -303,7 +305,9 @@ QPY_SRCS = \
         ports/quectel/core/source/modvoip.c \
         ports/quectel/core/source/modipsec.c \
         ports/quectel/core/source/modecdsa.c \
-        ports/quectel/core/source/modecdh.c
+        ports/quectel/core/source/modecdh.c \
+        ports/quectel/core/source/moddlms.c    \
+        ports/quectel/core/source/modai_rtc.c
         
 ifeq ($(CONFIG_QUECTHING), y)
 ifeq ($(strip $(PLAT)),RDA)
@@ -798,6 +802,13 @@ endif
 ifeq ($(CONFIG_juphoon), y)
 $(NAME)_COMPONENTS += components/juphoon
 endif
+
+ifeq ($(CONFIG_LIBSSH2), y)
+$(NAME)_INCS += ../../components/ssh2/include \
+                ../../components/ssh2/src
+$(NAME)_COMPONENTS += components/ssh2
+endif
+
 ifeq ($(CONFIG_QUECTHING), y)
 $(NAME)_INCS += ../../components/quecsdk
 $(NAME)_COMPONENTS += components/quecsdk
@@ -836,6 +847,20 @@ $(NAME)_COMPONENTS += components/slip
 $(NAME)_INCS += ../../components/slip
 endif
 
+ifeq ($(CONFIG_DLMS), y)
+$(NAME)_COMPONENTS += components/dlms
+endif
+
+ifeq ($(CONFIG_MICROPYTHON_EXTENSION_PERF), y)
+$(NAME)_COMPONENTS += components/micropython_extension
+$(NAME)_INCS += ../../components/micropython_extension/perf
+endif
+
+ifeq ($(CONFIG_MICROPYTHON_EXTENSION_SECURE_APP), y)
+$(NAME)_COMPONENTS += components/micropython_extension
+$(NAME)_INCS += ../../components/micropython_extension/secure_app
+endif
+
 $(NAME)_CFLAGS += -Wno-error=implicit-fallthrough
 
 $(NAME)_PRIVATE_SCRIPT = private.mk
index cd31639..7e932af 100644 (file)
@@ -31,6 +31,8 @@ class motorEventManager(Abstract):#马达事件
         self.motor_mode = 0#模式
         _thread.start_new_thread(self.motorInfo_queue_thread, ())
         EventMesh.subscribe("publish_message_event_motorInfo",self.publish_message_event_motorInfo)
+        EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数
+        EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器
         pass
 
     def motorInfo_queue_thread(self):
@@ -50,15 +52,14 @@ class motorEventManager(Abstract):#马达事件
         EventMesh.publish("publish_message_event_motorInfo",{"func":self.motor_fun_cb,"data":0})  
         
     def post_processor_after_instantiation(self):
-        EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数
-        EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器
+        pass
 
     # msg 0马达使能 1 马达振动时间100ms单位 2 震动次数 3 间隔时间振动 4 是否需要长振 5 长振时间  6间隔时间长振 7长振次数1一次 要为200ms的倍数
     def set_motor_time(self,event,msg):
-        open_power = EventMesh.publish("get_power_on_state")#获取开机标识
-        if open_power != None:
-            if open_power == 0:
-                return
+        # open_power = EventMesh.publish("get_power_on_state")#获取开机标识
+        # if open_power != None:
+        #     if open_power == 0:
+        #         return
         if msg != None:
             self.motor_enable = msg[0]
             if self.motor_enable == 1: #马达使能
@@ -78,6 +79,7 @@ class motorEventManager(Abstract):#马达事件
             EventMesh.publish("close_motor_infor")#关闭马达和定时器
             return
         if self.motor_mode == 1:#
+            
             if self.motor_total_time > 0:
                 self.motor_total_time-=1
                 if self.motor_total_time > 0:
@@ -87,8 +89,10 @@ class motorEventManager(Abstract):#马达事件
                     EventMesh.publish("close_motor_infor")#关闭马达和定时器
                     return
         elif self.motor_mode == 2:#
+            # print("motor_fun_cb:{}\r\n".format(self.motor_total_time))
             # print("self.motor_count",self.motor_count,self.motor_open_time,self.motor_close_time,self.motor_total_time)
             if self.motor_count % (self.motor_open_time) < self.motor_close_time: # 4 4 2 1%4 = 1 2%4 = 2 3%4 = 3
+                # print("motor_fun_cb MORETO:{}\r\n".format(self.motor_total_time))
                 open_motor()
             else:
                 close_motor()
@@ -99,6 +103,8 @@ class motorEventManager(Abstract):#马达事件
 
     def close_motor_infor(self,event,msg):
         print("close_motor_infor!!!")
+        if self.motor_enable == 0:#未使能马达定时器
+            return
         close_motor()
         self.motor_enable = 0#马达使能
         self.motor_total_time = 0#总的时间
index 91df07d..0c5ea5e 100644 (file)
@@ -1178,7 +1178,7 @@ STATIC mp_obj_t helios_play_file_stop_all(mp_obj_t self_in)
        audio.cur_priority = 0;
        audio.cur_breakin  = 0;
        audio.total_nums = 0;
-       //audio.audio_state = AUDIO_IDLE;
+       
        Helios_Mutex_Unlock(audio.queue_mutex);
        if(audio.cur_type == AUDIO_MONTAGE || audio.cur_type == AUDIO_STREAM)
        {
@@ -1188,6 +1188,7 @@ STATIC mp_obj_t helios_play_file_stop_all(mp_obj_t self_in)
        {
                ret = Helios_Audio_FilePlayStop();
        }
+       audio.audio_state = AUDIO_IDLE;
        return mp_obj_new_int(ret);
 }
 STATIC MP_DEFINE_CONST_FUN_OBJ_1(helios_play_file_stop_all_obj, helios_play_file_stop_all);
@@ -1998,6 +1999,7 @@ static mp_obj_t helios_play_montage_file_start(size_t n_args, const mp_obj_t *ar
 
        
     Helios_Mutex_Lock(audio.queue_mutex, HELIOS_WAIT_FOREVER);
+       mp_printf(&mp_plat_print, "audio.audio_state :%d\n",audio.audio_state );
     if (audio.audio_state == AUDIO_IDLE)
     {
         // HELIOS_AUDIO_LOG("----- audio 1-----\r\n");
index 1acc627..2b5e001 100644 (file)
@@ -38,7 +38,9 @@
 #include "helios_fs.h"
 #include "helios_os.h"
 #include "helios_ringbuf.h"
-
+#if CONFIG_AUD_RECORD
+#include "../../components/audio/helios_audio_cfg_py.h"
+#endif
 
 #define RECORD_BUFFER_MAX   (uint)8*1024
 
@@ -103,6 +105,27 @@ static c_callback_t *callback_cur;
 /****************************ring buf**************************************/
 
 helios_ring_buf_t *stream_ring_buf = NULL;
+unsigned int stream_ring_buf_free = 0;
+unsigned int stream_ring_buf_used = 0;
+
+STATIC mp_obj_t get_ring_buf_free(mp_obj_t self_in)
+{
+       audio_record_obj_t *self = MP_OBJ_TO_PTR(self_in);
+       unsigned int buf_free = 0;
+       buf_free = helios_rb_free_space(stream_ring_buf);
+       return mp_obj_new_int_from_uint(buf_free);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_get_ring_buf_free_obj, get_ring_buf_free);
+
+STATIC mp_obj_t get_ring_buf_used(mp_obj_t self_in)
+{
+       audio_record_obj_t *self = MP_OBJ_TO_PTR(self_in);
+       unsigned int buf_used = 0;
+       buf_used = helios_rb_data_len(stream_ring_buf);
+       return mp_obj_new_int_from_uint(buf_used);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_get_ring_buf_used_obj, get_ring_buf_used);
+
 
 
 STATIC mp_obj_t audio_record_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) 
@@ -315,6 +338,9 @@ static int helios_stream_record_cb(char *p_data, int len, Helios_EnumAudRecordSt
 
 static void helios_record_stream_timer_cb(void *argv) {
        audio_record_obj_t *self = (audio_record_obj_t *)argv;
+#if CONFIG_ONLY_USE_RECORD_MP3
+       Helios_Audio_StreamRecordStop_py();
+#endif
        Helios_Audio_StreamRecordStop();
        self->isbusy = 0;
        record_state = 0;
@@ -419,10 +445,26 @@ STATIC mp_obj_t helios_audio_record_stream_start(size_t n_args, const mp_obj_t *
        
        record_info.type = HELIOS_REC_TYPE_MIC;
        record_info.cb = (void *)helios_stream_record_cb;
+#if CONFIG_ONLY_USE_RECORD_MP3
+       if(format == HELIOS_AUDIO_FORMAT_MP3){
+               ret = Helios_Audio_StreamRecordStart_py(&record_info);
+       }else{
+               ret = Helios_Audio_StreamRecordStart(&record_info);
+       }
+#else
        ret = Helios_Audio_StreamRecordStart(&record_info);
+#endif
 
        if(ret != 0) {
+#if CONFIG_ONLY_USE_RECORD_MP3
+       if(format == HELIOS_AUDIO_FORMAT_MP3){
+                       Helios_Audio_StreamRecordStop_py();
+               }else{
+                       Helios_Audio_StreamRecordStop();
+               }
+#else
                Helios_Audio_StreamRecordStop();
+#endif
                self->isbusy = 0;
                record_state = 0;
 
@@ -463,7 +505,14 @@ STATIC mp_obj_t helios_audio_record_stream_stop(mp_obj_t self_in)
 {
     int ret = 0;
        audio_record_obj_t *self = MP_OBJ_TO_PTR(self_in);
+#if CONFIG_ONLY_USE_RECORD_MP3
+       ret = Helios_Audio_StreamRecordStop_py();
+       if(ret != 0){
+               ret = Helios_Audio_StreamRecordStop();
+       }
+#else
        ret = Helios_Audio_StreamRecordStop();
+#endif
        self->isbusy = 0;
        record_state = 0;
 
@@ -566,7 +615,11 @@ STATIC mp_obj_t helios_audio_record_start(mp_obj_t self_in, mp_obj_t path, mp_ob
                record_info.format = HELIOS_AUDIO_FORMAT_MP3;
                record_info.type = HELIOS_REC_TYPE_MIC;
                record_info.cb = (void *)helios_file_record_cb;
+               #if CONFIG_ONLY_USE_RECORD_MP3
+               ret = Helios_Audio_FileRecordStart_py(self->file_name, &record_info);
+               #else
                ret = Helios_Audio_FileRecordStart(self->file_name, &record_info);
+               #endif
        }
        else{
                self->isbusy = 0;
@@ -578,6 +631,9 @@ STATIC mp_obj_t helios_audio_record_start(mp_obj_t self_in, mp_obj_t path, mp_ob
        }
 
        if(ret != 0) {
+               #if CONFIG_ONLY_USE_RECORD_MP3
+               Helios_Audio_FileRecordStop_py();
+               #endif
                Helios_Audio_FileRecordStop();
                self->isbusy = 0;
                record_state = 0;
@@ -601,7 +657,14 @@ STATIC mp_obj_t helios_audio_record_stop(mp_obj_t self_in)
 {
     int ret = 0;
        audio_record_obj_t *self = MP_OBJ_TO_PTR(self_in);
+#if CONFIG_ONLY_USE_RECORD_MP3
+       ret = Helios_Audio_FileRecordStop_py();
+       if(ret != 0){
+               ret = Helios_Audio_FileRecordStop();
+       }
+#else
        ret = Helios_Audio_FileRecordStop();
+#endif
        self->isbusy = 0;
        record_state = 0;
 
@@ -832,7 +895,7 @@ STATIC mp_obj_t helios_set_record_callback(mp_obj_t self_in, mp_obj_t callback)
 }
 STATIC MP_DEFINE_CONST_FUN_OBJ_2(mp_helios_record_file_end_callback_obj, helios_set_record_callback);
 
-#if defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609)
+#if defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR)
 STATIC mp_obj_t helios_audio_record_gain_set(size_t n_args, const mp_obj_t *args)
 {
        //audio_record_obj_t *self = MP_OBJ_TO_PTR(args[0]);
@@ -991,6 +1054,10 @@ STATIC mp_obj_t helios_audio_deinit(mp_obj_t self_in)
        g_record_callback = NULL;
        callback_cur = NULL;
        record_state = 0;
+#if CONFIG_ONLY_USE_RECORD_MP3
+       ret = Helios_Audio_FileRecordStop_py();
+       ret = Helios_Audio_StreamRecordStop_py();
+#endif
        ret = Helios_Audio_FileRecordStop();
        ret = Helios_Audio_StreamRecordStop();
 #if defined(PLAT_ASR)
@@ -1029,11 +1096,10 @@ STATIC const mp_rom_map_elem_t audio_locals_dict_table[] = {
     { MP_ROM_QSTR(MP_QSTR_exists),             MP_ROM_PTR(&mp_helios_record_file_exists_obj)   },
     { MP_ROM_QSTR(MP_QSTR_isBusy),             MP_ROM_PTR(&mp_helios_record_file_isBusy_obj)   },
     { MP_ROM_QSTR(MP_QSTR_end_callback),               MP_ROM_PTR(&mp_helios_record_file_end_callback_obj)     },
+       { MP_ROM_QSTR(MP_QSTR_ring_buf_free),           MP_ROM_PTR(&mp_get_ring_buf_free_obj)   },
+       { MP_ROM_QSTR(MP_QSTR_ring_buf_used),           MP_ROM_PTR(&mp_get_ring_buf_used_obj)   },
 #ifdef PLAT_ASR
     { MP_ROM_QSTR(MP_QSTR_gain),               MP_ROM_PTR(&mp_helios_record_file_gain_obj)     },
-    { MP_ROM_QSTR(MP_QSTR_WAV), MP_ROM_INT(HELIOS_AUDIO_FORMAT_WAVPCM) },
-    { MP_ROM_QSTR(MP_QSTR_AMRNB), MP_ROM_INT(HELIOS_AUDIO_FORMAT_AMRNB) },
-    { MP_ROM_QSTR(MP_QSTR_AMRWB), MP_ROM_INT(HELIOS_AUDIO_FORMAT_AMRWB) },
     { MP_ROM_QSTR(MP_QSTR_amrEncDtx_enable), MP_ROM_PTR(&helios_amrenc_dtx_enable_obj) },
 #endif
 #if MICROPY_QPY_AUDIO_AUDIO
@@ -1045,12 +1111,15 @@ STATIC const mp_rom_map_elem_t audio_locals_dict_table[] = {
     { MP_ROM_QSTR(MP_QSTR_AMRNB), MP_ROM_INT(HELIOS_AUDIO_FORMAT_AMRNB) },
     { MP_ROM_QSTR(MP_QSTR_AMRWB), MP_ROM_INT(HELIOS_AUDIO_FORMAT_AMRWB) },
 #endif
-#if defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609)
+#if defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR)
        { MP_ROM_QSTR(MP_QSTR_gain_set),                MP_ROM_PTR(&mp_helios_audio_record_gain_set_obj)        },
        { MP_ROM_QSTR(MP_QSTR_gain_get),                MP_ROM_PTR(&mp_helios_audio_record_gain_get_obj)        },
        { MP_ROM_QSTR(MP_QSTR_WAV), MP_ROM_INT(HELIOS_AUDIO_FORMAT_WAVPCM) },
     { MP_ROM_QSTR(MP_QSTR_AMRNB), MP_ROM_INT(HELIOS_AUDIO_FORMAT_AMRNB) },
     { MP_ROM_QSTR(MP_QSTR_AMRWB), MP_ROM_INT(HELIOS_AUDIO_FORMAT_AMRWB) },
+    #if CONFIG_AUDIO_RECORD_MP3
+    { MP_ROM_QSTR(MP_QSTR_MP3), MP_ROM_INT(HELIOS_AUDIO_FORMAT_MP3) },
+    #endif
 #endif 
 };
 STATIC MP_DEFINE_CONST_DICT(record_locals_dict, audio_locals_dict_table);
index 122a9ac..44f1f95 100644 (file)
@@ -32,7 +32,7 @@
 #include "callbackdeal.h"
 #if MICROPY_ENABLE_CALLBACK_DEAL
 
-#define QPY_CALLBACKDEAL_LOG_ENABLE
+//#define QPY_CALLBACKDEAL_LOG_ENABLE
 
 #ifdef QPY_CALLBACKDEAL_LOG_ENABLE
 #if defined(PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1803sc) || defined(PLAT_ASR_1602)
@@ -686,6 +686,24 @@ void qpy_callback_deal_thread(void * args_in)
                     break;
                 }
 #endif
+#if 1 // AI_RTC Francis
+                               case CALLBACK_TYPE_ID_TiktokRTC:
+                               {
+                                       st_CallBack_TiktokRTC *ai_rtc_msg = (st_CallBack_TiktokRTC *)msg.msg;
+                                       mp_obj_t ai_rtc_cb[2] = 
+                    {
+                                               mp_obj_new_int(ai_rtc_msg->event),
+                                               mp_obj_new_str(ai_rtc_msg->data, strlen(ai_rtc_msg->data)),
+                    };
+                    mp_sched_schedule_ex(&ai_rtc_msg->callback, mp_obj_new_tuple(2,ai_rtc_cb));
+                                       if(ai_rtc_msg->data) {
+                                               free(ai_rtc_msg->data);
+                                               ai_rtc_msg->data = NULL;
+                                       }
+                                       break;
+                               }
+#endif
+
                 case CALLBACK_TYPE_ID_NONE:
                 default:
                 break;
index 54250ee..824d1a5 100644 (file)
@@ -131,13 +131,17 @@ enum {
 #if MICROPY_QPY_MODULE_ESIM && MICROPY_QPY_MODULE_ESIM_IPA
     CALLBACK_TYPE_ID_ESIM_IPA,
 #endif
-};
+
 #if CONFIG_juphoon
 // typedef struct{
 //     uint32_t result;
 //     c_callback_t callback;
 // }st_CallBack_jrtc;
 #endif
+#if 1 // AI_RTC Francis
+    CALLBACK_TYPE_ID_TiktokRTC,
+#endif
+};
 typedef struct CallBack_LoadBoundMeth{
     c_callback_t *callback;
     void *arg;
@@ -165,10 +169,7 @@ typedef struct{
     c_callback_t callback;
 }st_CallBack_Gsensor;
 
-typedef struct{
-    uint32_t spin_direct;
-    c_callback_t callback;
-}st_CallBack_Encoder;
+
 typedef struct{
     uint8_t pin_no;
     uint8_t edge;
@@ -194,6 +195,11 @@ typedef struct{
     c_callback_t callback;
 }st_CallBack_AW9523;
 
+typedef struct{
+    uint32_t spin_direct;
+    c_callback_t callback;
+}st_CallBack_Encoder;
+
 enum {
     POC_CAL_ELEM_INT,
     POC_CAL_ELEM_STR,
@@ -353,6 +359,14 @@ typedef struct{
 } st_CallBack_SIF;
 #endif
 
+#if 1 // AI_RTC Francis
+typedef struct{
+    int event;
+    char *data;
+       c_callback_t callback;
+} st_CallBack_TiktokRTC;
+#endif
+
 void qpy_callback_deal_init(void);
 void qpy_callback_deal_deinit(void);
 int qpy_send_msg_to_callback_deal_thread(uint8_t id, void *msg);
index 5eab1ff..9559c24 100644 (file)
@@ -180,7 +180,7 @@ STATIC const mp_rom_map_elem_t machine_i2c_locals_dict_table[] = {
        && !defined(BOARD_EC600ECN_LC_AEF) && !defined(BOARD_EC600ECN_LC_AUD) && !defined(BOARD_EG915NEU_AP) && !defined(BOARD_EG915NLA_AP)
     { MP_ROM_QSTR(MP_QSTR_I2C0),       MP_ROM_INT(HELIOS_I2C0) }, 
 #endif
-#if !defined(PLAT_ASR_1803s) && !defined(PLAT_ASR_1803sc) && !defined(BOARD_EC800MCN_LA) && !defined(BOARD_EC800MCN_GA) \
+#if !defined(BOARD_EC800MCN_LA) && !defined(BOARD_EC800MCN_GA) \
        && !defined(BOARD_EC800NCN_LA) && !defined(BOARD_EC800NCN_LA_VOLTE) && !defined(BOARD_EC800MCN_LC) \
        && !defined(BOARD_EC800ECN_LC) && !defined(BOARD_EC800MCN_LF) && !defined(BOARD_EC800MCN_GC) && !defined(BOARD_EC800ECN_LC_WDF)\
        && !defined(BOARD_FCM360W) && !defined(BOARD_EG800PCN_LA) && !defined(BOARD_EC800MCN_LF_CCG) && !defined(BOARD_EG800PCN_LA_ALIPAY)
@@ -189,7 +189,8 @@ STATIC const mp_rom_map_elem_t machine_i2c_locals_dict_table[] = {
 #if !defined(PLAT_RDA) && !defined(BOARD_EC800NCN_LA) && !defined(BOARD_EC800NCN_LA_VOLTE) \
        && !defined(BOARD_EC600GCN_LD) && !defined(BOARD_EC600GCN_LD_YM)&& !defined(BOARD_EG915NEU_AC) && !defined(BOARD_EG915NEU_AG) \
        && !defined(BOARD_EG912UGL_AA) && !defined(BOARD_EC600ECN_LC) && !defined(BOARD_EC800ECN_LC) && !defined(BOARD_EC800ECN_LC_WDF) \
-       && !defined(BOARD_EG700GCN_LC) && !defined(BOARD_FCM360W) && !defined(BOARD_EG915NEU_AP) && !defined(BOARD_EG915NLA_AP)
+       && !defined(BOARD_EG700GCN_LC) && !defined(BOARD_FCM360W) && !defined(BOARD_EG915NEU_AP) && !defined(BOARD_EG915NLA_AP) \
+    && !defined(PLAT_ASR_1803s) && !defined(PLAT_ASR_1803sc) 
     { MP_ROM_QSTR(MP_QSTR_I2C2),       MP_ROM_INT(HELIOS_I2C2) },
 #if !defined(PLAT_Qualcomm) && !defined(BOARD_EC800MCN_LA) && !defined(BOARD_EC800MCN_GA) \
        && !defined(BOARD_EC800GCN_GA) && !defined(BOARD_EC800GCN_LD) && !defined(BOARD_EC800GCN_LD_XBND) && !defined(BOARD_EC800GCN_TT)\
@@ -198,7 +199,7 @@ STATIC const mp_rom_map_elem_t machine_i2c_locals_dict_table[] = {
        && !defined(BOARD_EC800ECN_LC) && !defined(BOARD_EC600MCN_LF) && !defined(BOARD_EC800MCN_LF) && !defined(BOARD_EC800MCN_GC) && !defined(BOARD_EC800ECN_LC_WDF) \
        && !defined(BOARD_EC600ECN_LC_AEF) && !defined(BOARD_EC800ECN_LC_AEF) && !defined(BOARD_EC800ECN_LC_AUD) && !defined(BOARD_EC600ECN_LC_AUD) && !defined(BOARD_EC600MCN_LF_SLPOC) \
        && !defined(BOARD_FCM360W) && !defined(BOARD_EG800PCN_LA) && !defined(BOARD_EC800MCN_LF_CCG) && !defined(BOARD_EG800PCN_LA_ALIPAY) && !defined(BOARD_EC600MCN_LF_SPISD)\
-    && !defined(BOARD_EG915NLA_AP) && !defined(BOARD_EG800GLA_LD)
+    && !defined(BOARD_EG915NLA_AP) && !defined(BOARD_EG800GLA_LD) && !defined(BOARD_EG800GEU_LD) && !defined(PLAT_ASR_1803s) && !defined(PLAT_ASR_1803sc)
     { MP_ROM_QSTR(MP_QSTR_I2C3),       MP_ROM_INT(HELIOS_I2C3) },
 #endif
 #endif
index 21dc883..6a7b9b6 100644 (file)
@@ -77,14 +77,28 @@ typedef struct _machine_simu_i2c_obj_t
 
 STATIC machine_simu_i2c_obj_t *cur_i2c = NULL;
 
+// Elian.wang @2025/01/08 EIGEN platform a hardware delay in the push-pull output to input , and make SDA high level must use floating input.
+#if defined(PLAT_EIGEN) || defined(PLAT_EIGEN_718)
+#define IIC_SDA(X)      do{\
+                            if (X) {\
+                                Helios_GPIO_SetDirection((Helios_GPIONum) cur_i2c->sda_gpio, HELIOS_GPIO_INPUT);\
+                            } else {\
+                                Helios_GPIO_SetDirection((Helios_GPIONum) cur_i2c->sda_gpio, HELIOS_GPIO_OUTPUT);\
+                                Helios_GPIO_SetLevel((Helios_GPIONum)cur_i2c->sda_gpio, 0);\
+                            }\
+                        }while(0)
+#define SDA_OUT
+#else
 #define IIC_SDA(X) (Helios_GPIO_SetLevel((Helios_GPIONum)cur_i2c->sda_gpio, X))
+#define SDA_OUT        (Helios_GPIO_SetDirection((Helios_GPIONum) cur_i2c->sda_gpio, HELIOS_GPIO_OUTPUT))
+#endif
+
 #define IIC_SCL(X) (Helios_GPIO_SetLevel((Helios_GPIONum)cur_i2c->scl_gpio, X))
 
 #define READ_SCL (Helios_GPIO_GetLevel((Helios_GPIONum)cur_i2c->scl_gpio))
 #define READ_SDA (Helios_GPIO_GetLevel((Helios_GPIONum)cur_i2c->sda_gpio))
 
 #define SDA_IN (Helios_GPIO_SetDirection((Helios_GPIONum) cur_i2c->sda_gpio, HELIOS_GPIO_INPUT))
-#define SDA_OUT        (Helios_GPIO_SetDirection((Helios_GPIONum) cur_i2c->sda_gpio, HELIOS_GPIO_OUTPUT))
 #define SCL_OUT        (Helios_GPIO_SetDirection((Helios_GPIONum) cur_i2c->scl_gpio, HELIOS_GPIO_OUTPUT))
 
 
@@ -175,7 +189,7 @@ STATIC uint8_t I2C_Wait_Ack(void)
     int ErrTime=0;  
     int ReadAck=0;  
     SDA_IN; // Config SDA GPIO as Input
-    SLEEP;  
+    SLEEP;
     IIC_SCL(1);   // Set the SCL and wait for ACK  
     while(1)  
     {  
index 56d56ea..d9b8ba3 100644 (file)
@@ -204,6 +204,16 @@ STATIC mp_obj_t machine_rtc_deinit(mp_obj_t self_in) {
 }
 STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_rtc_deinit_obj, machine_rtc_deinit);
 
+#if defined(PLAT_ASR_1606)
+STATIC mp_obj_t machine_rtc_in_powerdown_state(mp_obj_t self_in, mp_obj_t flag) {
+    // mp_obj_t args[2] = {self_in, flag};
+    int state = mp_obj_get_int(flag);
+    int ret = Helios_RTC_In_PowerDown_State(state);
+
+    return mp_obj_new_int(ret);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(machine_rtc_in_powerdown_state_obj, machine_rtc_in_powerdown_state);
+#endif
 
 STATIC const mp_rom_map_elem_t machine_rtc_locals_dict_table[] = {
     { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&machine_rtc_init_obj) },
@@ -216,6 +226,9 @@ STATIC const mp_rom_map_elem_t machine_rtc_locals_dict_table[] = {
 #if !defined(PLAT_Qualcomm)
     { MP_ROM_QSTR(MP_QSTR_register_callback), MP_ROM_PTR(&machine_rtc_register_callback_obj) },
 #endif
+#if defined(PLAT_ASR_1606)
+    { MP_ROM_QSTR(MP_QSTR_rtc_powerdown_state), MP_ROM_PTR(&machine_rtc_in_powerdown_state_obj) },
+#endif
 };
 STATIC MP_DEFINE_CONST_DICT(machine_rtc_locals_dict, machine_rtc_locals_dict_table);
 
index db53a35..86217c5 100644 (file)
@@ -150,7 +150,7 @@ STATIC const mp_rom_map_elem_t misc_adc_locals_dict_table[] = {
     && !defined(BOARD_EC800MCN_LF_CCG) && !defined(BOARD_EC600MCN_LF_SPISD) \
     && !defined(BOARD_EC800GCN_GA) && !defined(BOARD_EC800GCN_GA_MS) && !defined(BOARD_EC800GCN_LD)  && !defined(BOARD_EC800GCN_LD_XBND)\
        && !defined(BOARD_EC800GCN_LD_HRXM) && !defined(BOARD_EC800GCN_LB) && !defined(BOARD_EC800GCN_GA_VOLTE) && !defined(BOARD_EG800PCN_LA_ALIPAY)\
-    && !defined(BOARD_EC800GCN_TT) && !defined(BOARD_EG800GLA_LD)
+    && !defined(BOARD_EC800GCN_TT) && !defined(BOARD_EG800GLA_LD) && !defined(BOARD_EG800GEU_LD)
     { MP_ROM_QSTR(MP_QSTR_ADC2), MP_ROM_INT(ADC2) },
 #if !defined(PLAT_ECR6600) && !defined(BOARD_BC32RA) && !defined(BOARD_BC92RB)
     { MP_ROM_QSTR(MP_QSTR_ADC3), MP_ROM_INT(ADC3) },
diff --git a/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modai_rtc.c b/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modai_rtc.c
new file mode 100644 (file)
index 0000000..a62a34f
--- /dev/null
@@ -0,0 +1,336 @@
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "obj.h"
+#include "runtime.h"
+#include "mperrno.h"
+
+#if CONFIG_TIKTIK_RTC
+
+#include "helios_os.h"
+#include "helios_debug.h"
+#include "helios_ai.h"
+#include "callbackdeal.h"
+
+#define QPY_TiktokRTC_LOG(msg, ...)      custom_log("TiktokRTC", msg, ##__VA_ARGS__)
+
+
+/* 定义TiktokRTC_obj_t结构体 */
+typedef struct _TiktokRTC_obj_t
+{
+    mp_obj_base_t base;   //定义的对象结构体要包含该成员
+}TiktokRTC_obj_t;
+
+const mp_obj_type_t TiktokRTC_type;
+TiktokRTC_obj_t *single_ticktok_rtc = NULL;
+
+
+STATIC c_callback_t *ticktok_rtc_callback = NULL;
+
+static void helios_ticktok_rtc_callback_to_python(int event, char *data)
+{      
+       int length = 0;
+       if(ticktok_rtc_callback == NULL) {
+               return;
+       }
+#if MICROPY_ENABLE_CALLBACK_DEAL
+    st_CallBack_TiktokRTC *ticktok_rtc_msg = malloc(sizeof(st_CallBack_TiktokRTC));
+    if(NULL != ticktok_rtc_msg)
+    {
+        ticktok_rtc_msg->event = event;
+               if( data == NULL ) {
+                       length = 1;
+               } else {
+                       length = strlen(data);
+               }
+        ticktok_rtc_msg->data = (char *)malloc(length+1);
+               if (ticktok_rtc_msg->data == NULL) {
+               free(ticktok_rtc_msg);
+               return;
+           }
+               memset(ticktok_rtc_msg->data, 0x00, length+1);
+               if (data != NULL)
+               {
+                       memcpy(ticktok_rtc_msg->data, data, length);
+               }
+       
+               ticktok_rtc_msg->callback = *ticktok_rtc_callback;
+        qpy_send_msg_to_callback_deal_thread(CALLBACK_TYPE_ID_TiktokRTC, ticktok_rtc_msg);
+    }
+#else
+    mp_sched_schedule_ex(ticktok_rtc_callback, mp_const_none);
+#endif
+}
+
+/*
+* QPY接口
+*/
+STATIC mp_obj_t TiktokRTC_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args)
+{
+    mp_arg_check_num(n_args, n_kw, 1, 2, false);   //检查参数个数
+    if( single_ticktok_rtc == NULL ) {
+               single_ticktok_rtc = m_new_obj_with_finaliser(TiktokRTC_obj_t);  //创建对象,分配空间
+       }
+       TiktokRTC_obj_t *self = single_ticktok_rtc;
+       self->base.type = &TiktokRTC_type;         //定义对象的类型
+
+       int ret = 0;
+
+       int time = mp_obj_get_int(args[0]);
+
+       
+    MP_THREAD_GIL_EXIT();
+    if (args[1] != mp_const_none) {
+        static c_callback_t cb = {0};
+        memset(&cb, 0, sizeof(c_callback_t));
+       ticktok_rtc_callback = &cb;
+       mp_sched_schedule_callback_register(ticktok_rtc_callback, args[1]);
+
+               ret  = helios_ai_init(&helios_ticktok_rtc_callback_to_python, time);
+    } else {
+               ret  = helios_ai_init(NULL, time);
+       }
+       MP_THREAD_GIL_ENTER();
+
+       if(ret != 0)
+       {
+               return mp_obj_new_int(ret);
+       }
+    
+    return MP_OBJ_FROM_PTR(self);                 //返回对象的指针
+}
+
+STATIC mp_obj_t ticktok_rtc_active(size_t n_args, const mp_obj_t *args)
+{
+    TiktokRTC_obj_t *self = (TiktokRTC_obj_t *)MP_OBJ_TO_PTR(args[0]);
+       int ret = 0;
+
+       if (n_args > 1) {
+        bool active = mp_obj_is_true(args[1]);
+        MP_THREAD_GIL_EXIT();
+               if( active ) {
+                       ret = helios_ai_start();
+               } else {
+                       ret = helios_ai_stop();
+               }
+               MP_THREAD_GIL_ENTER();
+    } else {
+       MP_THREAD_GIL_EXIT();
+               ret = helios_ai_status();
+               MP_THREAD_GIL_ENTER();
+       }
+    return mp_obj_new_int(ret);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ticktok_rtc_active_obj, 1, 2, ticktok_rtc_active);
+
+STATIC mp_obj_t ticktok_rtc_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs)
+{
+       if (n_args != 1 && kwargs->used != 0) {
+        mp_raise_TypeError(MP_ERROR_TEXT("either pos or kw args are allowed"));
+    }
+       
+       TiktokRTC_obj_t *self = (TiktokRTC_obj_t *)MP_OBJ_TO_PTR(args[0]);
+       
+       int ret = 0;
+
+       #define RC_TYPE_NC      1
+       #define RC_TYPE_INT     2
+       #define RC_TYPE_STR     3
+       #define RC_TYPE_TUPLE   4
+       uint8_t rc_type = RC_TYPE_NC;
+
+       if(kwargs->used != 0)
+       {
+               for(size_t i = 0; i < kwargs->alloc; i++)
+               {
+                       if(mp_map_slot_is_filled(kwargs, i))
+                       {
+                               switch(mp_obj_str_get_qstr(kwargs->table[i].key))
+                               {
+                                       case MP_QSTR_volume:
+                                       {
+                                               int volume = (uint8_t)mp_obj_get_int(kwargs->table[i].value);
+                                               if(volume > 12 || volume < 0)
+                                               {
+                                                       ret = -1;
+                                                       goto unknown;
+                                               }
+                                               ret = helios_ai_set_volume(volume);
+                                               break;
+                                       }
+                                       case MP_QSTR_StartVoiceChat://starturl
+                                       {
+                                               size_t len;
+                                               const char *url = mp_obj_str_get_data(kwargs->table[i].value, &len);
+                                               char *url_copy = strdup(url);
+                                               if(len <= 0 || url_copy == NULL)
+                                               {
+                                                       ret = -1;
+                                                       goto unknown;
+                                               }
+                                               ret = helios_ai_set_start_voice_chat(url_copy);
+                                               free(url_copy);
+                                               break;
+                                       }
+                                       case MP_QSTR_UpdateVoiceChat://updateurl
+                                       {
+                                               size_t len;
+                                               const char *url = mp_obj_str_get_data(kwargs->table[i].value, &len);
+                                               char *url_copy = strdup(url);
+                                               if(len <= 0 || url_copy == NULL)
+                                               {
+                                                       ret = -1;
+                                                       goto unknown;
+                                               }
+                                               ret = helios_ai_set_update_voice_chat(url_copy);
+                                               free(url_copy);
+                                               break;
+                                       }
+                                       case MP_QSTR_StopVoiceChat://stopurl
+                                       {
+                                               size_t len;
+                                               const char *url = mp_obj_str_get_data(kwargs->table[i].value, &len);
+                                               char *url_copy = strdup(url);
+                                               if(len <= 0 || url_copy == NULL)
+                                               {
+                                                       ret = -1;
+                                                       goto unknown;
+                                               }
+                                               ret = helios_ai_set_stop_voice_chat(url_copy);
+                                               free(url_copy);
+                                               break;
+                                       }
+                                       case MP_QSTR_BotId:
+                                       {
+                                               size_t len;
+                                               const char *bot_id = mp_obj_str_get_data(kwargs->table[i].value, &len);
+                                               char *bot_id_copy = strdup(bot_id);
+                                               if(len <= 0 || bot_id_copy == NULL)
+                                               {
+                                                       ret = -1;
+                                                       goto unknown;
+                                               }
+                                               ret = helios_ai_set_bot_id(bot_id_copy);
+                                               free(bot_id_copy);
+                                               break;
+                                       }
+                                       case MP_QSTR_VoiceId:
+                                       {
+                                               size_t len;
+                                               const char *voice_id = mp_obj_str_get_data(kwargs->table[i].value, &len);
+                                               char *voice_id_copy = strdup(voice_id);
+                                               if(len <= 0 || voice_id_copy == NULL)
+                                               {
+                                                       ret = -1;
+                                                       goto unknown;
+                                               }
+                                               ret = helios_ai_set_voice_id(voice_id_copy);
+                                               free(voice_id_copy);
+                                               break;
+                                       }
+                                       default :
+                                               ret = -1;
+                                               goto unknown;
+                               }
+                       }
+               }
+
+               unknown:
+               return mp_obj_new_int(ret);
+       }
+
+       // Get config
+       if (n_args != 2) {
+        mp_raise_TypeError(MP_ERROR_TEXT("can query only one param"));
+    }
+
+       mp_obj_t val = mp_const_none;
+       char ostr[256+1] = {0};
+       uint8_t oint = 0;
+       mp_obj_t olist = mp_obj_new_list(0, NULL);
+ 
+       MP_THREAD_GIL_EXIT();
+       switch (mp_obj_str_get_qstr(args[1]))
+       {
+               case MP_QSTR_volume:
+               {
+                       ret = helios_ai_get_volume();
+                       rc_type = RC_TYPE_INT;
+                       break;
+               }
+               default:
+                       ret = -1;
+            break;
+       }
+
+       MP_THREAD_GIL_ENTER();
+
+    if(0 == ret)
+    {
+       if(rc_type == RC_TYPE_INT)
+       {
+           return mp_obj_new_int(oint);
+       }
+       else if(rc_type == RC_TYPE_STR)
+       {
+            return mp_obj_new_str(ostr, strlen(ostr));
+       }
+               else if(rc_type == RC_TYPE_TUPLE)
+       {
+            return mp_obj_new_tuple(2, (mp_obj_t[]){mp_obj_new_int(oint), olist});
+       }
+       else
+       {
+            return mp_obj_new_int(-1);
+       }
+       }
+       else
+       {
+         return mp_obj_new_int(ret);
+       }
+       
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_KW(ticktok_rtc_config_obj, 1, ticktok_rtc_config);
+
+STATIC mp_obj_t ticktok_rtc_interrupt(size_t n_args, const mp_obj_t *args)
+{
+    TiktokRTC_obj_t *self = (TiktokRTC_obj_t *)MP_OBJ_TO_PTR(args[0]);
+       int ret = 0;
+
+       ret = helios_ai_interrupt();
+       
+    return mp_obj_new_int(ret);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ticktok_rtc_interrupt_obj, 1, 1, ticktok_rtc_interrupt);
+
+STATIC mp_obj_t qpy_module_ticktok_rtc_delete(mp_obj_t self_in)
+{
+       (void)self_in;
+       single_ticktok_rtc = NULL;
+       return mp_obj_new_int(0);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_1(qpy_ticktok_rtc_delete_obj, qpy_module_ticktok_rtc_delete);
+
+/* 定义type的本地字典 */
+STATIC const mp_rom_map_elem_t TiktokRTC_locals_dict_table[] = {
+       { MP_OBJ_NEW_QSTR(MP_QSTR___name__),MP_ROM_QSTR(MP_QSTR_TiktokRTC) },
+    { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&qpy_ticktok_rtc_delete_obj) },
+    { MP_ROM_QSTR(MP_QSTR_active), MP_ROM_PTR(&ticktok_rtc_active_obj) },
+    { MP_ROM_QSTR(MP_QSTR_config), MP_ROM_PTR(&ticktok_rtc_config_obj) },
+    { MP_ROM_QSTR(MP_QSTR_interrupt), MP_ROM_PTR(&ticktok_rtc_interrupt_obj) },
+};
+
+/* 把TiktokRTC_locals_dict_table注册到TiktokRTC_locals_dict里面去 */
+STATIC MP_DEFINE_CONST_DICT(TiktokRTC_locals_dict, TiktokRTC_locals_dict_table);
+
+/* 定义mp_obj_type_t类型的结构体;注意这里和定义module使用的类型是不一样的 */
+const mp_obj_type_t TiktokRTC_type = {
+    .base={ &mp_type_type }, 
+    .name = MP_QSTR_TiktokRTC, //type类的name属性是放在这里定义,而不是放在DICT中
+    .make_new = TiktokRTC_make_new, //添加的make new属性
+    .locals_dict = (mp_obj_dict_t*)&TiktokRTC_locals_dict, //注册TiktokRTC_locals_dict
+};
+    
+#endif
+
index 20e6b65..df5976a 100644 (file)
@@ -66,7 +66,7 @@ static AudioChannelSupport_t audio_channel_tab = {
        || defined(BOARD_EC600MCN_CC) || defined(BOARD_EC600MCN_CC_EXT) || defined(BOARD_EC600MCN_LF_SLPOC) || defined(BOARD_EC600MCN_CC_EXT_TTS) \
        || defined(BOARD_EC600MCN_LE_ALIPAY) || defined(BOARD_EC600KCN_CC_TTS) || defined(BOARD_EC600MCN_LE_BTZ) || defined(BOARD_EC600MCN_LF_SPISD) \
        || defined(BOARD_EC600MEU_LA) || defined(BOARD_EC600MEU_LA_POC_XBND) || defined(BOARD_EC600KCN_LC) || defined(BOARD_EC600MCN_LF_QS) \
-       || defined(BOARD_EC600MLA_LA_POC_XBND) || defined(BOARD_EC600MEU_LA_POC_QS) || defined(BOARD_EC600MLA_LA_POC_QS)
+       || defined(BOARD_EC600MLA_LA_POC_XBND) || defined(BOARD_EC600MEU_LA_POC_QS) || defined(BOARD_EC600MLA_LA_POC_QS) || defined(BOARD_EC600MLA_LA)
        {1, 0, 0}
 #elif defined(BOARD_EC800MCN_LA) || defined(BOARD_EC800MCN_GA) \
     || defined(BOARD_EC800MCN_LA_VOLTE) || defined(BOARD_EC800MCN_GC) || defined(BOARD_EC800MCN_LC) || defined(BOARD_EC800MCN_LF) \
@@ -82,7 +82,8 @@ static AudioChannelSupport_t audio_channel_tab = {
        || defined(BOARD_EG810MEU_LA) || defined(BOARD_EG810MCN_LA_VOLTE) || defined(BOARD_EG810MEU_LA_VOEXT) \
        || defined(BOARD_EG810MCN_LA_VOEXT) || defined(BOARD_EC800MCN_LE_CPE) || defined(BOARD_EG800PCN_LA_ALIPAY) \
        || defined(BOARD_EC800KCN_LC_SMS) || defined(BOARD_EC800MCN_GB_VOEXT) || defined(BOARD_EG810MEU_LA_VOLVGL) \
-       || defined(BOARD_EG810MCN_GB_ALIPAY)  || defined(BOARD_EC800MCN_LE_VOEXT)
+       || defined(BOARD_EG810MCN_GB_ALIPAY)  || defined(BOARD_EC800MCN_LE_VOEXT) || defined(BOARD_EG800KLA_LC) || defined(BOARD_EG800KEU_LC) \
+       || defined(BOARD_EC800KEU_LC) || defined(BOARD_EG810MEU_LA_POC_XBND)
        {1, 0, 0}
 #elif defined(BOARD_EG915NEU_AC) || defined(BOARD_EG915NEU_AG) || defined(BOARD_EG915NEA_AC) || defined(BOARD_EG915NEA_AC_SANX)\
    || defined(BOARD_EG915NEU_AP) || defined(BOARD_EG915NLA_AP)
@@ -169,7 +170,8 @@ static AudioChannelSupport_t audio_channel_tab = {
        || defined(BOARD_EC800GCN_LD_HRXM) \
        || defined(BOARD_EC800GCN_LB) \
        || defined(BOARD_EC800GCN_TT) \
-       || defined(BOARD_EG800GLA_LD)
+       || defined(BOARD_EG800GLA_LD) \
+       || defined(BOARD_EG800GEU_LD)
        {0, 0, 0}
 #elif defined(BOARD_EC800GCN_LD_XBND)
        {1, 1, 1}
index fa30858..ba565e9 100644 (file)
@@ -71,13 +71,9 @@ STATIC mp_obj_t qpy_lbs_get_cell_coordinates(size_t n_args, const mp_obj_t *args
        {
                return mp_obj_new_int(-4);
        }
-       if ((profile_idx < (int)HELIOS_PROFILE_IDX_MIN) || (profile_idx > (int)HELIOS_PROFILE_IDX_MAX))
+       if ((profile_idx < (int)HELIOS_PROFILE_IDX_MIN) || (profile_idx > 3))
        {
-#if defined (PLAT_ASR)
-               mp_raise_ValueError("invalid value, profileIdx should be in [1,8].");
-#elif defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05)
-               mp_raise_ValueError("invalid value, profileIdx should be in [1,7].");
-#endif
+               mp_raise_ValueError("invalid value, profileIdx should be in [1,3].");
        }
        
        ret = Helios_DataCall_GetInfo(profile_idx, 0, &datacall_info);
index a10571f..75b2fa2 100644 (file)
@@ -639,6 +639,22 @@ STATIC mp_obj_t qpy_datacall_get_date_speed(size_t n_args, const mp_obj_t *args)
 }
 STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(qpy_datacall_get_date_speed_obj, 0, 0, qpy_datacall_get_date_speed);
 
+STATIC mp_obj_t qpy_datacall_get_date_traffic(size_t n_args, const mp_obj_t *args)
+{
+       uint64_t rx = 0, tx = 0;
+#if defined(PLAT_ASR_1803s)
+       MP_THREAD_GIL_EXIT();
+       Helios_DataCall_GetDataTraffic(&rx, &tx);
+       MP_THREAD_GIL_ENTER();
+#endif
+       mp_obj_t date_speed[2] = {
+               mp_obj_new_int_from_uint(rx),   //byte
+               mp_obj_new_int_from_uint(tx),   //byte
+       };
+       return mp_obj_new_tuple(2,date_speed);  
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(qpy_datacall_get_date_traffic_obj, 0, 0, qpy_datacall_get_date_traffic);
+
 STATIC mp_obj_t qpy_datacall_get_address_info(size_t n_args, const mp_obj_t *args)
 {
     int profile_id  = mp_obj_get_int(args[0]);
@@ -827,6 +843,7 @@ STATIC const mp_rom_map_elem_t mp_module_datacall_globals_table[] = {
        #endif
        { MP_ROM_QSTR(MP_QSTR_useAttachApn),    MP_ROM_PTR(&qpy_datacall_use_attach_apn_obj) },
        { MP_ROM_QSTR(MP_QSTR_getSpeed),        MP_ROM_PTR(&qpy_datacall_get_date_speed_obj) },
+       { MP_ROM_QSTR(MP_QSTR_getTraffic),      MP_ROM_PTR(&qpy_datacall_get_date_traffic_obj) },
        { MP_ROM_QSTR(MP_QSTR_getAddressinfo),  MP_ROM_PTR(&qpy_datacall_get_address_info_obj) },
        { MP_ROM_QSTR(MP_QSTR_getSiminfo),      MP_ROM_PTR(&qpy_datacall_get_sim_info_obj) },
 };
index c01ea20..2f46586 100644 (file)
@@ -235,6 +235,35 @@ STATIC mp_obj_t queclib_dev_imei_set(mp_obj_t imei) {
 STATIC MP_DEFINE_CONST_FUN_OBJ_1(queclib_dev_imei_set_obj, queclib_dev_imei_set);
 #endif
 
+#if defined (PLAT_Unisoc) && defined (CONFIG_MICROPYTHON_EXTENSION_SECURE_APP)
+STATIC mp_obj_t enable_secure_boot()
+{
+    return mp_obj_new_int(Helios_Dev_EnableSecureBoot());
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_0(enable_secure_boot_obj, enable_secure_boot);
+
+STATIC mp_obj_t secure_boot_state()
+{
+    return mp_obj_new_bool(Helios_Dev_SecureBootEnableState());
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_0(secure_boot_state_obj, secure_boot_state);
+
+STATIC mp_obj_t secure_app_check(mp_obj_t data, mp_obj_t sig)
+{
+       mp_buffer_info_t buf_info;
+       mp_buffer_info_t sig_info;
+
+       mp_get_buffer_raise(data, &buf_info, MP_BUFFER_READ);
+       mp_get_buffer_raise(sig, &sig_info, MP_BUFFER_READ);
+
+       bool result = Helios_Dev_SecureSigCheck(buf_info.buf, buf_info.len, sig_info.buf);
+       
+    return mp_obj_new_bool(result);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(secure_app_check_obj, secure_app_check);
+
+#endif
+
 STATIC const mp_rom_map_elem_t mp_module_modem_globals_table[] = {
     { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_modem) },
 #if !defined(PLAT_aic8800m40)
@@ -261,6 +290,11 @@ STATIC const mp_rom_map_elem_t mp_module_modem_globals_table[] = {
 #if defined(PLAT_ECR6600) || defined(PLAT_aic8800m40)
     { MP_ROM_QSTR(MP_QSTR_getDevMAC), MP_ROM_PTR(&queclib_dev_mac_obj) },
 #endif
+#if defined (PLAT_Unisoc) && defined (CONFIG_MICROPYTHON_EXTENSION_SECURE_APP)
+       { MP_ROM_QSTR(MP_QSTR_enableSecureBoot), MP_ROM_PTR(&enable_secure_boot_obj) },
+       { MP_ROM_QSTR(MP_QSTR_getSecureBootEnableState),        MP_ROM_PTR(&secure_boot_state_obj) },
+       { MP_ROM_QSTR(MP_QSTR_secureAppCheck),  MP_ROM_PTR(&secure_app_check_obj) },
+#endif
 };
 STATIC MP_DEFINE_CONST_DICT(mp_module_modem_globals, mp_module_modem_globals_table);
 
diff --git a/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/moddlms.c b/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/moddlms.c
new file mode 100644 (file)
index 0000000..a8bd4b3
--- /dev/null
@@ -0,0 +1,219 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "runtime.h"
+#include "mphalport.h"
+
+#if MICROPY_QPY_MODULE_DLMS
+#include "callbackdeal.h"
+#include "helios_os.h"
+#include "helios_pin.h"
+#include "helios_uart.h"
+#include "helios_debug.h"
+#define QPY_DLMS_LOG(msg, ...) custom_log("DLMS", msg, ##__VA_ARGS__)
+
+#define DLMS_HANDLE_REQUEST_BUFF_SIZE   (512)
+
+#include "dlms_parser.h"
+// #define MOD_DLMS_UART_ENABLE
+
+typedef struct
+{
+    uint64_t ind_type;
+    Helios_UARTNum port;
+    uint64_t size;
+}uart_data_t;
+
+static mp_int_t g_uart_port = HELIOS_UART2;
+// static Helios_Thread_t g_uart_read_tid = 0;
+
+static bool g_dlms_svr_run_flag = false;
+static Helios_Thread_t g_dlms_svr_run_tid = 0;
+
+
+
+#ifdef MOD_DLMS_UART_ENABLE /*#ifdef MOD_DLMS_UART_ENABLE*/
+static void dlms_uart_read_task(void *args)
+{
+    uart_data_t* uart_data = (uart_data_t*)args;
+    QPY_DLMS_LOG("ind_type:%d, port:%d, size:%d\r\n", uart_data->ind_type, uart_data->port, uart_data->size);
+    // Helios_UART_Read(port, size);
+}
+
+void dlms_uart_callback(uint64_t ind_type, Helios_UARTNum port, uint64_t size)
+{
+    QPY_DLMS_LOG("ind_type:%d, port:%d, size:%d\r\n", ind_type, port, size);
+    uart_data_t uart_data = { ind_type, port, size };
+
+    Helios_ThreadAttr attr = {
+        .name = "dlms_uart_read_task",
+        .stack_size = 4096,
+        .priority = 100,
+        .entry = dlms_uart_read_task,
+        .argv = &uart_data
+    };
+    Helios_Thread_t tid = Helios_Thread_Create(&attr);
+    if (0 == tid) {
+        QPY_DLMS_LOG("uart(%d) read task create failed.\r\n", g_uart_port);
+    }
+}
+
+STATIC mp_obj_t dlms_uart_open(size_t n_args, const mp_obj_t *args)
+{
+    if ( 0 < n_args){
+        g_uart_port = mp_obj_get_int(args[0]);
+    }
+    if (HELIOS_UART0 > g_uart_port || HELIOS_UARTMAX < g_uart_port) {
+        mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("uart(%d) does not exist."), g_uart_port);
+    }
+
+    // init uart config
+    Helios_UARTInitStruct uart_para = { 0 };
+    Helios_UARTConfig uart_config = {
+        .baudrate   = HELIOS_UART_BAUD_115200,
+        .data_bit   = HELIOS_UART_DATABIT_8,
+        .flow_ctrl  = HELIOS_UART_FC_NONE,
+        .parity_bit = HELIOS_UART_PARITY_EVEN,
+        .stop_bit   = HELIOS_UART_STOP_1
+    };
+    uart_para.uart_config = &uart_config;
+       // uart_para.uart_callback = dlms_uart_callback;
+
+    if (QPY_REPL_UART == g_uart_port) {
+               mp_hal_port_open(0);
+       }
+       Helios_UART_Deinit((Helios_UARTNum)g_uart_port);
+
+    if (0 != Helios_UART_Init((Helios_UARTNum)g_uart_port, &uart_para)) {
+               mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("uart(%d) init fail."), g_uart_port);
+    }
+    if (0 != Helios_UART_SetCallback(g_uart_port, dlms_uart_callback)) {
+        mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("uart(%d) set callback fail."), g_uart_port);
+    }
+    QPY_DLMS_LOG("uart(%d) open success.\r\n", g_uart_port);
+
+    return mp_obj_new_int(0);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(dlms_uart_open_obj, 0, 1, dlms_uart_open);
+
+STATIC mp_obj_t dlms_uart_close()
+{
+    int ret = Helios_UART_Deinit((Helios_UARTNum)g_uart_port);
+    if (QPY_REPL_UART == g_uart_port) {
+               mp_hal_port_open(1);
+       }
+    g_uart_port = HELIOS_UART2;    // default uart2
+    QPY_DLMS_LOG("uart(%d) close success.\r\n", g_uart_port);
+    return mp_obj_new_int(ret);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_0(dlms_uart_close_obj, dlms_uart_close);
+#endif  /*#ifdef MOD_DLMS_UART_ENABLE*/
+
+static void dlms_svr_run_task()
+{
+#ifdef MOD_DLMS_UART_ENABLE
+    dlms_uart_open(0, NULL);
+#endif
+    _dlms_run_back_ground_processes(&g_dlms_svr_run_flag);
+    g_dlms_svr_run_tid = 0;
+}
+
+STATIC mp_obj_t dlms_run()
+{
+    if (g_dlms_svr_run_flag) {
+        QPY_DLMS_LOG("server is running.\r\n");
+        return mp_obj_new_int(0);
+    }
+    Helios_ThreadAttr attr = {
+        .name = "dlms_svr_run_task",
+        .stack_size = 4096,
+        .priority = 80,
+        .entry = dlms_svr_run_task,
+        .argv = NULL
+    };
+    g_dlms_svr_run_tid = Helios_Thread_Create(&attr);
+    if (0 == g_dlms_svr_run_tid) {
+        QPY_DLMS_LOG("server task create failed.\r\n");
+        return mp_obj_new_int(-1);
+    }
+    return mp_obj_new_int(0);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_0(dlms_run_obj, dlms_run);
+
+
+STATIC mp_obj_t dlms_stop()
+{
+#ifdef MOD_DLMS_UART_ENABLE
+    dlms_uart_close();
+#endif
+    if (g_dlms_svr_run_tid) {
+        Helios_Thread_Delete(g_dlms_svr_run_tid);
+        g_dlms_svr_run_tid = 0;
+        Helios_msleep(30);
+        g_dlms_svr_run_flag = false;
+    }
+    return mp_obj_new_int(0);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_0(dlms_stop_obj, dlms_stop);
+
+
+STATIC const mp_arg_t dlms_request_args[] = {
+    { MP_QSTR_source_buff,        MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL}      },
+    { MP_QSTR_source_buff_len,    MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0}                },
+};
+STATIC mp_obj_t dlms_handle_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args)
+{
+    enum { SOURCE_BUFF, SOURCE_BUFF_LEN };
+    mp_arg_val_t out_vals[MP_ARRAY_SIZE(dlms_request_args)];
+    mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(dlms_request_args), dlms_request_args, out_vals);
+
+    // get parameters
+    mp_buffer_info_t source_buff_info;
+    mp_get_buffer_raise(out_vals[SOURCE_BUFF].u_obj, &source_buff_info, MP_BUFFER_READ);
+    source_buff_info.len = out_vals[SOURCE_BUFF_LEN].u_int;
+    if ( 0 >= source_buff_info.len ) {
+        mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("sure buff len >= 1."));
+    }
+    QPY_DLMS_LOG("source_buff:%x, source_buff_len:%d\r\n", source_buff_info.buf, source_buff_info.len);
+
+    // handle request
+    unsigned char r_buff[DLMS_HANDLE_REQUEST_BUFF_SIZE];
+    uint16_t r_len = 0;
+    if (0 != _dlms_handle_request((unsigned char *)source_buff_info.buf, (uint16_t)source_buff_info.len, r_buff, &r_len)) {
+        return mp_obj_new_bytearray(0, 0);
+    }
+    if (0 >= r_len || NULL == r_buff) {
+        QPY_DLMS_LOG("handle request return data is null!!!\r\n");
+        return mp_obj_new_bytearray(0, 0);
+    }
+    return mp_obj_new_bytearray(r_len, r_buff);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_KW(dlms_handle_request_obj, 2, dlms_handle_request);
+
+
+/* 定义的modtest全局字典,之后我们添加type和function就要添加在这里 */
+STATIC const mp_rom_map_elem_t dlms_globals_table[] = {
+    { MP_ROM_QSTR(MP_QSTR___name__),            MP_ROM_QSTR(MP_QSTR_dlms)                       },
+    { MP_ROM_QSTR(MP_QSTR_run),                 MP_ROM_PTR(&dlms_run_obj)                       },
+    { MP_ROM_QSTR(MP_QSTR_stop),                MP_ROM_PTR(&dlms_stop_obj)                      },
+#ifdef MOD_DLMS_UART_ENABLE
+    { MP_ROM_QSTR(MP_QSTR_uart_open),           MP_ROM_PTR(&dlms_uart_open_obj)                 },
+    { MP_ROM_QSTR(MP_QSTR_uart_close),          MP_ROM_PTR(&dlms_uart_close_obj)                },
+#endif
+    { MP_ROM_QSTR(MP_QSTR_handle_request),      MP_ROM_PTR(&dlms_handle_request_obj)            },
+};
+
+
+/* 把modtest_globals_table注册到 mp_module_modtest_globals里面去 */
+STATIC MP_DEFINE_CONST_DICT(dlms_globals_dict, dlms_globals_table);
+
+
+/* 定义一个module类型 */
+const mp_obj_module_t mp_module_dlms = {
+    .base = {&mp_type_module},
+    .globals = (mp_obj_dict_t *)&dlms_globals_dict,
+    // .make_new = dlms_make_new,
+};
+
+
+#endif // MICROPY_QPY_MODULE_DLMS
index 58dc084..4d5cdb3 100644 (file)
@@ -289,6 +289,61 @@ static void mpFotaProgressCB(int sta, int progress)
        }
 }
 
+#if defined(BOARD_BG95M9)
+STATIC mp_obj_t fota_firmware_download_at(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args)
+{
+       int ret;
+       char *server_address1 = NULL;
+       char *server_address2 = NULL;
+
+    enum {
+        ARG_url1,
+               ARG_url2,       
+        ARG_callback,
+        ARG_header,
+        ARG_ssl_params,
+        ARG_public_key,
+    };
+    static const mp_arg_t allowed_args[] = {
+        { MP_QSTR_url1,         MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
+        { MP_QSTR_url2,         MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
+        { MP_QSTR_callback,     MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
+        { MP_QSTR_header,       MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
+        { MP_QSTR_ssl_params,   MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
+        { MP_QSTR_public_key,   MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
+    };
+       mp_arg_val_t args_parse[MP_ARRAY_SIZE(allowed_args)];
+    mp_arg_parse_all(n_args-1, args+1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args_parse);
+
+    if (args_parse[ARG_url1].u_obj != mp_const_none) {
+        server_address1 = (char *)(mp_obj_str_get_str(args_parse[ARG_url1].u_obj));
+    }
+
+    if (args_parse[ARG_url2].u_obj != mp_const_none) {
+        server_address2 = (char *)(mp_obj_str_get_str(args_parse[ARG_url2].u_obj));
+    }
+
+    if (args_parse[ARG_callback].u_obj != mp_const_none) {
+        static c_callback_t cb = {0};
+        memset(&cb, 0, sizeof(c_callback_t));
+       fota_callback = &cb;
+       mp_sched_schedule_callback_register(fota_callback, args_parse[ARG_callback].u_obj);
+    }
+       MP_THREAD_GIL_EXIT();
+       ret  = Helios_Fota_firmware_download_at(server_address1, server_address2, mpFotaProgressCB);
+       MP_THREAD_GIL_ENTER();
+       
+       if(ret)
+       {
+               MOD_FOTA_LOG("*** fota firmware download fail ***\r\n");
+               return mp_obj_new_int(-1);
+       }
+
+       return mp_obj_new_int(0);
+}
+
+STATIC MP_DEFINE_CONST_FUN_OBJ_KW(fota_firmware_download_at_obj, 1, fota_firmware_download_at);
+#endif
 
 STATIC mp_obj_t fota_firmware_download(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args)
 {      
@@ -596,9 +651,12 @@ STATIC const mp_rom_map_elem_t fota_locals_dict_table[] = {
 #endif
        { MP_ROM_QSTR(MP_QSTR_httpDownload), MP_ROM_PTR(&fota_firmware_download_obj) },
 #if defined(PLAT_Qualcomm)
+#if defined(BOARD_BG95M9)
+       { MP_ROM_QSTR(MP_QSTR_httpDownload_at), MP_ROM_PTR(&fota_firmware_download_at_obj) },
        { MP_ROM_QSTR(MP_QSTR_download_cancel), MP_ROM_PTR(&fota_download_cancel_obj) },
        { MP_ROM_QSTR(MP_QSTR_apn_set), MP_ROM_PTR(&fota_apn_set_obj) },
 #endif
+#endif
 #if defined(PLAT_Qualcomm) || defined (PLAT_Unisoc) || defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1803sc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06)
        { MP_ROM_QSTR(MP_QSTR_ftpDownload), MP_ROM_PTR(&fota_ftp_download_obj) },
 #endif
index 2331988..dc9efdd 100644 (file)
@@ -34,6 +34,7 @@
 #if MICROPY_QPY_MODULE_LPM
 
 #include "helios_lpm.h"
+#include "helios_atcmd.h"
 #if defined(PLAT_RDA)
 #include "helios_debug.h"
 #endif
@@ -421,17 +422,35 @@ STATIC mp_obj_t helios_pm_get_net_psm_value(void)
 STATIC MP_DEFINE_CONST_FUN_OBJ_0(helios_pm_get_net_psm_value_obj, helios_pm_get_net_psm_value);
 #endif
 
+STATIC c_callback_t *psm_callback = NULL;
+static void mpPSMProgressCB(int tau_time, int act_time)
+{
+    if(psm_callback != NULL){
+        MP_THREAD_GIL_ENTER();
+        GC_STACKTOP_SET();
+               mp_obj_t psm_list[2] = {                                                                                        
+                               mp_obj_new_int(tau_time),                                                                                               
+                               mp_obj_new_int(act_time),                                                                                       
+                       };      
+
+           mp_sched_schedule_ex(psm_callback, mp_obj_new_list(2, psm_list));
+           GC_STACKTOP_CLEAR();
+           MP_THREAD_GIL_EXIT();
+    }
+}
+
 STATIC mp_obj_t helios_pm_set_psm_time(size_t n_args, const mp_obj_t *args)
 {
+  int ret = 0;
   int tau_uint = 0;
   int tau_time = 0;
   int act_uint = 0;
   int act_time = 0;
   int mode     = 1;
-  if ( n_args != 4 && n_args != 1 ){
+  if ( n_args != 4 && n_args != 1 && n_args != 5 ){
     return mp_const_false;
   }
-  if ( n_args == 4 )
+  if ( n_args == 4 || n_args == 5)
   {
     if ( mp_obj_is_int(args[0]) && mp_obj_is_int(args[1]) \
          && mp_obj_is_int(args[2]) && mp_obj_is_int(args[3])  ){
@@ -439,20 +458,46 @@ STATIC mp_obj_t helios_pm_set_psm_time(size_t n_args, const mp_obj_t *args)
         tau_time = mp_obj_get_int(args[1]);
         act_uint = mp_obj_get_int(args[2]);
         act_time = mp_obj_get_int(args[3]);
+#if defined(BOARD_BG95M9)
+        if(n_args == 5)
+        {
+          char psm_cmd[128] = {0};
+          char resp[32] = {0};
+          static c_callback_t cb = {0};
+          memset(&cb, 0, sizeof(c_callback_t));
+          psm_callback = &cb;
+          mp_sched_schedule_callback_register(psm_callback, args[4]);
+
+          snprintf(psm_cmd, sizeof(psm_cmd), "AT+QCFG=\"psm/urc\",1\r\n");
+          ret = Helios_Atcmd_Send_Sync(0, psm_cmd, resp, sizeof(resp), NULL, 10);
+          if(ret != 0) return mp_const_false;
+
+          snprintf(psm_cmd, sizeof(psm_cmd), "AT+QURCCFG=\"URCPORT\",\"DAM\"\r\n");
+          ret = Helios_Atcmd_Send_Sync(0, psm_cmd, resp, sizeof(resp), NULL, 10);
+          if(ret != 0) return mp_const_false;
+        }
+#endif
     }else{
       return mp_const_false;
     }
   }else{
     mode = mp_obj_get_int(args[0]);
   }
-  int ret = Helios_LPM_Set_PsmTime(mode,tau_uint,tau_time,act_uint,act_time);
+#if defined(BOARD_BG95M9)
+  ret = Helios_LPM_Set_PsmTime(mode,tau_uint,tau_time,act_uint,act_time,mpPSMProgressCB);
+#else
+  ret = Helios_LPM_Set_PsmTime(mode,tau_uint,tau_time,act_uint,act_time);
+#endif
   if ( ret != 0 ){
     return mp_const_false;
   }
        return mp_const_true;
 }
-
+#if defined(BOARD_BG95M9)
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(helios_pm_set_psm_time_obj, 1, 5, helios_pm_set_psm_time);
+#else
 STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(helios_pm_set_psm_time_obj, 1, 4, helios_pm_set_psm_time);
+#endif
 
 STATIC mp_obj_t helios_pm_get_psm_time(void)
 {
index 2aaeaea..756d2f0 100644 (file)
@@ -1836,6 +1836,31 @@ static void qpy_net_event_handler(uint8_t sim_id, int32_t event_id, void *ctx)
                        }
                        break;
                }
+       #if MICROPY_QPY_MODULE_NET_EX
+               case HELIOS_NW_CAUSE_REJECT_IND:
+               {
+                       /* ... */
+                       QPY_NET_LOG("[net]cause_reject event.\r\n", event_id);
+                       Helios_NwRegisterInfoStruct *nw_register_status = (Helios_NwRegisterInfoStruct *)ctx;
+                       if (g_net_user_callback)
+                       {
+                               MP_THREAD_GIL_ENTER();
+                               GC_STACKTOP_SET();
+                               mp_obj_t tuple[4] = 
+                       {
+                               mp_obj_new_int(event_id),
+                               mp_obj_new_int(nw_register_status->status),
+                               mp_obj_new_int(nw_register_status->reject_cause),
+                               mp_obj_new_str(nw_register_status->rejrct_plmn, strlen(nw_register_status->rejrct_plmn)),
+                       };
+                               mp_sched_schedule_ex(g_net_user_callback, mp_obj_new_tuple(4, tuple));
+                               GC_STACKTOP_CLEAR();
+                               MP_THREAD_GIL_EXIT();
+                               QPY_NET_LOG("[net] callback end.\r\n");
+                       }
+                       break;
+               }
+       #endif
        #if MICROPY_QPY_MODULE_JAMDET
                case HELIOS_NW_JAMMING_DETECT_IND:
                {
@@ -2312,7 +2337,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(qpy_jamdet_get_stauts_obj, 0, 1, qpy_
 #if defined(MICROPY_QPY_MODULE_IMS_STATUS)
 STATIC mp_obj_t qpy_net_get_ims_register(size_t n_args, const mp_obj_t *args)
 {
-       uint8_t sim_id = _get_current_simid();;
+       uint8_t sim_id = _get_current_simid();
        if (n_args == 1) {
                sim_id = mp_obj_get_int(args[0]);
        }
@@ -2445,10 +2470,35 @@ STATIC mp_obj_t qpy_net_get_TPTW(void)
 }
 STATIC MP_DEFINE_CONST_FUN_OBJ_0(qpy_net_get_TPTW_obj, qpy_net_get_TPTW);
 
-STATIC mp_obj_t qpy_net_get_qRxlevMin(void)
+STATIC mp_obj_t qpy_net_get_qRxlevMin(size_t n_args, const mp_obj_t *args)
 {
        char resp[256] = {0};
        char para[64] = {0};
+       if (n_args == 1)
+       {
+               int flag = (uint8_t)mp_obj_get_int(args[0]);
+               if ((flag != 0) && (flag != 1))
+               {
+                       mp_raise_ValueError("invalid value, flag should be 0 or 1.");
+               }
+               if (flag ==1) {
+                       mp_obj_t qRxlevMin_list  = mp_obj_new_list(0, NULL);
+                       MP_THREAD_GIL_EXIT();
+                       HELIOS_AT_RESP_STATUS_E ret = Helios_Atcmd_Send_Sync(3, "AT$QCCELLSELECT?\r\n", resp, sizeof(resp), NULL, 15);
+                       MP_THREAD_GIL_ENTER();
+                       if(ret == HELIOS_AT_RESP_OK) {
+                               Helios_Atcmd_Get_Para_Value_Str(resp, 1, 2, para, sizeof(para));
+                               mp_obj_t qRxlevMin = mp_obj_new_str(para, strlen(para));                        
+                               Helios_Atcmd_Get_Para_Value_Str(resp, 1, 3, para, sizeof(para));
+                               mp_obj_t qRxlevMinCE = mp_obj_new_str(para, strlen(para));
+                               Helios_Atcmd_Get_Para_Value_Str(resp, 1, 4, para, sizeof(para));
+                               mp_obj_t qRxlevMinCE1 = mp_obj_new_str(para, strlen(para));
+                               mp_obj_t tuple[3] = {qRxlevMin, qRxlevMinCE, qRxlevMinCE1};
+                       return mp_obj_new_tuple(3, tuple);
+                       }
+                       return mp_obj_new_int(-1);      
+               }
+       }
        MP_THREAD_GIL_EXIT();
        HELIOS_AT_RESP_STATUS_E ret = Helios_Atcmd_Send_Sync(0, "AT+QCFG=\"sibinfo\"\r\n", resp, sizeof(resp), NULL, 10);
        MP_THREAD_GIL_ENTER();
@@ -2460,7 +2510,7 @@ STATIC mp_obj_t qpy_net_get_qRxlevMin(void)
        }
        return mp_obj_new_int(-1);
 }
-STATIC MP_DEFINE_CONST_FUN_OBJ_0(qpy_net_get_qRxlevMin_obj, qpy_net_get_qRxlevMin);
+STATIC  MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(qpy_net_get_qRxlevMin_obj, 0, 1, qpy_net_get_qRxlevMin);
 
 STATIC mp_obj_t qpy_net_get_reject_cause(void)
 {
@@ -2476,6 +2526,52 @@ STATIC mp_obj_t qpy_net_get_reject_cause(void)
        return mp_obj_new_int(-1);
 }
 STATIC MP_DEFINE_CONST_FUN_OBJ_0(qpy_net_get_reject_cause_obj, qpy_net_get_reject_cause);
+
+STATIC mp_obj_t qpy_net_set_cause_info(size_t n_args, const mp_obj_t *args)
+{
+       int ret = -1;
+       char resp[128] = {0};
+       char para[8] = {0};
+       if (n_args == 0) 
+       {
+               if(Helios_Atcmd_Send_Sync(0, "AT+QNWCFG=\"causeinfo\"\r\n", resp, sizeof(resp), NULL, 10) == HELIOS_AT_RESP_OK)
+               {
+                       Helios_Atcmd_Get_Para_Value_Str(resp, 1, 1, para, sizeof(para));
+                       if (strlen(para) != 0)
+                       {
+                               return  mp_obj_new_int(atoi(para));
+                       }
+               }
+               return mp_obj_new_int(-1);
+       }
+       else
+       {
+               uint8_t mode = (uint8_t)mp_obj_get_int(args[0]);
+               if (mode == 0) 
+               {       
+                       if(Helios_Atcmd_Send_Sync(0, "AT+QNWCFG=\"causeinfo\",0\r\n", NULL, 0, NULL, 10) == HELIOS_AT_RESP_OK) 
+                       {
+                               ret = 0;
+                       }
+               }
+               else if(mode == 1)
+               {
+                       if(Helios_Atcmd_Send_Sync(0, "AT+QNWCFG=\"causeinfo\",1\r\n", NULL, 0, NULL, 10) == HELIOS_AT_RESP_OK) 
+                       {       
+                               if(Helios_Atcmd_Send_Sync(0,  "AT+QURCCFG=\"URCPORT\",\"DAM\"\r\n", NULL, 0, NULL, 10) == HELIOS_AT_RESP_OK) 
+                               {
+                                       ret = 0;
+                               }
+                       }
+               }
+               else
+               {
+                       mp_raise_ValueError("invalid value, mode should be 0 or 1.");
+               }
+       }
+       return mp_obj_new_int(ret);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(qpy_net_set_cause_info_obj, 0, 1, qpy_net_set_cause_info);
 #endif
 
 
@@ -2558,6 +2654,7 @@ STATIC const mp_rom_map_elem_t net_module_globals_table[] = {
        { MP_ROM_QSTR(MP_QSTR_getTPTW),                  MP_ROM_PTR(&qpy_net_get_TPTW_obj) },
        { MP_ROM_QSTR(MP_QSTR_getqRxlevMin),             MP_ROM_PTR(&qpy_net_get_qRxlevMin_obj) },
        { MP_ROM_QSTR(MP_QSTR_getRejectCause),           MP_ROM_PTR(&qpy_net_get_reject_cause_obj) },
+       { MP_ROM_QSTR(MP_QSTR_causeInfo),            MP_ROM_PTR(&qpy_net_set_cause_info_obj) },
 #endif
 };
 
index 81a5bed..7338906 100644 (file)
@@ -16,6 +16,13 @@ extern const mp_obj_type_t wlan_netif_type;
 extern const mp_obj_type_t wlan_ASR5803W_type;
 #endif
 
+#if MICROPY_QPY_NETWORK_WLAN_962K
+extern const mp_obj_type_t wlan_FCM962K_type;
+#endif
+
+#if MICROPY_QPY_NETWORK_WLAN_360W
+extern const mp_obj_type_t wlan_FCM360W_type;
+#endif
 
 STATIC const mp_rom_map_elem_t network_globals_table[] = {
     {MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_network)},
@@ -25,6 +32,12 @@ STATIC const mp_rom_map_elem_t network_globals_table[] = {
 #if MICROPY_QPY_NETWORK_WLAN_5803W
     {MP_OBJ_NEW_QSTR(MP_QSTR_ASR5803W), MP_ROM_PTR(&wlan_ASR5803W_type)},
 #endif
+#if MICROPY_QPY_NETWORK_WLAN_962K
+       {MP_OBJ_NEW_QSTR(MP_QSTR_FCM962K), MP_ROM_PTR(&wlan_FCM962K_type)},
+#endif
+#if MICROPY_QPY_NETWORK_WLAN_360W
+    {MP_OBJ_NEW_QSTR(MP_QSTR_FCM360W), MP_ROM_PTR(&wlan_FCM360W_type)},
+#endif
 
 #if MICROPY_QPY_NETWORK_WLAN
     { MP_ROM_QSTR(MP_QSTR_NONE_MODE), MP_ROM_INT(HELIOS_WLAN_MODE_NONE)},
index d39d324..d077abb 100644 (file)
 #include "helios_lcd.h"
 #include "QR_Encode.h"
 
+
+enum{
+       QPY_QRCODE_ROTATE_0 = 0,
+       QPY_QRCODE_ROTATE_90,
+       QPY_QRCODE_ROTATE_180,
+       QPY_QRCODE_ROTATE_270,
+       QPY_QRCODE_ROTATE_MAX
+};
+
 unsigned short *qrcode_data = NULL;
+
 static Helios_Mutex_t  qrcode_MutexRef = 0;
 
+static int qrcode_rgb565_clockwise_rotate(unsigned char *src, int srcWidth, int srcHeight, int rotate)
+{
+    int n = 0;
+    int bitDepth = 2;
+    int i,j;
+    int pix = srcWidth*srcHeight;
+       unsigned char *des = NULL;
+
+    if ((!src) || (pix <= 0) || (rotate >= QPY_QRCODE_ROTATE_MAX) )
+    {
+        return -1;
+    }
+       des = calloc(srcWidth*srcHeight, bitDepth);
+       if(NULL == des)
+    {
+        return -1;
+    }          
+       
+    if (QPY_QRCODE_ROTATE_90 == rotate)
+    {
+        for (j=0; j<srcWidth; j++)
+        {
+            for (i=srcHeight; i>0; i--)
+            {
+                memcpy(&des[n], &src[(srcWidth*(i-1) + j/* - 1*/)*bitDepth], bitDepth);
+                n += bitDepth;
+            }
+        }
+    }
+    else if (QPY_QRCODE_ROTATE_180 == rotate)
+    {
+        for (i=0; i<pix; i++)
+        {
+            memcpy(&des[n], &src[(pix - i)*bitDepth], bitDepth);
+            n += bitDepth;
+        }
+    }
+    else if (QPY_QRCODE_ROTATE_270 == rotate)
+    {
+        for (j=srcWidth; j>0; j--)
+        {
+            for (i=0; i<srcHeight; i++)
+            {
+                memcpy(&des[n], &src[(srcWidth*i + j - 1)*bitDepth], bitDepth);
+                n += bitDepth;
+            }
+        }
+    }
+    else /* if (QPY_QRCODE_ROTATE_0 == rotate) */
+    {
+        goto end;
+    }
+       
+       memcpy(&src[0], &des[0], srcWidth*srcHeight*bitDepth);
+
+end:
+       if(des){
+               free(des);
+       }
+
+    return 0;
+}
+
 
 static int qrcode_amplification(unsigned int qrcode_size, unsigned int magnification,
                unsigned short Background_color, unsigned short Foreground_color) {
@@ -74,14 +147,14 @@ static int qrcode_amplification(unsigned int qrcode_size, unsigned int magnifica
 
                }
        }
-
        return 0;
        
 }
 
 
+               
 int qpy_qrcode_show(char *qrcode_str, unsigned int magnification, 
-       unsigned int start_x, unsigned start_y,unsigned short Background_color, unsigned short Foreground_color) {
+       unsigned int start_x, unsigned start_y,unsigned short Background_color, unsigned short Foreground_color, int rotate) {
 
        int ret = 0;
        
@@ -103,6 +176,11 @@ int qpy_qrcode_show(char *qrcode_str, unsigned int magnification,
                ret = -2;
                goto lopo;
        }
+
+       if(rotate != 0){
+               qrcode_rgb565_clockwise_rotate((unsigned char*)qrcode_data, qrcode_size*magnification, qrcode_size*magnification, rotate);
+       }
+
        if(Helios_LCD_Write((unsigned char*)qrcode_data, start_x, start_y, start_x+qrcode_size*magnification-1, start_y+qrcode_size*magnification-1) != 0) {
                ret = -3;
                goto lopo;
@@ -135,18 +213,26 @@ STATIC mp_obj_t qrcode_show(size_t n_args, const mp_obj_t *args)
 
        unsigned short Background_color = 0xffff;
        unsigned short Foreground_color = 0x0000;
+       int qrcode_rotate_set = 0;
        
 
-       if(n_args == 6) {
+       if(n_args > 4) {
                Background_color = (unsigned short)mp_obj_get_int(args[4]);
-               Foreground_color = (unsigned short)mp_obj_get_int(args[5]);
+               if(n_args > 5){
+                       Foreground_color = (unsigned short)mp_obj_get_int(args[5]);
+                       if(n_args == 7){
+                               qrcode_rotate_set = mp_obj_get_int(args[6]);
+                               if(qrcode_rotate_set >= QPY_QRCODE_ROTATE_MAX){
+                                       mp_raise_ValueError("Rotate value error");
+                               }
+                       }
+               }
        } 
-
                        
-       ret = qpy_qrcode_show((char*)qrcode_str, magnification, start_x,start_y,Background_color,Foreground_color);
+       ret = qpy_qrcode_show((char*)qrcode_str, magnification, start_x,start_y,Background_color,Foreground_color, qrcode_rotate_set);
        return mp_obj_new_int(ret);
 }
-STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(qrcode_show_obj, 4, 6, qrcode_show);
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(qrcode_show_obj, 4, 7, qrcode_show);
 
 STATIC mp_obj_t qrcode_getData(size_t n_args, const mp_obj_t *args)
 {
@@ -156,8 +242,7 @@ STATIC mp_obj_t qrcode_getData(size_t n_args, const mp_obj_t *args)
 
        int magnification = mp_obj_get_int(args[1]);
        if(magnification < 1 || magnification > 6) mp_raise_ValueError("Wrong magnification");
-
-
+       
        unsigned short Background_color = 0xffff;
        unsigned short Foreground_color = 0x0000;
        
@@ -207,6 +292,10 @@ STATIC const mp_rom_map_elem_t mp_module_qrcode_globals_table[] = {
     { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_qrcode) },
     { MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&qrcode_show_obj) },
     { MP_ROM_QSTR(MP_QSTR_getQRData), MP_ROM_PTR(&qrcode_getQRData_obj) },
+    { MP_ROM_QSTR(MP_QSTR_ROTATE_0),   MP_ROM_INT(QPY_QRCODE_ROTATE_0)},
+    { MP_ROM_QSTR(MP_QSTR_ROTATE_90),  MP_ROM_INT(QPY_QRCODE_ROTATE_90)},
+    { MP_ROM_QSTR(MP_QSTR_ROTATE_180), MP_ROM_INT(QPY_QRCODE_ROTATE_180)},
+    { MP_ROM_QSTR(MP_QSTR_ROTATE_270), MP_ROM_INT(QPY_QRCODE_ROTATE_270)},
 };
 STATIC MP_DEFINE_CONST_DICT(mp_module_qrcode_globals, mp_module_qrcode_globals_table);
 
index 2ef9b55..e865259 100644 (file)
@@ -257,7 +257,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(qpy_sms_send_pdu_msg_obj, 3, 4, qpy_s
  *    -1       -       error
  */
 /*=============================================================================*/
-#if !defined(PLAT_Unisoc_8850) && !defined(PLAT_RDA)
+#if !defined(PLAT_Unisoc_8850) && !defined(PLAT_RDA) && !defined(PLAT_Unisoc_8850_R02) 
 STATIC mp_obj_t qpy_sms_delete_msg(size_t n_args, const mp_obj_t *args)
 {
     int ret = 0;
index 4b65d6d..cc94e0c 100644 (file)
@@ -431,7 +431,7 @@ STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type_in, size_t n_args, siz
     sock->fd = lwip_socket(sock->domain, sock->type, sock->proto);
 #endif
 
-    mp_printf(&mp_plat_print, "[modsocket] socket makenew socket->fd = %d\r\n", sock->fd);
+    //mp_printf(&mp_plat_print, "[modsocket] socket makenew socket->fd = %d\r\n", sock->fd);
 
     if (sock->fd < 0) {
                QPY_SOCKET_LOG("lwip_socket: create socket failed!\r\n");
@@ -2422,7 +2422,7 @@ STATIC mp_uint_t socket_stream_ioctl(mp_obj_t self_in, mp_uint_t request, uintpt
         return ret;
     } else if (request == MP_STREAM_CLOSE) {
     
-        mp_printf(&mp_plat_print, "[modsocket] socket close socket->fd = %d\r\n", socket->fd);
+        //mp_printf(&mp_plat_print, "[modsocket] socket close socket->fd = %d\r\n", socket->fd);
         if (socket->fd >= 0) {
 #if MICROPY_QPY_MODULE_WIFI
             if (!wifi_flag) {
@@ -2489,7 +2489,7 @@ STATIC mp_uint_t socket_stream_ioctl(mp_obj_t self_in, mp_uint_t request, uintpt
 #if defined(PLAT_Qualcomm)
             QPY_SOCKET_LOG("lwip_close[%d] ret:%d errno:%d \n", socket->fd, ret, errno(socket->fd));
 #endif
-            mp_printf(&mp_plat_print, "[modsocket] socket close ret = %d && errno = %d \r\n", ret, errno);
+            //mp_printf(&mp_plat_print, "[modsocket] socket close ret = %d && errno = %d \r\n", ret, errno);
 
             if (ret != 0) {
 #if defined(PLAT_Qualcomm) || defined(PLAT_EIGEN) || defined(PLAT_EIGEN_718)
index c0dec74..6f62e4c 100644 (file)
@@ -273,7 +273,7 @@ STATIC mp_obj_t time_mktime_ex(mp_obj_t tuple) {
        time_unix = (((
                ( mp_uint_t ) (rtc_tm.tm_year/4 - rtc_tm.tm_year/100 + rtc_tm.tm_year/400
                + 367*rtc_tm.tm_mon/12 + rtc_tm.tm_mday) + rtc_tm.tm_year*365 - 719499)*24
-               + rtc_tm.tm_hour)*60 + rtc_tm.tm_min)*60 + rtc_tm.tm_sec - Helios_RTC_GetTimeZoneOffset() * 3600;       
+               + rtc_tm.tm_hour)*60 + rtc_tm.tm_min)*60 + rtc_tm.tm_sec - ( mp_uint_t ) (Helios_RTC_GetTimeZoneOffset() * 3600);       
 
        return mp_obj_new_int_from_uint(time_unix);
 }
index 8cdf53b..2816403 100644 (file)
@@ -596,7 +596,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(qpy_voicecall_get_volume_obj, qpy_voicecall_get
 #endif
 
 // #if defined(PLAT_ASR) || defined(PLAT_Unisoc)
-#if    defined(PLAT_Unisoc_8850_R02)
+#if    defined(PLAT_Unisoc_8850_R02) || defined(BOARD_EC800MCN_LE_CPE)
 #define MAX_FILENAME_LENTGH 64
 #else
 #define MAX_FILENAME_LENTGH 32
@@ -623,7 +623,6 @@ STATIC mp_obj_t qpy_voice_call_set_auto_record(size_t n_args, const mp_obj_t *ar
     {
                mp_raise_msg_varg(&mp_type_ValueError, "invalid value.<filename length> should be less than %d.", MAX_FILENAME_LENTGH);
     }
-
        if (strncasecmp(filename, "U:/", 3) != 0)
        {
                if (strncasecmp(filename, "/usr/", 5) == 0)
@@ -636,11 +635,15 @@ STATIC mp_obj_t qpy_voice_call_set_auto_record(size_t n_args, const mp_obj_t *ar
                }
                else if (strncasecmp(filename, "SD:/", 4) == 0)
                {
-                       strncpy(fpath, filename, strlen(filename));
+                       sprintf(fpath, "SD:/%s", (filename + 4));
+               }
+        else if (strncasecmp(filename, "/sd/", 4) == 0)
+               {
+                       sprintf(fpath, "SD:/%s", (filename + 4));
                }
                else if (strncasecmp(filename, "SD1:/", 5) == 0)
                {
-                       strncpy(fpath, filename, strlen(filename));
+                       sprintf(fpath, "SD:/%s", (filename + 5));
                }
         else if (strncasecmp(filename, "/ext/", 5) == 0)
                {
@@ -701,35 +704,39 @@ STATIC mp_obj_t qpy_voice_call_start_record(mp_obj_t mp_obj_recordtype, mp_obj_t
         mp_raise_msg_varg(&mp_type_ValueError, "invalid value.<filename length> should be less than %d.", MAX_FILENAME_LENTGH);
     }
 
-       if (strncmp(filename, "U:/", 3) != 0)
+       if (strncasecmp(filename, "U:/", 3) != 0)
        {
-               if (strncmp(filename, "/usr/", 5) == 0)
+               if (strncasecmp(filename, "/usr/", 5) == 0)
                {
                        sprintf(fpath, "U:/%s", (filename + 5));
                }
-               else if (strncmp(filename, "usr/", 4) == 0)
+               else if (strncasecmp(filename, "usr/", 4) == 0)
                {
                        sprintf(fpath, "U:/%s", (filename + 4));
                }
-               else if (strncmp(filename, "SD:/", 4) == 0)
+               else if (strncasecmp(filename, "SD:/", 4) == 0)
                {
-                       strncpy(fpath, filename, strlen(filename));
+                       sprintf(fpath, "SD:/%s", (filename + 4));
                }
-               else if (strncmp(filename, "SD1:/", 5) == 0)
+        else if (strncasecmp(filename, "/sd/", 4) == 0)
                {
-                       strncpy(fpath, filename, strlen(filename));
+                       sprintf(fpath, "SD:/%s", (filename + 4));
                }
-        else if (strncmp(filename, "/ext/", 5) == 0)
+               else if (strncasecmp(filename, "SD1:/", 5) == 0)
+               {
+                       sprintf(fpath, "SD:/%s", (filename + 5));
+               }
+        else if (strncasecmp(filename, "/ext/", 5) == 0)
                {
                        sprintf(fpath, "E:/%s", (filename + 5));
                }
-               else if (strncmp(filename, "ext/", 4) == 0)
+               else if (strncasecmp(filename, "ext/", 4) == 0)
                {
                        sprintf(fpath, "E:/%s", (filename + 4));
                }
                else
                {
-                       mp_raise_ValueError("invalid path, only support \"U:/\",\"/usr/\" and \"usr/\"");
+                       mp_raise_ValueError("Invalid path, case - insensitive is supported \"U:/\",\"SD:/\",\"SD1:/\",\"/ext/\",\"ext/\",\"/usr/\" and \"usr/\"");
                }
        }
        else
index 5cc0c68..156c718 100644 (file)
@@ -1018,6 +1018,9 @@ STATIC mp_obj_t network_wlan_config(size_t n_args, const mp_obj_t* args, mp_map_
                     case MP_QSTR_ap_password: {
                         size_t len;
                         const char* s = mp_obj_str_get_data(kwargs->table[i].value, &len);
+                        if(len > sizeof(self->wlan_config.ap.password) - 1){
+                            return MP_OBJ_NEW_SMALL_INT(HELIOS_WLAN_ERROR_PARAM_INVALID);
+                        }
                         len = MIN(len, sizeof(self->wlan_config.ap.password) - 1);
                         memset(ap_config_cp.password, 0x0, sizeof(self->wlan_config.ap.password));
                         memcpy(ap_config_cp.password, s, len);
index aa82c7e..c12d692 100644 (file)
@@ -44,7 +44,7 @@
 
 #include "helios_debug.h"
 
-#define QPY_5803W_LOG(msg, ...)      custom_log("ALIPAY", msg, ##__VA_ARGS__)
+#define QPY_5803W_LOG(msg, ...)      custom_log("WLAN", msg, ##__VA_ARGS__)
 
 /*定义wlan_5803_obj_t结构体*/
 typedef struct _wlan_5803_obj_t
@@ -608,7 +608,7 @@ STATIC const mp_rom_map_elem_t ASR5803W_locals_dict_table[] = {
 STATIC MP_DEFINE_CONST_DICT(ASR5803W_locals_dict, ASR5803W_locals_dict_table);
 
 const mp_obj_type_t wlan_ASR5803W_type = {
-    .base={ &mp_type_type }, 
+    .base={ &mp_type_type },
     .name = MP_QSTR_5803W,
     .make_new = wlan_5803W_make_new,
     .locals_dict = (mp_obj_dict_t*)&ASR5803W_locals_dict,
index 4066f3a..14fc92b 100644 (file)
@@ -87,7 +87,7 @@
 #elif defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8850_R02)
        #if defined(BOARD_EC600GCN_LD) || defined(BOARD_EC800GCN_LD) || defined(BOARD_EC800GCN_LD_XBND) \
        || defined(BOARD_EC800GCN_LD_HRXM) || defined(BOARD_EC600GCN_LD_YM) || defined(BOARD_EC800GCN_TT) \
-       || defined(BOARD_EG800GLA_LD)
+       || defined(BOARD_EG800GLA_LD) || defined(BOARD_EG800GEU_LD)
                #define MP_QPY_TASK_STACK_SIZE      (16 * 1024)
        #else
                #define MP_QPY_TASK_STACK_SIZE      (64 * 1024)
 #define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE     (256)
 //==End
 
-#if MICROPY_QPY_ETHERNET_W5500 || MICROPY_QPY_MISC_USBNET
+/*#if MICROPY_QPY_ETHERNET_W5500 || MICROPY_QPY_MISC_USBNET
 #define MICROPY_PY_ENABLE_WEBSERVER    (MICROPY_QPY_PY_ENABLE_WEBSERVER)
 #else
 #define MICROPY_PY_ENABLE_WEBSERVER    (0)
-#endif
+#endif*/
+#define MICROPY_PY_ENABLE_WEBSERVER    (0)
 
 
 #define UINT_FMT "%lu"
@@ -428,6 +429,20 @@ extern const struct _mp_obj_module_t mp_module_rsa;
 #define MICROPY_PORT_BUILTIN_MODULES_URSA
 #endif
 
+#if MICROPY_QPY_MODULE_SFTP
+extern const struct _mp_obj_module_t mp_module_usftp;
+#define MICROPY_PORT_BUILTIN_MODULES_SFTP        { MP_OBJ_NEW_QSTR(MP_QSTR_usftp), (mp_obj_t)&mp_module_usftp },
+#else
+#define MICROPY_PORT_BUILTIN_MODULES_SFTP
+#endif
+
+#if MICROPY_QPY_MODULE_SSH
+extern const struct _mp_obj_module_t mp_module_ussh;
+#define MICROPY_PORT_BUILTIN_MODULES_SSH         { MP_OBJ_NEW_QSTR(MP_QSTR_ussh), (mp_obj_t)&mp_module_ussh },
+#else
+#define MICROPY_PORT_BUILTIN_MODULES_SSH
+#endif
+
 #if MICROPY_QPY_MODULE_MISC
 extern const struct _mp_obj_module_t mp_module_misc;
 #define MICROPY_PORT_BUILTIN_MODULES_MISC           { MP_OBJ_NEW_QSTR(MP_QSTR_misc), (mp_obj_t)&mp_module_misc},
@@ -713,6 +728,13 @@ extern const struct _mp_obj_type_t module_lwm2m_type;
 #define MICROPY_PORT_BUILTIN_MODULES_LWM2M
 #endif
 
+#if MICROPY_QPY_MODULE_DLMS
+extern const struct _mp_obj_module_t mp_module_dlms;
+#define MICROPY_PORT_BUILTIN_MODULES_DLMS              { MP_OBJ_NEW_QSTR(MP_QSTR_dlms), (mp_obj_t)&mp_module_dlms},
+#else
+#define MICROPY_PORT_BUILTIN_MODULES_DLMS
+#endif
+
 #if MICROPY_QPY_MODULE_NB
 extern const struct _mp_obj_module_t mp_module_nb;
 #define MICROPY_PORT_BUILTIN_MODULES_NB                    { MP_OBJ_NEW_QSTR(MP_QSTR_nb), (mp_obj_t)&mp_module_nb},
@@ -863,6 +885,13 @@ extern const struct _mp_obj_type_t mp_ipsec_type;
 #define MICROPY_PORT_BUILTIN_MODULES_IPSEC
 #endif
 
+#if CONFIG_TIKTIK_RTC
+extern const struct _mp_obj_type_t TiktokRTC_type;
+#define MICROPY_PORT_BUILTIN_MODULES_TiktokRTC         { MP_OBJ_NEW_QSTR(MP_QSTR_TiktokRTC), (mp_obj_t)&TiktokRTC_type},
+#else
+#define MICROPY_PORT_BUILTIN_MODULES_TiktokRTC
+#endif
+
 //////////////////
 
 #define MICROPY_PORT_BUILTIN_MODULES \
@@ -911,6 +940,8 @@ extern const struct _mp_obj_type_t mp_ipsec_type;
                MICROPY_PORT_BUILTIN_MODULES_CSD        \
                MICROPY_PORT_BUILTIN_MODULES_LWM2M \
                MICROPY_PORT_BUILTIN_MODULES_URSA \
+               MICROPY_PORT_BUILTIN_MODULES_SFTP \
+               MICROPY_PORT_BUILTIN_MODULES_SSH \
                MICROPY_PORT_BUILTIN_MODULES_NB \
                MICROPY_PORT_BUILTIN_MODULES_WEBSERVER \
                MICROPY_PORT_BUILTIN_MODULES_G711 \
@@ -934,7 +965,9 @@ extern const struct _mp_obj_type_t mp_ipsec_type;
                MICROPY_PORT_BUILTIN_MODULES_STK \
                MICROPY_PORT_BUILTIN_MODULES_ALIPAY_SE \
                MICROPY_PORT_BUILTIN_MODULES_VOIP \
-               MICROPY_PORT_BUILTIN_MODULES_IPSEC
+               MICROPY_PORT_BUILTIN_MODULES_IPSEC \
+               MICROPY_PORT_BUILTIN_MODULES_DLMS \
+               MICROPY_PORT_BUILTIN_MODULES_TiktokRTC
 
                
 
index 6993432..3740e03 100644 (file)
@@ -378,6 +378,51 @@ class BaseMqtt(object):
         self.qos = qos
         self.__subscribe(topic, qos=qos, sock=sock)
 
+    def unsubscribe(self, topic):
+        if topic not in self.topic_list:
+            mqtt_log.warning("Topic Not Subscribed")
+            return False
+        else:
+            pkt = bytearray(b"\xa2\0\0\0")
+            pid = next(self.__newpid)
+            self.SERVERACK.add(pid)
+            struct.pack_into("!BH", pkt, 1, 2 + 2 + len(topic), pid)
+            senddata = pkt + struct.pack("!H", len(topic)) + topic
+            while True:
+                try:
+                    if self.mqttsendlock.locked():
+                        utime.sleep_ms(10)
+                        continue
+                    self.mqttsendlock.acquire()
+                    self.sock.write(senddata)
+                    self.mqttsendlock.release()
+                    return
+                except Exception as e:
+                    mqtt_log.warning("unsubscribe Pid[%s] ACK OSError[%s]." %(pid,  str(e)))
+                    if self.mqttsendlock.locked():
+                        self.mqttsendlock.release()
+                    return
+            if self.ssl == False:
+                self.sock.settimeout(5)
+            while True:
+                if self.wait_flag == 0:
+                    if self.mqttmsglock.locked():
+                        self.topic_list.remove(topic)
+                        return True
+                    op = self.wait_msg()
+                    print("unsubscribe wait_msg op:",op)
+                    if op == 0x90:
+                        self.topic_list.remove(topic)
+                        return True
+                    else:
+                        return False
+                else:
+                    if not self._await_pid(pid):
+                        return False
+                    else:
+                        self.topic_list.remove(topic)
+                        return True
+
     def publish_ack(self, pid):
         pkt = bytearray(b"\x40\x02\0\0")
         struct.pack_into("!H", pkt, 2, pid)
@@ -434,6 +479,19 @@ class BaseMqtt(object):
             else:
                 return
 
+        if res == b'\xb0':  # Unsubscribe Ack: save pid
+            sz = self.sock.read(1)
+            if sz != b"\x02":
+                mqtt_log.warning("Unsubscribe message does not return ACK correctly")
+                return
+            rcv_pid = self.sock.read(2)
+            pid = rcv_pid[0] << 8 | rcv_pid[1]
+            if pid in self.SERVERACK:
+                self.SERVERACK.discard(pid)
+                return
+            else:
+                return
+
         sub_ack = res[0]
         if (sub_ack & 0xf0) == 0x90:  # SUBSCRIBE:
             resp = self.sock.read(4)
index 7965964..f82c0ab 100644 (file)
@@ -62,4 +62,24 @@ int Helios_Dev_Backup();
 int Helios_Dev_Backup_Status(Helios_DevBackupStatusStruct *backupStatus);
 #endif
 
+#ifdef CONFIG_MICROPYTHON_EXTENSION_SECURE_APP
+bool Helios_Dev_SecureBootEnableState(void);
+
+#if defined (PLAT_Unisoc)
+int Helios_Dev_EnableSecureBoot(void);
+bool Helios_Dev_SecureSigCheck(const void *buf, uint32_t len, const void *sig);
+bool Helios_Dev_SecureEmbedSigCheck(const void *buf, uint32_t len);
+void* Helios_Dev_SecureAppCheckInit(const void *sig);
+void Helios_Dev_SecureAppCheckDelete(const void *checker);
+void Helios_Dev_SecureAppCheckUpdate(const void *checker, const void *data, uint32_t size);
+bool Helios_Dev_SecureAppCheckFinal(const void *checker);
+#endif // End PLAT_Unisoc
+
+#if defined (PLAT_ASR_1803sc) || defined (PLAT_ASR_1803s)
+int Helios_Dev_SecureAppInit(void);
+int Helios_Dev_SecureAppGetPubKey(unsigned char pub_E[3], unsigned char pub_N[256]);
+#endif // End PLAT_ASR_1803sc
+
+#endif // End CONFIG_MICROPYTHON_EXTENSION_SECURE_APP
+
 #endif
index 8ea3903..7c5442a 100644 (file)
@@ -233,7 +233,9 @@ typedef void (*Helios_esim_cb_t)(uint8_t sim_id, unsigned int ind_flag, void *co
 #define ESIM_ICCID_MAX_LEN            20
 #define ESIM_NICKNAME_MAX_LEN         64
 #define ESIM_PROVIDER_NAME_MAX_LEN    64
-
+#if MICROPY_QPY_MODULE_ESIM_SUPPORT_APN
+#define ESIM_APN_LEN                  64
+#endif
 typedef struct {
        char iccid[ESIM_ICCID_MAX_LEN+1];
        uint8_t status;
@@ -265,9 +267,20 @@ typedef struct {
     ESIM_Profile_List profile_list[ESIM_LPA_PROFILE_LIST_MAX_NUM];
 } Helios_Esim_Profilelistinfo_Struct;
 
+typedef enum
+{
+    ESIM_NOTIFICATION_TYPE_INSTALL = 0,
+    ESIM_NOTIFICATION_TYPE_ENABLE,
+    ESIM_NOTIFICATION_TYPE_DISABLE,
+    ESIM_NOTIFICATION_TYPE_DELETE
+} Helios_Esim_Notification_By_Seqnum;
+
 typedef struct {
     uint32_t seqnum;
     char iccid[ESIM_ICCID_MAX_LEN+1];
+    #if MICROPY_QPY_MODULE_ESIM_SUPPORT_NTF_SEQNUM
+    uint16_t ntf_event;     //Ewan.liu add in  24.09.25
+    #endif
 }Helios_Esim_Notifications_Info;
 
 
@@ -287,11 +300,21 @@ int Helios_Esim_LPA_Profile_Ota(char *activationCode, char *confirmationCode);
 
 int Helios_Esim_LPA_Add_Event_Handler(Helios_esim_cb_t handlerPtr);
 
+int Helios_Esim_LPA_Get_Notifications(Helios_Esim_Notifications_Info_List *info);
+
 int Helios_Esim_LPA_Report_Notifications(char *iccid);
 
+#if MICROPY_QPY_MODULE_ESIM_SUPPORT_NTF_SEQNUM
+int Helios_Esim_LPA_Get_Notifications_By_Seqnum(Helios_Esim_Notification_By_Seqnum seqnum, Helios_Esim_Notifications_Info_List *info);
+int Helios_Esim_LPA_Report_Notifications_By_Seqnum(uint32_t seqnum);
+#endif
+
 int Helios_Esim_LPA_Remove_Notifications(uint32_t seqnum);
 
-int Helios_Esim_LPA_Get_Notifications(Helios_Esim_Notifications_Info_List *info);
+#if MICROPY_QPY_MODULE_ESIM_SUPPORT_APN
+int Helios_Esim_LPA_Get_Apn(char *apn,int len);
+int Helios_Esim_LPA_Set_Apn(char *apn,int len);
+#endif
 
 #if MICROPY_QPY_MODULE_ESIM_LPA_SET_TIMEOUT
 int Helios_Esim_LPA_Set_Cmd_Timeout(int timeout);
index 6cbc83d..5f063ca 100644 (file)
@@ -33,6 +33,9 @@ int Helios_Fota_PackageWrite(int hdl, void *data, size_t len, size_t file_size);
 int Helios_Fota_PackageFlush(int hdl);
 int Helios_Fota_PackageVerify(int hdl);
 int Helios_Fota_firmware_download(char * address1, char * address2, void(*cb)(int sta, int progress));
+#if defined(BOARD_BG95M9)
+int Helios_Fota_firmware_download_at(char * address1, char * address2, void(*cb)(int sta, int progress));
+#endif
 void Helios_Fota_Deinit(int hdl);
 int Helios_Fota_Set_PublicKey(unsigned char* key, int key_len);
 
index 71e97da..1bb2fb1 100644 (file)
@@ -84,7 +84,7 @@ void* Helios_vfs_get_vfsobj_by_PYPath(const char *python_path);
 #if defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1803sc)
 
 #define ASR_SDIO_SD_VOLUME                     "C:"
-HeliosFILE *Helios_fat_fopen(const char *fname, const char *mode);
+HeliosFILE *Helios_fat_fopen(const char *fname, int mode);
 int Helios_fat_fclose(HeliosFILE *file);
 int Helios_fat_remove(const char *fname);
 int Helios_fat_fwrite(void *buffer, size_t size, size_t num, HeliosFILE *file);
index 21cdc02..1a35b60 100644 (file)
@@ -710,7 +710,7 @@ uint32_t Helios_get_current_profileID();
        || defined(BOARD_EC600MCN_LE_POC_QS) || defined(BOARD_EC600MCN_CC) || defined(BOARD_EC600MCN_LE_VOLTE) \
        || defined(BOARD_EC600MCN_CC_EXT)|| defined(BOARD_EC600MCN_LF_SLPOC) || defined(BOARD_EC600MCN_CC_EXT_TTS) \
     || defined(BOARD_EC800MCN_CC_TTS) || defined(BOARD_EC800KCN_CC_TTS) || defined(BOARD_EC600KCN_CC_TTS) \
-       || defined(BOARD_EC600MEU_LA_POC_XBND) || defined(BOARD_EC600MLA_LA_POC_XBND)
+       || defined(BOARD_EC600MEU_LA_POC_XBND) || defined(BOARD_EC600MLA_LA_POC_XBND) || defined(BOARD_EC600MLA_LA)
 
 int Helios_Audio_Play_Tone(int f1, int f2);
 #else
@@ -759,7 +759,7 @@ typedef struct {
 } Helios_PCM_CONFIG_T;
 
 
-#if CONFIG_AUDIO
+#if defined(CONFIG_AUDIO) && !defined(CONFIG_ONLY_USE_RECORD_MP3)
 void *Helios_PCM_Open(unsigned int channels, unsigned int samplerate, unsigned int flags);
 #else
 void *Helios_PCM_Open(Helios_PCM_CONFIG_T *pcm_para, unsigned int flags);
@@ -803,7 +803,7 @@ typedef enum {
     YDWL_TTS_EVT_INIT         = 0,
     YDWL_TTS_EVT_DEINIT,
     YDWL_TTS_EVT_PLAY_START,
-    YDWL_TTS_EVT_COMPOSITE_OVER,      //语é\9f³å\90\88æ\88\90å®\8cæ\88\90ï¼\8cä½\86æ\92­æ\94¾æ\9cªå®\8c�?
+    YDWL_TTS_EVT_COMPOSITE_OVER,      //语é\9f³å\90\88æ\88\90å®\8cæ\88\90ï¼\8cä½\86æ\92­æ\94¾æ\9cªå®\8cï¿??
     YDWL_TTS_EVT_PLAY_STOP,           //not used
     YDWL_TTS_EVT_PLAY_FINISH,         //TTS语音播放完成
     YDWL_TTS_EVT_PLAY_FAILED,         //not used
@@ -883,6 +883,17 @@ int Helios_Audio_Get_Denoise_Lib_Version(unsigned char *version);
 int Helios_PCM_Get_Write_Frame_Count(void* handle);
 
 int Helios_PCM_Reset_Write_Buffer(void* handle);
+
+
+#if CONFIG_ONLY_USE_RECORD_MP3
+
+int Helios_Audio_FileRecordStart_py(char* name, Helios_AUDRecordInitStruct* record_para);
+int Helios_Audio_FileRecordStop_py();
+int Helios_Audio_StreamRecordStart_py(Helios_AUDRecordInitStruct* record_para);
+int Helios_Audio_StreamRecordStop_py();
+
+#endif /*CONFIG_ONLY_USE_RECORD_MP3*/
+
 #endif
 
 #ifdef __cplusplus
index b75d763..fc9362b 100644 (file)
@@ -266,8 +266,11 @@ typedef struct {
   int8_t str5_Paging_time_window[5];
 }Helios_edrx_info;
 #endif
-
+#if defined(BOARD_BG95M9)
+int Helios_LPM_Set_PsmTime(uint32_t mode,uint32_t tau_uint,uint32_t tau_time,uint32_t act_uint,uint32_t act_time,void(*cb)(int tau_time_cb, int act_time_cb));
+#else
 int Helios_LPM_Set_PsmTime(uint32_t mode,uint32_t tau_uint,uint32_t tau_time,uint32_t act_uint,uint32_t act_time);
+#endif
 
 int Helios_LPM_get_PsmTime(Helios_psm_info *psm_info);
 #if defined(PLAT_RDA)
index cca1ad9..4375b64 100644 (file)
@@ -235,7 +235,8 @@ extern "C" {
        || defined(BOARD_EC800GCN_LB) \
        || defined(BOARD_EC800GCN_TT)\
        || defined(BOARD_EC800GCN_GA_VOLTE) \
-       || defined(BOARD_EG800GLA_LD)
+       || defined(BOARD_EG800GLA_LD) \
+       || defined(BOARD_EG800GEU_LD)
 #define PLAT_GPIO_NUM 50
 #elif defined(BOARD_EC600GCN_LD) \
        || defined(BOARD_EC600GCN_LA) \
@@ -260,7 +261,8 @@ extern "C" {
        || defined(BOARD_EC600MCN_CC_EXT) ||  defined(BOARD_EC600MCN_LF_SLPOC) || defined(BOARD_EC600MCN_CC_EXT_TTS) \
        || defined(BOARD_EC600MCN_LE_ALIPAY) || defined(BOARD_EC600MCN_LE_BTZ) || defined(BOARD_EC600MEU_LA) \
        || defined(BOARD_EC600MEU_LA_POC_XBND) || defined(BOARD_EC600MCN_LF_QS) || defined(BOARD_EC600MLA_LA_POC_XBND) \
-       || defined(BOARD_EC600MEU_LA_POC_QS) || defined(BOARD_EC600MLA_LA_POC_QS)
+       || defined(BOARD_EC600MEU_LA_POC_QS) || defined(BOARD_EC600MLA_LA_POC_QS) || defined(BOARD_EC600MCN_LE_POC_XBND_EN) \
+       || defined(BOARD_EC600MLA_LA)
 #define PLAT_GPIO_NUM 45
 #elif defined(BOARD_EC800MCN_LA) || defined(BOARD_EC800MCN_GA)  || defined(BOARD_EC800MCN_LE) \
     || defined(BOARD_EC800MCN_LA_VOLTE) || defined(BOARD_EC800MCN_GC) || defined(BOARD_EC800MCN_LC) \
@@ -274,7 +276,7 @@ extern "C" {
        || defined(BOARD_EC800MCN_LF_CCG) || defined(BOARD_EG810MCN_LA) || defined(BOARD_EG810MEU_LA) \
        || defined(BOARD_EG810MCN_LA_VOLTE) || defined(BOARD_EG810MEU_LA_VOEXT) || defined(BOARD_EG810MCN_LA_VOEXT)\
        || defined(BOARD_EC800MCN_LE_CPE) || defined(BOARD_EC800MCN_GB_VOEXT) || defined(BOARD_EG810MEU_LA_VOLVGL) \
-       ||defined(BOARD_EG810MCN_GB_ALIPAY) || defined(BOARD_EC800MCN_LE_VOEXT)
+       ||defined(BOARD_EG810MCN_GB_ALIPAY) || defined(BOARD_EC800MCN_LE_VOEXT) || defined(BOARD_EG810MEU_LA_POC_XBND)
 #define PLAT_GPIO_NUM 47
 #else
 #error "Please confirm the board"
@@ -283,7 +285,7 @@ extern "C" {
 #if defined(BOARD_EC600KCN_CC_TTS) || defined(BOARD_EC600KCN_LC)
 #define PLAT_GPIO_NUM 39
 #elif defined(BOARD_EC800KCN_CC_TTS) || defined(BOARD_EC800KCN_LC) || defined(BOARD_EC800KCN_CC) || defined(BOARD_EG800KCN_GC) || defined(BOARD_EG800KEU_CC)\
-|| defined(BOARD_EC800KCN_LC_SMS)
+|| defined(BOARD_EC800KCN_LC_SMS) || defined(BOARD_EG800KLA_LC) || defined(BOARD_EG800KEU_LC) || defined(BOARD_EC800KEU_LC)
 #define PLAT_GPIO_NUM 47
 #else
 #error "Please confirm the board"
@@ -303,7 +305,7 @@ extern "C" {
 #error "Please confirm the eigen platform"
 #endif
 #elif defined(PLAT_ECR6600)
-#if defined(BOARD_FCM360W)
+#if defined(BOARD_FCM360W) || defined(BOARD_FCM360W_BEM)
 #define PLAT_GPIO_NUM 29
 #else
 #error "Please confirm the ecr6600 platform"
@@ -311,7 +313,7 @@ extern "C" {
 #endif
 
 #elif defined(PLAT_EIGEN_718)
-#if defined(BOARD_EC800ZCN_LD)
+#if defined(BOARD_EC800ZCN_LD) || defined(BOARD_EC800ZCN_LD_DAZ)
 #define PLAT_GPIO_NUM 41
 #else
 #error "Please confirm the eigen 718 platform"
index 96be487..97b5c1d 100644 (file)
@@ -58,7 +58,7 @@ extern "C" {
 #if defined(PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR_1602)
 #define PLAT_PWM_NUMMAX 3
 #elif defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1803sc)
-#define PLAT_PWM_NUMMAX 2
+#define PLAT_PWM_NUMMAX 3
 #elif defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8850_R02)
 #if defined(BOARD_EC800GCN_GA) \
        || defined(BOARD_EC800GCN_GA_MS) \
@@ -68,7 +68,8 @@ extern "C" {
        || defined(BOARD_EC800GCN_LB) \
     || defined(BOARD_EC800GCN_TT) \
        || defined(BOARD_EC800GCN_GA_VOLTE) \
-    || defined(BOARD_EG800GLA_LD)
+    || defined(BOARD_EG800GLA_LD) \
+    || defined(BOARD_EG800GEU_LD)
 #define PLAT_PWM_NUMMAX 28
 #elif defined(BOARD_EC600GCN_LD) \
        || defined(BOARD_EC600GCN_LA) \
@@ -89,7 +90,7 @@ extern "C" {
 #elif defined(PLAT_ASR_1602)
 #if defined(BOARD_EC600KCN_CC_TTS) || defined(BOARD_EC600KCN_LC)
 #define PLAT_GPIO_NUM 3
-#elif defined(BOARD_EC800KCN_CC_TTS) || defined(BOARD_EC800KCN_LC) || defined(BOARD_EG800KCN_GC) || defined(BOARD_EC800KCN_LC_SMS)
+#elif defined(BOARD_EC800KCN_CC_TTS) || defined(BOARD_EC800KCN_LC) || defined(BOARD_EG800KCN_GC) || defined(BOARD_EC800KCN_LC_SMS) || defined(BOARD_EG800KLA_LC) || defined(BOARD_EG800KEU_LC) || defined(BOARD_EC800KEU_LC)
 #define PLAT_GPIO_NUM 1
 #endif
 
index 3a02136..9db3d9c 100644 (file)
@@ -124,6 +124,7 @@ int Helios_NITZ_Setval_get(void);
 
 int Helios_RTC_NtpSetTime(Helios_RTCTime *tm, int flag);
 int Helios_RTC_GetLocalTime(Helios_RTCTime *tm);
+int Helios_RTC_In_PowerDown_State(int state);
 
 /**
  * @brief:
index 6c06821..a13e769 100644 (file)
@@ -527,7 +527,7 @@ struct netif * ql_netif_find_by_pcid(char cid);
 //int ql_getTcpState(int s);
 //#define lwip_getTcpState(a)    ql_getTcpState(a)
 
-#if LWIP_POSIX_SOCKETS_IO_NAMES
+#if LWIP_POSIX_SOCKETS_IO_NAMES && CONFIG_TIKTIK_RTC!=1
 #define read(a,b,c)           lwip_read(a,b,c)
 #define write(a,b,c)          lwip_write(a,b,c)
 #define close(s)              lwip_close(s)
index f360a88..0b184ab 100644 (file)
@@ -47,6 +47,12 @@ time_t qual_mbedtls_time(time_t *t)
     return (time_t)Helios_RTC_GetSecond();
 }
 
+time_t time(time_t *t)
+{
+       (void)t;
+    return (time_t)Helios_RTC_GetSecond();
+}
+
 #elif defined (PLAT_RDA)  
 
 void gettimeofday(struct timeval *tv, void *tz)
index d807ee6..ca50a2d 100644 (file)
@@ -318,6 +318,10 @@ int Helios_DataCall_GetPDPContext(uint8_t profile_idx, Helios_DataCallStartStruc
 void Helios_DataCall_GetDataSpeed(uint32_t *rx, uint32_t *tx);
 #endif
 
+#if defined(PLAT_ASR_1803s)
+void Helios_DataCall_GetDataTraffic(uint64_t *rx, uint64_t *tx);
+#endif
+
 #ifdef PLAT_ASR
 int Helios_DataCall_SetIsUseAttachApn(int attach_flag);
 int Helios_DataCall_GetIsUseAttachApn(void);
index ab0985d..cc8c3ab 100644 (file)
@@ -210,7 +210,7 @@ Helios_Lwm2m_Error_Code helios_lwm2m_enable_ack_support(uint32_t is_eable);
 Helios_Lwm2m_Error_Code helios_lwm2m_ack_messageid(uint32_t messageid,uint32_t type);
 #endif
 #if MICROPY_QPY_MODULE_LWM2M_SUPPORT_CHANGE
-Helios_Lwm2m_Error_Code Helios_lwm2m_change_value (const char * uri,int uri_len,const char *value,int value_len);
+Helios_Lwm2m_Error_Code Helios_lwm2m_change_value(const char * uri,int uri_len,const char *value,int value_len);
 #endif
 /* >>>>must have application interface  --end */
 
index 73b6b2d..32cda7a 100644 (file)
@@ -59,6 +59,7 @@ extern "C" {
 #define HELIOS_NW_NITZ_TIME_UPDATE_IND 3
 #define HELIOS_NW_SIGNAL_QUALITY_IND   4
 #define HELIOS_NW_JAMMING_DETECT_IND   5
+#define HELIOS_NW_CAUSE_REJECT_IND         6
 
 
 typedef void (*network_cb_t)(uint8_t sim_id, int32_t event_id, void *ctx);
@@ -206,6 +207,9 @@ typedef struct
        int32_t cid;
        int32_t psc;
        int32_t reject_cause;
+#if MICROPY_QPY_MODULE_NET_EX
+       char rejrct_plmn[8];
+#endif
 }Helios_NwRegisterInfoStruct;
 
 typedef struct
index e89068f..e76dc59 100644 (file)
@@ -228,7 +228,7 @@ typedef enum{
 //mia.zhong @20210831
 typedef struct
 {
-#if    defined(PLAT_Unisoc_8850_R02)
+#if    defined(PLAT_Unisoc_8850_R02) || defined(BOARD_EC800MCN_LE_CPE)
        char filename[64];
 #else
     char filename[32];
index e4f59a0..c0e3d76 100644 (file)
@@ -103,7 +103,7 @@ int Helios_Flag_Release(Helios_OSFlag_t flagRef, uint32_t mask,  Helios_flag_op_
 int Helios_Flag_Clear(Helios_OSFlag_t flagRef, uint32_t flag);
 int Helios_Flag_delete( Helios_OSFlag_t flagRef);
 
-#if defined(PLAT_ASR_1606) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8910_R06)
+#if defined(PLAT_ASR_1606) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8910_R06) || defined(PLAT_ASR_1803s)
 void Helios_delay_us(unsigned long uSec);
 #endif
 #endif
index d4d1c4e..e738c4a 100644 (file)
@@ -31,7 +31,8 @@ $(NAME)_COMPONENTS :=         system/platform \
                                                system/at \
                                                system/csd \
                                                system/esim \
-                                               system/aliiot
+                                               system/aliiot \
+                                               system/helios_ai
 
 
 ifneq ($(strip $(PLAT)),RDA)