-/*
- *
- * Automatically generated file; DO NOT EDIT.
- * Helios SDK Configuration
- *
- */
-#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_GH301x 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_CAMERA_SAVEPHOTOS 1
-//菊风视频通话
-#define CONFIG_juphoon 1
\ No newline at end of file
+/*\r
+ *\r
+ * Automatically generated file; DO NOT EDIT.\r
+ * Helios SDK Configuration\r
+ *\r
+ */\r
+\r
+\r
+#define PROJECT_NAME_G3_7PIN 1 //项目宏定义\r
+\r
+\r
+// #define CONFIG_LVGL_SPAN 1\r
+// #define CONFIG_LVGL_FS_HELIOS 1\r
+// #define CONFIG_LVGL_GIF_DECODE 1\r
+// #define CONFIG_LVGL_SPINNER 1\r
+//#define CONFIG_LCD 1\r
+// #define CONFIG_LVGL_ANIMIMG 1\r
+// #define CONFIG_LVGL_KEYBOARD 1\r
+// #define CONFIG_LVGL_CALENDAR 1\r
+// #define CONFIG_LVGL_LED 1\r
+#define CONFIG_VIOCE_CALL 1\r
+// #define CONFIG_LVGL_FS_EXTFLASH_HELIOS 1\r
+// #define CONFIG_LVGL_TABVIEW 1\r
+//#define CONFIG_LVGL_LINE 1\r
+//#define CONFIG_LVGL 1\r
+// #define CONFIG_LVGL_CHART 1\r
+// #define CONFIG_LVGL_LIST 1\r
+// #define CONFIG_LVGL_MSGBOX 1\r
+// #define CONFIG_LVGL_ARC 1\r
+// #define CONFIG_LVGL_METER 1\r
+//#define CONFIG_LVGL_JPG_DECODE 1\r
+// #define CONFIG_LVGL_PNG_DECODE 1\r
+// #define CONFIG_LVGL_IMGBTN 1\r
+//#define CONFIG_GH301x 1\r
+//#define CONFIG_HX3918 1\r
+#define CONFIG_MBEDTLS 1\r
+//#define CONFIG_SC7A20 1\r
+// #define CONFIG_LVGL_WIN 1\r
+// #define CONFIG_LVGL_COLORWHEEL 1\r
+// #define CONFIG_LVGL_CANVAS 1\r
+// #define CONFIG_LVGL_SPINBOX 1\r
+// #define CONFIG_LVGL_QRCODE 1\r
+// #define CONFIG_LVGL_TILEVIEW 1\r
+// #define CONFIG_LVGL_HANDLER_TASK_PRIORITY 80\r
+//#define CONFIG_CAMERA 1\r
+//#define CONFIG_JPEG 1\r
+#define CONFIG_CAMERA_SAVEPHOTOS 1\r
+#define CONFIG_VAD 1\r
+//菊风视频通话\r
+//#define CONFIG_juphoon 1\r
-
-mainmenu "Helios SDK Configuration"
-
-menu "System Configuration"
-source "../system/config.in"
-endmenu
-
-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
-
+\r
+mainmenu "Helios SDK Configuration"\r
+\r
+menu "System Configuration"\r
+source "../system/config.in"\r
+endmenu\r
+\r
+menu "EG810MCN_GA_VOLTE"\r
+source "../services/microPython/config/config.in"\r
+source "../components/poc/poc_option.in"\r
+source "../components/GH301x/GH301x_option.in"\r
+source "../components/SC7A20/SC7A20_option.in"\r
+source "../components/juphoon/juphoon_option.in"\r
+endmenu\r
+\r
-#
-# Automatically generated file; DO NOT EDIT.
-# Helios SDK Configuration
-#
-PROJECT_NAME_G3_7PIN=y
-#
-# System Configuration
-#
-CONFIG_MBEDTLS=y
-
-#
-# EG810MCN_GA_VOLTE
-#
-# 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_FS_SD_HELIOS is not set
-# CONFIG_LVGL_FS_EXTFLASH_HELIOS=y
-# CONFIG_LVGL_CUSTOMER_FONT_SUPPORT is not set
-# 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_CHART is not set
-# CONFIG_LVGL_LED is not set
-# CONFIG_LVGL_CANVAS=y
-# CONFIG_LVGL_WIN=y
-# CONFIG_LVGL_TABVIEW is not set
-# 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_QRCODE is not set
-#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_SPI_SDCARD is not set
-CONFIG_VIOCE_CALL=y
-# CONFIG_TTS is not set
-#CONFIG_LCD=y
-# CONFIG_UART_SLIP is not set
-# CONFIG_POC is not set
-#CONFIG_GH301x=y
-#CONFIG_HX3918=y
-#CONFIG_SC7A20=y
-CONFIG_VAD=y
-#CONFIG_juphoon=y
+#\r
+# Automatically generated file; DO NOT EDIT.\r
+# Helios SDK Configuration\r
+#\r
+PROJECT_NAME_G3_7PIN=y\r
+#\r
+# System Configuration\r
+#\r
+CONFIG_MBEDTLS=y\r
+\r
+#\r
+# EG810MCN_GA_VOLTE\r
+#\r
+# CONFIG_LVGL=y\r
+\r
+#\r
+# lvgl option\r
+#\r
+# CONFIG_LVGL_PNG_DECODE=y\r
+# CONFIG_LVGL_GIF_DECODE is not set\r
+# CONFIG_LVGL_JPG_DECODE=y\r
+#CONFIG_LVGL_FS_HELIOS=y\r
+# CONFIG_LVGL_FS_SD_HELIOS is not set\r
+# CONFIG_LVGL_FS_EXTFLASH_HELIOS=y\r
+# CONFIG_LVGL_CUSTOMER_FONT_SUPPORT is not set\r
+# CONFIG_LVGL_QRCODE=y\r
+# CONFIG_LVGL_FONT is not set\r
+# CONFIG_LVGL_ARC is not set\r
+#CONFIG_LVGL_IMGBTN=y\r
+#CONFIG_LVGL_LINE=y\r
+#CONFIG_LVGL_LIST=y\r
+# CONFIG_LVGL_CHART is not set\r
+# CONFIG_LVGL_LED is not set\r
+# CONFIG_LVGL_CANVAS=y\r
+# CONFIG_LVGL_WIN=y\r
+# CONFIG_LVGL_TABVIEW is not set\r
+# CONFIG_LVGL_TILEVIEW=y\r
+# CONFIG_LVGL_MSGBOX=y\r
+# CONFIG_LVGL_METER is not set\r
+# CONFIG_LVGL_CALENDAR is not set\r
+# CONFIG_LVGL_SPINNER is not set\r
+# CONFIG_LVGL_SPINBOX is not set\r
+# CONFIG_LVGL_ANIMIMG is not set\r
+# CONFIG_LVGL_COLORWHEEL is not set\r
+# CONFIG_LVGL_KEYBOARD=y\r
+# CONFIG_LVGL_SPAN=y\r
+# CONFIG_LVGL_HANDLER_TASK_PRIORITY=80\r
+# CONFIG_QRCODE is not set\r
+#CONFIG_CAMERA=y\r
+# CONFIG_CAMERA_DECODE is not set\r
+# CONFIG_CAMERA_SAVEPHOTOS=y\r
+# CONFIG_QUECTHING is not set\r
+# CONFIG_SPINAND is not set\r
+# CONFIG_RTMP is not set\r
+#CONFIG_JPEG=y\r
+# CONFIG_SPI_SDCARD is not set\r
+CONFIG_VIOCE_CALL=y\r
+# CONFIG_TTS is not set\r
+#CONFIG_LCD=y\r
+# CONFIG_UART_SLIP is not set\r
+# CONFIG_POC is not set\r
+#CONFIG_GH301x=y\r
+#CONFIG_HX3918=y\r
+#CONFIG_SC7A20=y\r
+CONFIG_VAD=y\r
+#CONFIG_juphoon=y\r
-from common import Abstract
-import osTimer
-import EventMesh
-from machine import Pin
-import utime
-
-from queue import Queue
-import _thread
-import usys
-
-
-motor_pin = Pin(Pin.GPIO36, Pin.OUT, Pin.PULL_PD, 0)
-def open_motor():#开马达
- motor_pin.write(1)
-
-def close_motor():#关闭马达
- motor_pin.write(0)
-
-
-
-MOTOR_TIME = 100
-class motorEventManager(Abstract):#马达事件
- def __init__(self):
- self.motor_timer = osTimer()
- self.motorInfo_queue = Queue()
- self.motor_enable = 0#马达使能
- self.motor_total_time = 0#总的时间
- self.motor_open_time = 0 #开马达事件
- self.motor_close_time = 0#关马达事件100ms
- self.motor_count = 0
- 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):
- while True:
- data = self.motorInfo_queue.get()
- #print("ledInfo_queue:data = {}".format(data))
- if data != None:
- try:
- data["func"](data["data"])
- except Exception as e:
- print("ledInfo_queue:ERROR:{}".format(e))
- usys.print_exception(e)
- def publish_message_event_motorInfo(self,event,msg):
- self.motorInfo_queue.put(msg)
-
- def publish_motor_event_cb(self, *args, **kwargs):
- EventMesh.publish("publish_message_event_motorInfo",{"func":self.motor_fun_cb,"data":0})
-
- def post_processor_after_instantiation(self):
- pass
-
- # msg 0马达使能 1 马达振动时间100ms单位 2 震动次数 3 间隔时间振动 4 是否需要长振 5 长振时间 6间隔时间长振 7长振次数1一次 要为200ms的倍数
- def set_motor_time(self,event,msg):
- if msg != None:
- self.motor_enable = msg[0]
- if self.motor_enable == 1: #马达使能
- self.motor_mode = msg [1]
- self.motor_total_time = msg[2]#总的时间
- self.motor_open_time = msg[3] #开马达事件
- self.motor_close_time = msg[4]#关马达事件100ms
- self.motor_count = 0
- self.motor_timer.stop()
- # print("motor msg",msg)
- close_motor()
- self.motor_timer.start(MOTOR_TIME,1,self.publish_motor_event_cb)
-
- def motor_fun_cb(self, data):
- if self.motor_mode == 0 or self.motor_enable == 0:
- close_motor()
- EventMesh.publish("close_motor_infor")#关闭马达和定时器
- return
- if self.motor_mode == 1:# 持续振动时间100单位 长振
- if self.motor_total_time > 0:
- self.motor_total_time-=1
- if self.motor_total_time > 0:
- open_motor()
- else:
- close_motor()
- EventMesh.publish("close_motor_infor")#关闭马达和定时器
- return
- elif self.motor_mode == 2:# 间隔振动
- # 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
- open_motor()
- else:
- close_motor()
- if self.motor_count >= self.motor_total_time-1:
- EventMesh.publish("close_motor_infor")#关闭马达和定时器
- return
- self.motor_count+=1
-
- def close_motor_infor(self,event,msg):
- print("close_motor_infor!!!")
- close_motor()
- self.motor_enable = 0#马达使能
- self.motor_total_time = 0#总的时间
- self.motor_open_time = 0 #开马达事件
- self.motor_close_time = 0#关马达事件100ms
- self.motor_count = 0
- self.motor_mode = 0#模式
- self.motor_timer.stop()
-
-
-
+from common import Abstract\r
+import osTimer\r
+import EventMesh\r
+from machine import Pin\r
+import utime\r
+\r
+from queue import Queue\r
+import _thread\r
+import usys\r
+\r
+\r
+motor_pin = Pin(Pin.GPIO36, Pin.OUT, Pin.PULL_PD, 0)\r
+def open_motor():#开马达\r
+ motor_pin.write(1)\r
+\r
+def close_motor():#关闭马达\r
+ motor_pin.write(0)\r
+\r
+\r
+\r
+MOTOR_TIME = 100\r
+class motorEventManager(Abstract):#马达事件\r
+ def __init__(self):\r
+ self.motor_timer = osTimer()\r
+ self.motorInfo_queue = Queue()\r
+ self.motor_enable = 0#马达使能\r
+ self.motor_total_time = 0#总的时间\r
+ self.motor_open_time = 0 #开马达事件\r
+ self.motor_close_time = 0#关马达事件100ms\r
+ self.motor_count = 0\r
+ self.motor_count_tmp = 0\r
+ self.motor_mode = 0#模式\r
+ _thread.start_new_thread(self.motorInfo_queue_thread, ())\r
+ EventMesh.subscribe("publish_message_event_motorInfo",self.publish_message_event_motorInfo)\r
+ EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数\r
+ EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器\r
+ EventMesh.subscribe("get_motor_enable", self.get_motor_enable)#关闭马达和定时器\r
+ pass\r
+ def get_motor_enable(self,event=None,msg=None):\r
+ return self.motor_enable\r
+\r
+ def motorInfo_queue_thread(self):\r
+ while True:\r
+ data = self.motorInfo_queue.get()\r
+ #print("ledInfo_queue:data = {}".format(data))\r
+ if data != None:\r
+ try:\r
+ data["func"](data["data"])\r
+ except Exception as e:\r
+ print("ledInfo_queue:ERROR:{}".format(e))\r
+ usys.print_exception(e)\r
+ def publish_message_event_motorInfo(self,event,msg):\r
+ self.motorInfo_queue.put(msg)\r
+\r
+ def publish_motor_event_cb(self, *args, **kwargs):\r
+ EventMesh.publish("publish_message_event_motorInfo",{"func":self.motor_fun_cb,"data":0}) \r
+ \r
+ def post_processor_after_instantiation(self):\r
+ pass\r
+\r
+ # msg 0马达使能 1 马达振动时间100ms单位 2 震动次数 3 间隔时间振动 4 是否需要长振 5 长振时间 6间隔时间长振 7长振次数1一次 要为200ms的倍数\r
+ def set_motor_time(self,event,msg):\r
+ if msg != None:\r
+ self.motor_enable = msg[0]\r
+ if self.motor_enable == 1: #马达使能\r
+ self.motor_mode = msg [1]\r
+ self.motor_total_time = msg[2]#总的时间\r
+ self.motor_open_time = msg[3] #开马达事件\r
+ self.motor_close_time = msg[4]#关马达事件100ms\r
+ self.motor_total_time_tmp=self.motor_total_time\r
+ if len(msg) <= 5:\r
+ self.motor_count = 0\r
+ else:\r
+ self.motor_count = msg[5]\r
+\r
+ self.motor_timer.stop()\r
+ print("motor msg:{} len:{} self.motor_count:{}".format(msg,len(msg),self.motor_count))\r
+ close_motor()\r
+ self.motor_timer.start(MOTOR_TIME,1,self.publish_motor_event_cb)\r
+\r
+ def motor_fun_cb(self, data):\r
+ if self.motor_mode == 0 or self.motor_enable == 0:\r
+ close_motor()\r
+ EventMesh.publish("close_motor_infor")#关闭马达和定时器\r
+ return\r
+ if self.motor_mode == 1:# 持续振动时间100单位 长振\r
+ if self.motor_count == 0:\r
+ self.motor_total_time-=1\r
+ if self.motor_total_time > 0:\r
+ open_motor()\r
+ else:\r
+ close_motor()\r
+ EventMesh.publish("close_motor_infor")#关闭马达和定时器\r
+ return\r
+ else:\r
+ if self.motor_count_tmp > self.motor_count:\r
+ close_motor()\r
+ EventMesh.publish("close_motor_infor")#关闭马达和定时器\r
+ return\r
+ self.motor_total_time_tmp-=1\r
+ if self.motor_total_time_tmp > 0:\r
+ open_motor()\r
+ else:\r
+ close_motor()\r
+ self.motor_total_time_tmp=self.motor_total_time\r
+ self.motor_count_tmp+=1\r
+ \r
+ pass\r
+ elif self.motor_mode == 2:# 间隔振动\r
+ # print("self.motor_count",self.motor_count,self.motor_open_time,self.motor_close_time,self.motor_total_time)\r
+ if self.motor_count % (self.motor_open_time) < self.motor_close_time: # 4 4 2 1%4 = 1 2%4 = 2 3%4 = 3\r
+ open_motor()\r
+ else:\r
+ close_motor()\r
+ if self.motor_count >= self.motor_total_time-1:\r
+ close_motor()\r
+ EventMesh.publish("close_motor_infor")#关闭马达和定时器\r
+ return\r
+ self.motor_count+=1\r
+\r
+ def close_motor_infor(self,event,msg):\r
+ print("close_motor_infor!!!")\r
+ close_motor()\r
+ self.motor_enable = 0#马达使能\r
+ self.motor_total_time = 0#总的时间\r
+ self.motor_open_time = 0 #开马达事件\r
+ self.motor_close_time = 0#关马达事件100ms\r
+ self.motor_count = 0\r
+ self.motor_mode = 0#模式\r
+ self.motor_timer.stop()\r
+\r
+\r
+\r
uri.hostname, uri.port)
sock = socket.socket()
- addr = socket.getaddrinfo(uri.hostname, uri.port,socket.AF_INET)
+ addr = socket.getaddrinfo(uri.hostname, uri.port)
sock.connect(addr[0][4])
if uri.protocol == 'wss':
pass
if args.command == "split":
- with io.open(args.input_filename, encoding="utf-8") as infile:
+ with io.open(args.input_filename, encoding="utf-8",errors="ignore") as infile:
process_file(infile)
if args.command == "cat":