567 Commits

Author SHA1 Message Date
songyanguang
57ceab57e6 Function usb_mmap instead of naive_mmap 2024-11-05 10:34:24 +08:00
songyanguang
8ad7409aae Modify cpu mair setup 2024-10-25 15:33:06 +08:00
xj
2425a2a12e codes for MAIR supporting 2024-10-24 23:13:37 -07:00
songyanguang
da16c4f01c Modify xhci debug log 2024-09-24 17:16:34 +08:00
songyanguang
7000c5cd18 According to ARMv8 architecture, the IRQ should be enable by calling gic_setup_spi when the NO. is larger than 31. 2024-09-20 19:28:42 +08:00
songyanguang
332bb5b870 Modify dwc3_dump 2024-09-14 15:29:05 +08:00
songyanguang
7c9d76b6af Add dwc3_dump 2024-09-14 10:22:19 +08:00
songyanguang
0027373c86 dwc3 init direction mode 2024-09-14 09:25:51 +08:00
songyanguang
7b5369a1f3 Modify DWC3 reg size to aligned to 4096 2024-09-13 15:31:22 +08:00
songyanguang
b9c3e22f5f Modify DWC3 reg size 2024-09-13 15:05:40 +08:00
xj
014283451a DWC3 reg size 2024-09-12 23:57:59 -07:00
songyanguang
d3c7f1d5c1 Add dwc3_phy_setup 2024-09-13 13:55:28 +08:00
xj
a854fc28ba DWC3 event buffer functions 2024-09-12 19:59:39 -07:00
songyanguang
ee3bcc6f66 Add dwc3_core_soft_reset 2024-09-13 10:23:25 +08:00
xj
7d575c4cea DWC3 event buffer functions 2024-09-12 05:21:10 -07:00
songyanguang
62c6017222 Tabs go space 2024-09-12 20:16:58 +08:00
songyanguang
d41cdce316 Add dwc3_core_init 2024-09-12 20:10:15 +08:00
xj
e6f6d3e1dd DWC3 scratch buffer functions 2024-09-12 04:45:05 -07:00
xj
5769e98844 DWC3 scratch buffer functions 2024-09-12 04:34:11 -07:00
songyanguang
a509d162ec Add dwc3_init 2024-09-12 19:32:27 +08:00
xj
637408e192 Add DWC3 codes 2024-09-12 04:08:12 -07:00
songyanguang
b51c911252 Modify dwc3_generic_probe 2024-09-12 18:50:59 +08:00
xj
43a771c15c Add DWC3 codes 2024-09-12 02:59:09 -07:00
xj
0e9625cf87 Add DWC3 codes 2024-09-12 02:38:41 -07:00
xj
506f37d009 Add DWC3 codes 2024-09-12 01:25:32 -07:00
songyanguang
6d834be991 Add dwc3 host probe 2024-09-11 19:11:45 +08:00
xj
d2e410b69b Add DWC3 codes 2024-09-10 23:45:35 -07:00
xj
068e61694d Add DWC3 codes 2024-09-10 23:29:36 -07:00
xj
69288eb255 Add DWC3 codes 2024-09-10 23:01:44 -07:00
xj
0cd2ad6080 Add DWC3 codes 2024-09-10 20:26:24 -07:00
xj
43cf354e3d add DWC3 codes 2024-09-10 05:37:47 -07:00
xj
65fbdd5c1e add DWC3 codes 2024-09-09 23:53:03 -07:00
xj
636d643a4b add DWC3 codes 2024-09-09 23:52:40 -07:00
xj
2d3b8d0b95 Add dwc3 codes 2024-09-09 23:19:01 -07:00
xj
f6ae7d7b13 Add dwc3 codes 2024-09-09 23:18:33 -07:00
xj
6229f7b1c8 add DWC3 codes 2024-09-09 04:58:55 -07:00
xj
33ac3e9048 add DWC3 codes 2024-09-09 03:02:06 -07:00
xj
36bd413225 add DWC3 codes 2024-09-09 01:34:15 -07:00
xj
c3ab8a0b24 add DWC3 codes 2024-09-09 01:33:53 -07:00
xj
c500ecfe10 Adding files for RK3568 USB 2024-09-08 20:01:27 -07:00
xj
6fd90067a0 Adding files for RK3568 USB 2024-09-08 20:00:37 -07:00
songyanguang
86e600ba5e Add xhci_dump_port_status_debug 2024-09-04 17:27:28 +08:00
songyanguang
636d4bf8c8 Add function handshake to wait for the HCHalted Status bit to be 0 2024-09-03 17:42:44 +08:00
songyanguang
df1a8fac3a Add function xhci_dump 2024-09-03 17:20:16 +08:00
songyanguang
35b70a666c Debug: Replace the args of usb_osal_thread_create with global parameter 2024-09-03 16:57:49 +08:00
songyanguang
abee37bf31 Not executing ipc_rndis_init to debug xhci 2024-09-03 16:34:01 +08:00
songyanguang
c9838c2161 Modify usb_check_phymode 2024-09-03 16:26:48 +08:00
songyanguang
ab8ba67a83 Fixed a bug in using usb_osal_mq_recv 2024-08-30 10:20:35 +08:00
songyanguang
137247d918 Obtain the interrupt number according to the usb id 2024-08-30 10:10:54 +08:00
songyanguang
08e1fba932 Modify the xHCI register size 2024-08-30 10:00:46 +08:00
xj
e7a92d9417 Modify osal functions 2024-08-27 04:33:02 -07:00
songyanguang
24b1b5ac56 Add usb_check_phymode 2024-08-27 18:58:40 +08:00
xj
eadaa44dd8 modify sleep function 2024-08-26 00:10:38 -07:00
xj
8c2eb4598f merge codes 2024-08-25 20:33:16 -07:00
xj
93ad360a1a merge codes 2024-08-25 20:10:52 -07:00
xj
21f454fd87 merge codes 2024-08-25 20:03:11 -07:00
songyanguang
083277e500 The paddr parameter needs to be 0 in the naive_mmap function. 2024-08-21 17:22:54 +08:00
songyanguang
2f03186b0b Fix a register issue. 2024-08-21 11:24:06 +08:00
songyanguang
bdfdc65bf6 usb memory virtual address reference XiZi, and modify naive_mmap usage method. 2024-08-21 10:45:34 +08:00
songyanguang
883cd6e4d5 Modify usb log level to Debug 2024-08-21 09:23:26 +08:00
songyanguang
aa7c708a4b Set usb hc type USB_HC_XHCI in usb init 2024-08-21 09:16:54 +08:00
songyanguang
3f80e39695 rndis waits for LWIPServer in thread. 2024-08-20 10:11:27 +08:00
songyanguang
72ceb7fd26 Compile usb_driver_service into fs.img. 2024-08-20 09:35:11 +08:00
songyanguang
5168e88911 Generate the usb_driver_service program. 2024-08-19 19:45:22 +08:00
songyanguang
398c2590c7 Fix compilation issues 2024-08-19 19:30:52 +08:00
songyanguang
721763bb00 usb class info is created when initialized. 2024-08-19 19:17:50 +08:00
xj
7a7318734b adding usb_assert 2024-08-16 05:32:32 -07:00
songyanguang
dd3104c4a1 Modify the usb main function. 2024-08-16 18:05:19 +08:00
xj
27247f7d00 sleep function 2024-08-15 19:38:29 -07:00
songyanguang
d3fb123c29 usb code is adapted to rk3568. 2024-08-15 19:55:16 +08:00
songyanguang
a9273b9879 Merge branch rk3568_dev of https://www.gitlink.org.cn/tuyuyang/xiuos with commit 6bc856b7a6 into local 2024-08-15 19:26:02 +08:00
songyanguang
059da067df New IPC interface, lwip receives data from rndis. 2024-08-14 17:22:54 +08:00
xj
b53ba2e4b4 Interrupt function 2024-08-13 19:31:36 -07:00
songyanguang
aaceb82386 New IPC interface, lwip sends data to rndis 2024-08-13 14:43:22 +08:00
songyanguang
84ab3dff35 Modify rndis and lwip interaction function name. 2024-08-13 09:59:31 +08:00
xj
7003f26807 Add interrupt processing functions 2024-08-09 04:54:40 -07:00
xj
91d06a23b3 Add interrupt processing functions 2024-08-09 01:07:10 -07:00
xj
0816b5427a Add interrupt processing functions 2024-08-09 00:51:02 -07:00
xj
45a36e5776 Add interrupt processing functions 2024-08-08 20:20:28 -07:00
xj
4170e41ab7 Add interrupt processing functions 2024-08-08 20:03:37 -07:00
xj
cd35c4e733 Adding interrupt codes 2024-08-08 00:18:38 -07:00
xj
0e09b55903 Adding interrupt codes 2024-08-08 00:08:23 -07:00
xj
b9de9baf1c Adding interrupt codes 2024-08-07 23:43:11 -07:00
xj
55eef9ff58 Add comments 2024-08-07 19:21:28 -07:00
songyanguang
c637a3d0bc Modify xhci code to adapt to XIZI. 2024-08-07 18:57:40 +08:00
xj
22b137f92f Modify address mapping in xhci_transfer 2024-08-06 23:33:57 -07:00
songyanguang
98a64f616d xhci ring memory is fetched from the memory resource pool. 2024-08-07 09:32:21 +08:00
xj
f8768d29a2 add usb3.0 interrupt NO 2024-08-05 23:54:52 -07:00
songyanguang
5e829d5da0 Modify Transfer TRB code in xHCI to apply to XiZi AIOT. 2024-08-06 14:44:05 +08:00
xj
b383f88d7d modify function name 2024-08-05 20:20:39 -07:00
xj
c689c550d7 modify function name 2024-08-05 19:51:38 -07:00
xj
951c3bf203 modify function name 2024-08-05 19:42:04 -07:00
xj
7d6cc6d1d8 modify variate name 2024-08-05 19:24:52 -07:00
songyanguang
3886ed4b12 fix a bug 2024-08-05 20:54:24 +08:00
songyanguang
77bed3c28f Modify USB Device Initialization in xHCI code and Command TRB code to apply to XiZi AIOT. 2024-08-05 20:47:51 +08:00
xj
2eba5a8071 Replanting xhci_port_status 2024-08-05 02:20:41 -07:00
xj
ad027ba080 Replanting xhci_complete 2024-08-05 01:47:35 -07:00
xj
48ff62be23 Replanting xhci_complete 2024-08-05 01:38:11 -07:00
xj
acf338844a Replanting xhci_transfer 2024-08-05 01:16:19 -07:00
xj
bf9c5056ac Adding usb memory pool functions 2024-08-05 00:51:52 -07:00
xj
3928cd46b7 Replanting xhci_event_process function 2024-08-01 20:09:00 -07:00
xj
6ab2083403 Add USB memory pool functions 2024-08-01 01:40:18 -07:00
xj
19269781b4 Add USB memory pool function 2024-08-01 00:27:38 -07:00
xj
1bc171a131 Implanting xhci_run and some free functions 2024-07-29 04:51:48 -07:00
xj
f322fce778 Implanting xhci_run and some free functions 2024-07-29 04:49:30 -07:00
xj
bed67b388f Implanting event ring initialization 2024-07-29 02:03:42 -07:00
songyanguang
181362892a Modify IPC-related functions in rndis host 2024-07-24 15:44:24 +08:00
songyanguang
1d7bcb479d Modify MessageLength in usbh_rndis_eth_tx 2024-07-23 18:17:59 +08:00
songyanguang
46d67a2115 rndis bulk transfer buffer uses physical addresses 2024-07-23 14:56:38 +08:00
songyanguang
f81170c61d Modify rndis_host.c according to CherryUSB v0.10.2 2024-07-23 09:24:27 +08:00
xj
098d39181d Command RING Initialize 2024-07-16 06:10:40 -07:00
songyanguang
6504f11f00 rndis uses naive_mmap to allocate memory during connect. 2024-07-16 18:25:50 +08:00
songyanguang
f1f533cdc1 usbh_core hub and rndis use naive_mmap to assign virtual and physical addresses, and match the relevant codes. 2024-07-16 09:42:16 +08:00
xj
a91baab639 for xhci command ring 2024-07-12 04:21:57 -07:00
songyanguang
4cceb8cd3b rndis ADAPTS to usb core to decouple xhci. 2024-07-10 09:44:08 +08:00
songyanguang
2da33e48dc Added file modification description. 2024-07-10 09:42:59 +08:00
songyanguang
459a7ad7cf Modify usbh_rndis related files according to CherryUSB v0.1.2 2024-07-09 16:40:13 +08:00
songyanguang
b623803db4 Add compiling rndis. 2024-07-09 16:34:10 +08:00
xj
7cb39f992c Implant scratchpad buffer functions 2024-07-05 06:05:54 -07:00
xj
ab573e238e Implant scratchpad buffer functions 2024-07-05 01:11:33 -07:00
xj
d2164713b3 Add fls function 2024-07-04 05:25:53 -07:00
xj
4a657a3044 replace DSB 2024-07-04 02:53:40 -07:00
songyanguang
c5db36f4b9 enable DSB 2024-07-04 11:28:28 +08:00
xj
114ff07759 replace header file which is referred in usb_log.h 2024-07-03 18:46:26 -07:00
xj
0c5851f05b modify lwip_service.c for test 2024-07-03 06:31:55 -07:00
xj
f1bbde5216 fix bugs 2024-07-03 06:30:28 -07:00
xj
ad5acb644b fix bugs 2024-07-03 06:15:24 -07:00
xj
57ae614071 update dcbaa functions in xhci.c, and Makefile in xhci 2024-07-03 04:58:05 -07:00
xj
aedc9d86fc update dcbaa functions 2024-07-03 01:19:52 -07:00
xj
12e5b67108 update kernel codes 2024-07-02 19:48:07 -07:00
xj
b2c3a24f35 Modify xhci_port_protocol, xhci_supported_protocol and xhci_legacy_release so that the xHCI can adapt to XiZi AIOT 2024-07-01 05:18:53 -07:00
xj
ac3527bbc2 Modify xhci_port_protocol, xhci_supported_protocol and xhci_legacy_release so that the xHCI can adapt to XiZi AIOT 2024-07-01 05:03:28 -07:00
xj
e30c4e662f Modify xhci_port_protocol, xhci_supported_protocol and xhci_legacy_release so that the xHCI can adapt to XiZi AIOT 2024-07-01 05:01:14 -07:00
xj
21a0f8ed30 Modify xhci_reset so that the xHCI can adapt to XiZi AIOT 2024-07-01 04:13:01 -07:00
xj
3efb2335c5 Modify xhci_stop so that the xHCI can adapt to XiZi AIOT 2024-07-01 03:02:01 -07:00
xj
e34d688cc3 Modify xhci_legacy_init so that the xHCI can adapt to XiZi AIOT 2024-07-01 01:37:23 -07:00
xj
eac58cedec Modify xhci_extended_capability so that the xHCI can adapt to XiZi AIOT 2024-07-01 00:12:14 -07:00
xj
7c48797ecf Adding more USB hardware information for RK3568 2024-06-28 04:37:15 -07:00
xj
9ce7259447 Adding more USB hardware information for RK3568 2024-06-28 04:32:00 -07:00
xj
41a4e81d7d Adding more USB hardware information for RK3568 2024-06-28 04:12:02 -07:00
songyanguang
7ed436a8c8 Add TODO comments to the function to be modified. 2024-06-28 18:00:28 +08:00
xj
098c8a9879 Merge branch '5g_usb' of https://gitlink.org.cn/kameblue/xiuos into 5g_usb 2024-06-28 00:26:04 -07:00
xj
3beb9fb2b9 Adding more USB hardware information for RK3568 2024-06-28 00:15:10 -07:00
songyanguang
d2c1180cce Modify usb core to call functions defined by xhci. 2024-06-28 15:00:21 +08:00
xj
805cd766ea Adding more USB hardware information for RK3568 2024-06-27 23:45:07 -07:00
xj
bf1947052b Adding more USB hardware information for RK3568 2024-06-27 23:06:22 -07:00
xj
b0471990a3 Adding more USB hardware information for RK3568 2024-06-27 20:28:57 -07:00
xj
2c82079be7 Adding more USB hardware information for RK3568 2024-06-27 20:10:44 -07:00
xj
e44ae64451 Add address of USB3.0 host controller registers in RK3568 2024-06-25 23:39:18 -07:00
xj
9bf663c476 Add address of USB3.0 host controller registers in RK3568 2024-06-25 22:58:36 -07:00
xj
e9b9e907c6 Add physical page interface 2024-06-25 19:38:58 -07:00
songyanguang
47a330b08f Modify the hub to decouple from xhci. 2024-06-24 15:42:00 +08:00
songyanguang
513b74b845 Modify usbh_hub.c according to freertos source code. 2024-06-24 15:31:57 +08:00
songyanguang
aa68affc46 rewrite xhci function usbh_get_port_speed 2024-06-24 15:08:02 +08:00
songyanguang
dd55f8d731 Modifying functions in usb core is related to xhci. 2024-06-24 14:52:48 +08:00
songyanguang
56b8a29888 Modifying functions in usb core is related to xhci. 2024-06-24 14:15:33 +08:00
songyanguang
39620c574e Modifying functions in usb core is related to xhci. 2024-06-24 14:10:54 +08:00
songyanguang
7f188bff03 Modify USB core code to decouple from xhci. 2024-06-20 17:44:51 +08:00
xj
545c240c8d Modify xhci functions for USB core 2024-06-18 23:34:39 -07:00
xj
5d240f93ae Modify xhci functions for USB core 2024-06-18 23:30:51 -07:00
xj
a66824c9ad Modify xhci functions for USB core 2024-06-18 23:23:47 -07:00
xj
eef25d3004 Modify xhci functions for USB core 2024-06-18 23:21:44 -07:00
xj
83a4b774b5 Modify xhci functions for USB core 2024-06-18 23:10:46 -07:00
songyanguang
9f3edeb6b4 Extract the functions of the host controller to USB core. 2024-06-19 10:35:39 +08:00
songyanguang
cc22f1b8f8 New field usb_hc_type in data structure usbh_urb 2024-06-19 10:33:20 +08:00
xj
3d5e8ed6fc uncouple the USB core and xhci 2024-06-18 18:32:11 -07:00
xj
eee6a74ff0 Adding folders for future USB IP 2024-06-18 05:27:09 -07:00
xj
01a0f62f78 Adding folders for future USB IP 2024-06-18 05:20:32 -07:00
xj
75e1299ac7 Establish Folders for future USB IP 2024-06-18 05:04:38 -07:00
songyanguang
d4f72f2ad9 Decoupling core and xhci. 2024-06-18 16:09:32 +08:00
xj
303737e590 Copy xhci functions first. We should redevelop xhci functions step by step 2024-06-17 19:01:59 -07:00
xj
01a92a269c Implant xhci codes 2024-06-17 02:56:24 -07:00
songyanguang
0a1df937ad Modify usbh_core.c for references file 2024-06-17 15:35:15 +08:00
xj
04a0e2a0f6 Re-design xhci functions to dock with USB core 2024-06-16 23:39:02 -07:00
xj
97e0d1aa67 Develop OS abstract layer functions 2024-06-16 20:12:18 -07:00
xj
7472a6de3d Modify OS Abstract layer 2024-06-15 20:52:26 -07:00
xj
b3fdaef640 Replanting OSAL codes 2024-06-13 03:00:24 -07:00
xj
3acfca1e34 Add comments 2024-06-13 00:08:58 -07:00
xj
a3795dd0f7 Delete a source file 2024-06-12 18:39:47 -07:00
xj
7635db0f84 Editing OS abstract layer codes for USB 2024-06-12 01:50:27 -07:00
xj
6039856cd2 Modify source files 2024-06-11 22:58:17 -07:00
xj
9469217fe6 Modify header files 2024-06-11 03:09:06 -07:00
xj
24262508c4 Modify header files 2024-06-11 02:20:00 -07:00
xj
06b969a119 Modify header files 2024-06-11 01:53:19 -07:00
xj
403d1daab1 Implant USB memory functions 2024-06-11 01:48:10 -07:00
xj
7d78fc6c2a Modify source files 2024-06-11 00:27:04 -07:00
xj
02990bfd1e Modify source files 2024-06-11 00:26:36 -07:00
xj
b17ce138fa Modify code tree 2024-06-10 23:24:32 -07:00
xj
28d0cc056c Adjust code tree 2024-06-10 23:08:28 -07:00
xj
7968c89e5d Modify header files 2024-06-10 23:06:41 -07:00
xj
cb397c2c9e transplant header files 2024-06-07 03:06:11 -07:00
xj
8e1bd559d5 Modify Makefile 2024-06-07 00:56:57 -07:00
xj
02e0623175 Modify files 2024-06-07 00:54:57 -07:00
xj
236f8bdb31 Modify files 2024-06-07 00:54:42 -07:00
xj
e61dee8922 Modify Makefile 2024-06-06 20:15:48 -07:00
xj
64477bafda Modify code tree 2024-06-06 19:09:16 -07:00
xj
cbdabf3adc Ajust code tree 2024-06-06 19:06:37 -07:00
xj
09e7094ec3 Modify Makefiles 2024-06-06 02:12:13 -07:00
xj
d1b462b83f Modify Makefiles 2024-06-06 00:44:56 -07:00
xj
29c2f1e3a8 Modify Makefiles 2024-06-06 00:44:29 -07:00
lr
336a640698 add eth_hal at app/MakeFile 2024-06-06 15:23:47 +08:00
lr
3222b892e8 add eth_hal 2024-06-06 15:17:27 +08:00
xj
3df2629a18 Delete rk3568 dir 2024-06-05 23:56:24 -07:00
xj
a4681f5f8f Modify Makefiles 2024-06-05 23:54:36 -07:00
xj
8ab512df2d Add Makefiles 2024-06-05 23:26:45 -07:00
xj
1017bf724c Modify Makefiles 2024-06-05 23:16:06 -07:00
xj
31c23b7ad0 Modify Makefiles 2024-06-05 23:15:52 -07:00
xj
1fc7e9ff6c Modify files 2024-06-05 22:59:30 -07:00
xj
7f6cc40594 Adjust Files 2024-06-05 19:44:00 -07:00
xj
d4fde5c2fb Modify Makefiles 2024-06-05 03:21:09 -07:00
xj
3746135317 Modify Makefiles 2024-06-05 01:48:27 -07:00
xj
3fc089d277 Modify Makefiles 2024-06-05 01:03:24 -07:00
xj
c2448b85b3 Modify Makefiles 2024-06-05 00:52:46 -07:00
xj
600079be0f Modify Makefiles 2024-06-05 00:45:05 -07:00
xj
47bd0b9734 Accept merge 2024-06-04 23:53:32 -07:00
xj
bb437f86cf Merge branch '5g_usb' of https://gitlink.org.cn/kameblue/xiuos into 5g_usb 2024-06-04 23:51:51 -07:00
xj
beba1dc16e Modify Makefiles 2024-06-04 23:46:09 -07:00
lr
8d1870240b Merge branch '5g_usb' of https://gitlink.org.cn/kameblue/xiuos into 5g_usb 2024-06-05 14:42:01 +08:00
lr
37603ac9c3 fix armv8 complie support at drk3568 ethernet 2024-06-05 14:39:55 +08:00
lr
84e066d209 del rk3568 drivers hal lib(todo: replace with uboot ETH Driver) 2024-06-05 14:25:04 +08:00
lr
dca029936f add armv8 compile suppout to lwip 2024-06-05 14:20:16 +08:00
xj
6fd3d385d6 Modify Makefiles 2024-06-04 23:03:28 -07:00
xj
a293563990 Add Makefiles 2024-06-04 03:12:08 -07:00
xj
5a7a7b36f9 Add Makefiles 2024-06-04 03:01:52 -07:00
lr
525e02c275 FIx rk3568 hal-lib,todo: map phy addr to virt addr 2024-06-04 17:49:55 +08:00
xj
7881e6700f Add Makefiles 2024-06-04 02:04:15 -07:00
xj
c65fb1fe79 Add Makefiles 2024-06-04 02:03:37 -07:00
xj
f02fa3512f Ajust code tree 2024-06-04 00:49:57 -07:00
xj
ac58c0bde1 Adjust code tree 2024-06-03 23:48:22 -07:00
xj
82a363e81b Ajust code tree 2024-06-03 22:59:02 -07:00
xj
6dca0f5bd7 Add USB source tree 2024-06-03 02:42:23 -07:00
lr
6fd44a89ed rename hal_gmac 2024-06-03 17:38:40 +08:00
lr
5ed3ba4240 Merge branch '5g_usb' of https://gitlink.org.cn/kameblue/xiuos into 5g_usb 2024-06-03 17:22:54 +08:00
xj
ea8b1f5374 Add USB source tree 2024-06-03 01:55:57 -07:00
xj
d2dd347ed5 Add USB source tree 2024-06-03 01:48:32 -07:00
lr
4f182f90c9 add hal ethernet driver 2024-06-03 16:45:09 +08:00
xj
c5263acba5 Add USB source tree 2024-06-03 01:31:46 -07:00
xj
b9cd006f8f Add USB source tree 2024-06-03 01:19:34 -07:00
xj
730d3be87b Add USB source tree 2024-06-03 01:12:51 -07:00
xj
01e8e80c0e Add USB source tree 2024-06-03 00:47:04 -07:00
xj
c8bc2ddd05 Add USB configure file 2024-06-02 23:42:52 -07:00
xj
0b43c65650 Add USB folders 2024-06-02 23:16:08 -07:00
lr
5d6cd493bf Merge branch 'smp' of https://gitlink.org.cn/tuyuyang/xiuos into lwip 2024-05-31 09:40:35 +08:00
TXuian
3a99cc550c Support multithread server 2024-05-31 01:17:57 +08:00
lr
67f6b4641c fix sys_arch.c 2024-05-29 18:34:37 +08:00
lr
2f4a29860c Merge branch 'smp' of https://gitlink.org.cn/tuyuyang/xiuos into lwip 2024-05-29 16:53:35 +08:00
lr
60b1906396 fix sys_arch to adapt kernel semaphore 2024-05-29 16:44:19 +08:00
TXuian
d05754a98e Fix a semaphore.c bug 2024-05-29 16:22:23 +08:00
lr
a9309fa1b4 Merge branch 'smp' of https://gitlink.org.cn/tuyuyang/xiuos into lwip 2024-05-29 15:37:20 +08:00
lr
6add0df96b fix lwipopts.h 2024-05-29 15:33:12 +08:00
TXuian
6d4cef4358 Support armv8 clock. 2024-05-29 15:10:52 +08:00
TXuian
5a2c07e1a9 Support kernel semaphore. 2024-05-29 11:06:03 +08:00
TXuian
bd7966c5a3 Support armv8 smp 2024-05-28 15:11:38 +08:00
TXuian
6114b4618f Support armv8.(TODO: fix clock) 2024-05-28 10:54:21 +08:00
TXuian
71cf0c667c Support virt armv8.(Todo: fix clock intr) 2024-05-27 14:57:58 +08:00
TXuian
80f80b64f0 ArmV8 support arch mmu intr clock 2024-05-24 16:06:09 +08:00
TXuian
c1e99c449a Merge branch 'armv8' of https://gitlink.org.cn/tuyuyang/xiuos into armv8 2024-05-24 13:47:59 +08:00
TXuian
ba54936940 Fix session bug. 2024-05-24 13:45:27 +08:00
liuqh
0efbe375eb TODO: Support armv8 2024-05-24 13:43:31 +08:00
lr
a0c6addb14 fix sys_sem_* and sys_mbox_* function 2024-05-23 16:55:36 +08:00
lr
8c0b51161e Revert "add debug message"
This reverts commit 99967e9f9b.
2024-05-23 15:54:34 +08:00
lr
99967e9f9b add debug message 2024-05-23 15:50:37 +08:00
lr
2147d92121 complie and debug test_net 2024-05-23 11:26:36 +08:00
lr
dced598cbf test lwip through udp 2024-05-22 20:38:09 +08:00
lr
43bb298df9 warp the socket api 2024-05-22 18:05:50 +08:00
TXuian
dd0c6c66ed Fix ipc to support null pointer. 2024-05-22 15:46:36 +08:00
TXuian
2c4fe30bd3 Fix style. 2024-05-22 13:55:30 +08:00
lr
1a4be4e6b4 enable lwip socket api 2024-05-21 15:51:28 +08:00
lr
f1d39b2e25 lwip server with !NO_SYS init 2024-05-21 15:30:11 +08:00
TXuian
f7a232ed4f Fix minor cases. 2024-05-20 16:55:43 +08:00
lr
6252e7e383 fix lwip !no_sys to complied success 2024-05-20 15:43:45 +08:00
lr
3e4c6e35e3 add sys_arch.c in makefile in net_server 2024-05-20 15:33:05 +08:00
lr
d63d9dfae4 disable lwip_socket 2024-05-20 15:30:35 +08:00
lr
3178ece116 Merge branch 'smp' of https://gitlink.org.cn/tuyuyang/xiuos into lwip 2024-05-20 14:32:22 +08:00
TXuian
f4e193a738 Support Userland semaphore server 2024-05-20 14:29:22 +08:00
lr
fa710bbc37 modify lwip to !no_sys 2024-05-20 10:19:39 +08:00
lr
4e67992516 Merge branch 'smp' of https://gitlink.org.cn/tuyuyang/xiuos into lwip 2024-05-20 09:27:24 +08:00
TXuian
29f1df2eea Fix bitmap64 corner case. 2024-05-19 17:37:52 +08:00
TXuian
4803239498 Support thread. 2024-05-19 11:48:43 +08:00
TXuian
736ba18769 Rename struct Thread; Completely split task memspace and shceduling 2024-05-18 21:37:30 +08:00
lr
bcc5251dc0 add test_net.c 2024-05-17 18:07:26 +08:00
lr
59c1edce98 add test_net.c and modify makefile 2024-05-17 16:10:04 +08:00
lr
514b9973b6 modify makefile eventually again 2024-05-17 15:23:08 +08:00
lr
18537fc922 modify makefile eventually 2024-05-17 09:56:21 +08:00
lr
aabb860bb2 modify makefile 2024-05-16 21:53:56 +08:00
lr
0acf8c26be modify makefile 2024-05-16 21:03:01 +08:00
lr
b2022bac12 modify lwip/arch.h 2024-05-16 16:03:36 +08:00
lr
3cec54bf5f modify makefile 2024-05-16 15:48:48 +08:00
lr
f81a16a041 modify fs nr_bit_block 2024-05-16 14:55:16 +08:00
lr
a66d833cea Merge branch 'smp' of https://gitlink.org.cn/tuyuyang/xiuos into lwip 2024-05-16 14:47:23 +08:00
lr
642023dd0c delete arch 2024-05-16 14:45:57 +08:00
TXuian
0b858de120 Fix userland exit() type 2024-05-16 14:44:41 +08:00
lr
63c67f7185 modify arch 2024-05-16 14:27:44 +08:00
TXuian
56ec6edbe5 Add README.md 2024-05-16 14:12:32 +08:00
TXuian
5a12635b85 Support Ipc server cycle handler. 2024-05-16 11:25:32 +08:00
lr
bbfc42fbab modify makefile 2024-05-16 11:19:34 +08:00
TXuian
c6de550e45 Fix UserFS, support more blocks. 2024-05-16 10:34:39 +08:00
lr
7aa0cde8f2 modify mkfs.h 2024-05-15 18:34:57 +08:00
lr
40726602ec Merge branch 'smp' into lwip 2024-05-15 18:02:27 +08:00
TXuian
52387d47a7 Change some compile flags. 2024-05-15 17:59:38 +08:00
lr
526834acda init net 2024-05-15 17:54:07 +08:00
TXuian
48abec8a00 Support imx6q-sabrelite userland timer driver. 2024-05-11 17:12:23 +08:00
liuqh
e62863bc22 Merge branch 'smp' of https://gitlink.org.cn/tuyuyang/xiuos into smp 2024-05-10 15:42:42 +08:00
liuqh
a836b7f5c8 Start support ok1028a-c. 2024-05-10 15:42:29 +08:00
TXuian
79d741e015 Fix softkernel uint32_t. 2024-05-10 15:40:36 +08:00
TXuian
b6dd58c629 Optimize XiZi_AIoT FS fd allocation. 2024-05-09 16:01:43 +08:00
TXuian
16a53d4e80 Fix is_spinlock_hold_by_current_cpu. 2024-05-09 14:04:25 +08:00
TXuian
6d54c54bcc Use new actracer. 2024-05-09 10:52:17 +08:00
TXuian
a19312df24 Use new sys tracer. 2024-05-09 09:39:07 +08:00
liuqh
361ea2b53e Merge branch 'smp' of https://gitlink.org.cn/tuyuyang/xiuos into smp 2024-05-08 15:36:46 +08:00
liuqh
6b91caac18 TODO: Port ok1028a-c. 2024-05-08 15:35:21 +08:00
TXuian
3b011500f1 Change Service dir structure, erase uncessary hardkernel functions. 2024-05-08 15:22:08 +08:00
TXuian
18eff4334c Use better KPrintf 2024-05-07 18:02:19 +08:00
TXuian
50ecc1e520 Finish micorkernel functions. 2024-05-01 12:12:13 +08:00
TXuian
7a296b2744 Support blockiing server. 2024-04-30 22:52:28 +08:00
TXuian
3a985252d9 Support blocking server. 2024-04-30 18:17:31 +08:00
TXuian
9f9e25a98e Support running task list management. 2024-04-30 14:49:51 +08:00
TXuian
baa04913bd Support running task list management. 2024-04-30 14:24:07 +08:00
TXuian
3c6e8ce109 Enhance optimization and warning level. 2024-04-30 11:22:38 +08:00
TXuian
077dcd66ac Support O2 optimization 2024-04-29 18:27:28 +08:00
xuedongliang
bcd9835020 Support smp for softkernel. Support userland interrupt handler by using ipc. Assure that interrupt is close in kernel and one thread kernel state. Support userland dynamic memory allocation. Move elf image reader to usyscall level. Support blocking task in ipc procedure. Split free physical memory to kernel usage and userland usage. Support killing a other task, but will only freeing a task while it’s not in running state from Tuyuyang
it is OK
2024-04-29 14:12:06 +08:00
TXuian
88ded7ca16 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into prepare_for_master 2024-04-29 10:49:00 +08:00
TXuian
8d2d7e3e09 Make sure that kernel is interrupt disabled. 2024-04-29 10:46:07 +08:00
TXuian
695dd91201 Close interrupt during trapframe construction. 2024-04-28 18:34:45 +08:00
TXuian
e5df6012af Support blocking task. 2024-04-28 15:49:41 +08:00
TXuian
a24d73f710 Fully support userland interrupt handler. Use fixed common abort handler. 2024-04-28 14:44:49 +08:00
TXuian
a7cbb0d041 delete task only when it's not in running. 2024-04-26 17:39:23 +08:00
TXuian
03039cbdab fix sys_kill. 2024-04-26 11:05:10 +08:00
hc0014
6f3ec7de67 Merge pull request 'add ch32v307 uart & usb & can' (#448) from hc0014/xiuos:prepare_for_master into prepare_for_master 2024-04-26 09:31:09 +08:00
TXuian
10cc7cc270 Unify kernel entrance. 2024-04-25 13:51:18 +08:00
TXuian
52b549c14c support irq 2024-04-25 09:32:10 +08:00
TXuian
213a92330e Optimize session connection and buddy. 2024-04-24 14:31:00 +08:00
TXuian
fc380de895 Fix some bugs. 2024-04-24 10:19:58 +08:00
huang
104791dbbe Merge branch 'prepare_for_master' of https://gitlink.org.cn/hc0014/xiuos into prepare_for_master 2024-04-03 16:37:36 +08:00
huang
b9bfce4865 modify linux 2024-04-03 16:31:31 +08:00
TXuian
a2e5b49b19 fix sys_poll_session performance bug. 2024-04-02 10:56:28 +08:00
TXuian
f5ad8437b5 use common spinlock.c 2024-03-26 10:05:02 +08:00
TXuian
8f3df1e5c2 clean unnecessary lock initialization in kernel 2024-03-26 09:39:20 +08:00
TXuian
0f5527d73a Support smp for imx6q-sabrelite. 2024-03-21 14:54:52 +08:00
TXuian
620965dc2c Fix one dabort and iabort lock bug. 2024-03-19 10:22:02 +08:00
TXuian
08c8f0b952 Update spinlock to avoid hungry. 2024-03-19 10:12:51 +08:00
TXuian
50dab7b553 test cache 2024-03-18 11:17:55 +08:00
TXuian
c60f29277a Add wklock to dabort and iabort. 2024-03-15 18:29:57 +08:00
TXuian
b939557317 Use only whole kernel lock 2024-03-15 16:21:36 +08:00
TXuian
d987bf0357 Support smp. TODO: delete all inner kernel locks. 2024-03-15 16:01:30 +08:00
TXuian
892613a0d5 close cache. 2024-03-15 10:36:29 +08:00
xuedongliang
9a3f8bd120 新增PLC测试应用和对应JSON from juqiuyue
it is OK
2024-03-14 15:39:18 +08:00
jqy1988
93614746fe Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into control 2024-03-14 15:33:12 +08:00
xuedongliang
3b2a27ae9a Support zynq7000-zc702 for XiZi-AIoT from XiZi-AIot
it is OK
2024-03-14 15:26:21 +08:00
jqy1988
142a817ff3 add nj501 test app and json file 2024-03-14 14:36:41 +08:00
TXuian
3dc6d58bdb Support whole kernel lock. TODO: fix spawn. 2024-03-14 14:28:11 +08:00
hc0014
dc2aff8457 add ch32v307vct6 usb and can 2024-03-14 10:29:52 +08:00
hyl
1044b26f14 补充can,485测试说明文档和木兰协议 2024-03-14 10:14:41 +08:00
TXuian
01f4d45e0c Start multi cores in imx6q 2024-03-13 17:56:49 +08:00
jqy1988
d2ec2ba096 add simens 1200plc test app and json 2024-03-13 09:13:15 +08:00
TXuian
63de0f983c Merge branch 'tmp' into zynq 2024-03-12 16:38:59 +08:00
TXuian
85b5d365df merge fs changes. 2024-03-12 16:37:08 +08:00
TXuian
9b92c71a21 Start supporting smp. 2024-03-12 16:31:21 +08:00
xuedongliang
1a3202748e support rzg2ul-m33 from chuyunfei
it is OK
2024-03-12 16:28:14 +08:00
xuedongliang
098a19e614 refactor: update the filesystem from gao 2024-03-12 16:27:03 +08:00
hyl
1e6f366843 移植并验证:can驱动485驱动;未验证:USB驱动 2024-03-12 16:05:17 +08:00
TXuian
e054bb4c59 Slightly fix directory structure. 2024-03-12 13:44:46 +08:00
TXuian
23d6224395 Add some ipc related comments; Fix one dabort and iabort bug. 2024-03-07 14:21:47 +08:00
TXuian
f6434bd573 Faster clock freq for zynq7000-zc702 2024-03-06 14:34:45 +08:00
anguoyoula
fb8c81c9f2 fix bug about the letter shell can`t be used in board rzg2ul 2024-03-06 13:45:33 +08:00
TXuian
6489d94dcd support zynq7000-zc702 2024-03-05 16:18:01 +08:00
TXuian
5f9478251b support zynq7000-zc702 2024-03-05 15:24:06 +08:00
huang
814a742260 add usart3 connect 2024-03-01 16:35:02 +08:00
huang
1dffac3f88 modify buardrate 2024-02-29 11:15:49 +08:00
anguoyoula
9327b70860 support rzg2ul-m33 2024-02-28 16:28:16 +08:00
jqy1988
048796080a add br ppc2100 plc image 2024-02-27 11:24:00 +08:00
jqy1988
2847b5a24d ge,mitsubishi plc image and json file 2024-02-27 11:20:38 +08:00
jqy1988
6e8213af57 add fatek plc readme file ,image,json 2024-02-27 10:39:55 +08:00
huang
38a087717c ch32v307 uart4 2024-02-22 10:00:19 +08:00
Allenn
f68900bb14 update modification comment 2024-02-04 16:27:10 +08:00
Allenn
df6543d41a refactor: update filesystem 2024-02-04 16:10:53 +08:00
xuedongliang
6bdf5cc0ce merge XiZi_AIoT functions into XiUOS
it is OK
2024-02-02 18:28:49 +08:00
TXuian
7069f54ed9 Fix modification infomations. Reconstruct fs directory structure. 2024-02-02 18:21:04 +08:00
TXuian
6942ad6d1d XIZI_AIoT: Add modifications for all SDK files. Add libmalloc interfaces(not functional) 2024-02-02 11:10:55 +08:00
xuedongliang
2443536db5 1、support 4G tcp connect in webserver; 2、support 4G MQTT connect in webserver,using mqttx to test send/receive data。developer need to support mqtt application if the project need the webserver mqtt function; 3、fix LoRa bug in webserver
it is OK
2024-02-02 10:22:02 +08:00
xuedongliang
bca78a3133 add frermodbustcp and CIP protocol; add three PLC test demo and readme, include ab L30、850and abb PM5630
it is OK
2024-02-02 10:21:22 +08:00
TXuian
c7529f1702 Rename doxygen setting file. 2024-01-31 10:58:23 +08:00
TXuian
8f352253f9 Support XiZi_AIoT 2024-01-31 10:41:31 +08:00
TXuian
494312183b Support XiZi_AIoT 2024-01-31 10:30:34 +08:00
Liu_Weichao
c7309c478b feat support 4G MQTT function in webserver for xishutong-arm32, using mqttx test 2024-01-24 16:38:37 +08:00
Liu_Weichao
9199d2655f feat support 4G function in webserver for xishutong-arm32 2024-01-17 13:41:20 +08:00
Liu_Weichao
6c96e1273c Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into connection 2024-01-16 11:01:47 +08:00
IACU
f6cf46027d Support the M33 of the RZ/V2L development board from Chu_Yunfei
it is OK
2024-01-16 11:01:11 +08:00
IACU
76c66312c0 4G module EC200A NetworkInfo acquirement and MQTT connection from Xu_Yanghang
it is OK
2024-01-16 10:58:30 +08:00
anguoyoula
d8213ec036 update comment 2024-01-16 10:22:07 +08:00
anguoyoula
7fe272fcb9 update readme 2024-01-15 16:06:40 +08:00
anguoyoula
0923c6239a Supports inter-nuclear communication 2024-01-15 15:39:47 +08:00
xuyanghang
2e4a4367b0 Merge remote-tracking branch 'upstream/prepare_for_master' into prepare_for_master 2024-01-12 16:49:38 +08:00
xuyanghang
bbe1eba081 4G module EC200A MQTT connection 2024-01-12 16:44:40 +08:00
anguoyoula
255d7464f7 已经可以运行,但是还有一个隐藏的很深的BUG还没有来得及改 2024-01-11 17:51:04 +08:00
xuyanghang
5986dce9e7 4G module EC200A NetworkInfo acquirement 2024-01-11 13:40:03 +08:00
anguoyoula
58ee6ad53b 可以运行,但是还有BUG 2024-01-11 11:25:46 +08:00
Liu_Weichao
ff4e53a980 fix support_module define bug 2024-01-11 09:48:16 +08:00
Liu_Weichao
009b8a0a5a fix lora tx timeout error 2024-01-10 18:09:13 +08:00
Liu_Weichao
1b904b7dad delete useless lora driver in xishutong-arm32 board 2024-01-10 18:05:46 +08:00
Liu_Weichao
348d53df91 fix lora function bug in webserver 2024-01-10 17:47:17 +08:00
IACU
cc7109af18 4G module EC200A TCP connection from Xu_Yanghang
it is OK
2024-01-10 14:09:53 +08:00
xuyanghang
e5802dc0f3 merge upstream 2024-01-09 17:59:12 +08:00
xuyanghang
3e93d2e173 4G module EC200A TCP connection 2024-01-09 17:55:16 +08:00
xuyanghang
bab22a96fe Merge remote-tracking branch 'upstream/prepare_for_master' into prepare_for_master 2024-01-09 14:51:31 +08:00
xuyanghang
49259b08a3 4G module EC200A TCP connection 2024-01-09 14:50:37 +08:00
IACU
28a1d12820 feat add adc/dac/can/usb for xishutong-arm32 board from Liu_weichao
it is OK
2024-01-09 10:32:33 +08:00
anguoyoula
cff963dab0 update commit comment: 2024-01-08 14:11:09 +08:00
anguoyoula
05aa2078c8 Support the M33 of the RZ/V2L development board 2024-01-08 14:07:04 +08:00
anguoyoula
cf5a7ad103 移植XiZi内核到RZ/V2L开发板的M33核心 2024-01-08 14:01:53 +08:00
huang
1d582ebcfd Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into prepare_for_master 2024-01-05 09:56:25 +08:00
Liu_Weichao
87c4c585d9 feat support webserver for edu-arm32 board 2024-01-03 14:20:37 +08:00
huang
a290b93980 uart2 2024-01-02 11:11:35 +08:00
xuyanghang
618ca9d872 merge upstream 2023-12-29 14:50:57 +08:00
xuyanghang
c6b57ed826 modify reset pin number 2023-12-29 13:51:01 +08:00
Liu_Weichao
9e962d2cf2 feat add can/usb for xishutong-arm32 board 2023-12-29 10:37:36 +08:00
Liu_Weichao
616aa90d25 feat add adc/dac for xishutong-arm32 board 2023-12-29 10:25:12 +08:00
IACU
9d546c8c02 fix webserver connect status error from Liu_Weichao
it is OK
2023-12-28 13:49:26 +08:00
Liu_Weichao
a590eacebb fix webserver connect status error 2023-12-28 13:46:57 +08:00
Wien.b
76c15215b8 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into prepare_for_master 2023-12-26 22:23:20 -08:00
Wien.b
a81f8e35d2 fix path_kernel.mk error 2023-12-26 22:22:28 -08:00
IACU
02e182db05 modify webserver default close from Liu_Weichao
it is OK
2023-12-27 14:21:08 +08:00
Liu_Weichao
a711491df6 modify webserver default close 2023-12-27 14:18:18 +08:00
Wien.b
cd759ccc83 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into prepare_for_master 2023-12-26 22:10:09 -08:00
IACU
051f67ddba feat support webserver function for xishutong-arm32 from Liu_Weichao
it is OK
2023-12-26 11:00:19 +08:00
Liu_Weichao
e292ce2fc8 feat support webserver function include net_4g/net_lora for xishutong-arm32, compile OK 2023-12-22 15:14:20 +08:00
Liu_Weichao
e7047a752d feat support webserver function include device_info/interface/net_ethernet for xishutong-arm32 2023-12-21 16:29:36 +08:00
wien.b
cfe2cece57 Modify the CAN display problem 2023-12-20 17:43:45 +08:00
wien.b
76868729bf delete useless file 2023-12-20 14:10:41 +08:00
Liu_Weichao
b9801f0a38 fix hwtimer bug for edu-arm32 board 2023-12-19 10:42:49 +08:00
IACU
53cb4a6efe support tcp client for ch32v307vct6 from Gao_Ao
it is OK
2023-12-15 15:34:21 +08:00
Liu_Weichao
3aa16a8666 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into connection 2023-12-15 15:33:08 +08:00
Allenn
e0de3d1e46 feat: keep client connect request after timeout 2023-12-14 11:42:19 +08:00
Allenn
f8b8ac46ca feat: support tcp client 2023-12-13 19:30:37 +08:00
Liu_Weichao
9bc206fd0b modify webserver function using mongoose.a(compile using arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620) 2023-12-13 14:30:40 +08:00
Allenn
402f25a2fd fix: fix ch32v307 cannot enter shell 2023-12-13 10:48:18 +08:00
xuyanghang
a1d05733de solve merge conflict 2023-12-11 10:19:53 +08:00
xuyanghang
337264d599 merge upstream 2023-12-11 10:06:39 +08:00
Liu_Weichao
9a97e9dd94 feat support ext sdram for xishutong-arm32 board 2023-12-08 14:17:57 +08:00
IACU
093f362387 delete drivers which are not test yet in xishutong-arm32 from Liu_Weichao
it is OK
2023-12-06 17:31:50 +08:00
Liu_Weichao
3d35ff22e4 delete drivers which are not test yet 2023-12-06 17:29:18 +08:00
IACU
eb74a93b36 Support double lwip eport, use mongoose.a from Tu_Yuyang
it is OK
2023-12-06 17:26:40 +08:00
Liu_Weichao
ad82f5beb7 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into connection 2023-12-06 17:25:40 +08:00
TXuian
1e9146d2ff Support double lwip eport, use mongoose.a 2023-12-06 16:50:21 +08:00
TXuian
616dc4584f Support double lwip eport, use mongoose.a 2023-12-06 15:59:27 +08:00
Liu_Weichao
4c8df066b7 optimize test_can and test_timer 2023-12-06 15:35:42 +08:00
jqy1988
9ae79832e9 add fatek plc test app 2023-12-06 09:59:02 +08:00
IACU
4de08ed386 feat add ethernet mac\W5500\spi for xishutong-arm32 board from Liu_Weichao
it is OK
2023-11-30 11:29:53 +08:00
Liu_Weichao
d5da547813 feat add ethernet mac\W5500\spi for xishutong-arm32 board 2023-11-30 11:25:43 +08:00
xuyanghang
084b9a6bc0 add 4G module EC200A 2023-11-29 18:33:45 +08:00
Wien.b
ffe83b869a move modbus slave test app to app_Framework 2023-11-29 00:54:15 -08:00
IACU
c55286286e feat support freemobus lib in connection framework from Liu_Weichao
it is OK
2023-11-29 14:40:48 +08:00
Liu_Weichao
a7d3e92357 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into connection 2023-11-28 16:55:16 +08:00
jqy1988
8202e08c9c add panasonic fpxh plc test json file 2023-11-28 15:05:06 +08:00
IACU
c4aaf920cd 1. Self-developed management platform performs ota upgrade 2. Add jerryscript source code 3. Rectify the ota directory from Wang_Guozhu
it is OK
2023-11-28 11:23:20 +08:00
Liu_Weichao
3378579d9e 1、fix uart dev_recv_callback not init error;2、fix app_test compile error. 2023-11-28 11:11:53 +08:00
Liu_Weichao
8a8a513cf1 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into connection 2023-11-28 11:10:45 +08:00
Wien.b
d3c7d7ce9f add three PLC test demo and readme 2023-11-23 23:23:08 -08:00
jqy1988
e5e654988b 1.add panasonic fpxh plc test app 2.add panasonic fpxh plc readme file 2023-11-24 10:23:24 +08:00
jqy1988
81924837dd Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into control 2023-11-22 15:54:15 +08:00
wgzAIIT
a92dc71ce4 Modify the header file to include 2023-11-21 08:40:57 +08:00
wgz
d0bf9c9564 add Mulan PSL v2 2023-11-20 21:11:55 +08:00
wgzAIIT
b2fef14aef Update flash_for_ota.h 2023-11-20 20:23:46 +08:00
wgzAIIT
8c1423f50e modify ota function dir 2023-11-20 17:10:28 +08:00
wgzAIIT
55ce48e0ba Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into develop 2023-11-20 14:36:31 +08:00
IACU
f27c6d2091 modify ota dir to fix conflict from Liu_Weichao
it is OK
2023-11-20 13:24:20 +08:00
Liu_Weichao
6d7250d4fd modify ota dir to fix conflict 2023-11-20 13:21:15 +08:00
IACU
52454eec8d feat add xishutong-arm32 board for XiUOS from Liu_Weichao
it is OK
2023-11-20 10:40:06 +08:00
Liu_Weichao
94d3d37a19 feat add 4G function for xishutong-arm32 board 2023-11-20 10:36:47 +08:00
Liu_Weichao
88e8cc4193 modify ota function dir 2023-11-20 10:31:04 +08:00
Liu_Weichao
270d2b9ea3 feat add xishutong-arm32 board for XiZi kernel 2023-11-20 10:22:08 +08:00
wgzAIIT
418bf921c6 chmod +x build.py 2023-11-20 09:42:29 +08:00
wgzAIIT
516b8627f7 add jerryscript source code 2023-11-20 09:05:58 +08:00
wgzAIIT
d1d846184b change JerryScript test case 2023-11-20 09:02:11 +08:00
wgzAIIT
ba81c73a06 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into jerryscript 2023-11-20 08:31:29 +08:00
IACU
50d8ff5488 feat add Ubiquitous/XiZi_Micro DIR and delete useless yaml files from Liu_Weichao
it is ok
2023-11-17 19:43:27 +08:00
TXuian
e0e314e301 Add xishutong-arm32 BSP 2023-11-16 17:07:42 +08:00
Liu_Weichao
98232123e4 support freemodbus RTU master and slave mode 2023-11-16 16:12:29 +08:00
wgzAIIT
af33a3289c Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into jerryscript 2023-11-13 15:12:37 +08:00
Liu_Weichao
b2ab878a33 Merge branch 'connection' of https://gitlink.org.cn/IACU/xiuos into connection 2023-11-13 11:05:33 +08:00
IACU
3c40a39d15 解决CJson编译及LWIP不能访问外网问题 from Huang_Chen
it is OK
2023-11-09 17:44:58 +08:00
TXuian
0f2e05aed4 Add mongoose 2023-11-09 17:25:03 +08:00
TXuian
71e3c8a654 Add mongoose, add xishutong-arm32. 2023-11-09 17:21:13 +08:00
huang
892bef64e9 解决CJson编译及LWIP不能访问外网问题 2023-11-06 13:59:26 +08:00
Liu_Weichao
79d627a969 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into connection 2023-11-02 15:50:32 +08:00
wgzAIIT
b7e405ac94 Update Kconfig 2023-11-02 15:25:36 +08:00
wgzAIIT
9b3f219b01 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into jerryscript 2023-11-02 15:18:23 +08:00
Liu_Weichao
d255ffaee5 Merge branch 'master' of https://gitlink.org.cn/IACU/xiuos 2023-11-01 16:45:13 +08:00
IACU
ab08ad959c update 2023_open_source_contest pr to prepare_for_master
it is OK
2023-11-01 16:31:52 +08:00
jqy1988
21379e813a modify br PLC test menu 2023-10-30 14:43:58 +08:00
jqy1988
87446340f1 modify ge PLC test menu 2023-10-30 14:42:28 +08:00
jqy1988
041368d4c6 modify inovance test menu 2023-10-30 14:40:38 +08:00
jqy1988
ef4e4b37c0 1.add melsec Q03udv test app 2.modify readme file 2023-10-30 14:33:30 +08:00
jqy1988
5af6d63cd4 1.add melsec q06hPLC test app 2.modify readme file 2023-10-30 11:23:42 +08:00
Wien.b
b82bdaea6b move freemodbus tcp server from control to connetion 2023-10-16 02:34:04 -07:00
jqy1988
46a15c1dc7 add delta as332t plc test app and modify readme file 2023-10-13 16:01:56 +08:00
jqy1988
9a210fa9db fix temminal and plc communication err 103 2023-10-13 15:07:04 +08:00
Liu_Weichao
6db0eccbe5 feat add Ubiquitous/XiZi_Micro DIR and delete useless yaml files 2023-10-13 13:54:23 +08:00
wgzAIIT
e90c465a23 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into jerryscript 2023-10-13 09:39:45 +08:00
Liu_Weichao
719b02a3e7 feat support freemodbus from [https://github.com/RT-Thread-packages/freemodbus/tree/master:a7a61d5], compile OK 2023-10-12 20:04:13 +08:00
Wien.b
a247de691c modify CIP stack overflow 2023-10-12 00:46:15 -07:00
wgz-code
c96376ea25 Merge branch 'xidatong-arm32' into jerryscript 2023-10-12 14:30:03 +08:00
wgz-code
37764d4501 delete unused files 2023-10-12 14:19:27 +08:00
wgzAIIT
267707c920 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into jerryscript 2023-10-12 10:34:03 +08:00
wgzAIIT
29b15812b7 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into xidatong-arm32 2023-10-12 10:30:30 +08:00
Wien.b
54fb48f17b Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into prepare_for_master 2023-10-11 03:51:29 -07:00
wgzAIIT
7885326768 Merge branch 'xidatong-arm32' into jerryscript 2023-10-11 17:36:19 +08:00
wgzAIIT
966ccb5030 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into jerryscript 2023-10-11 17:27:41 +08:00
Wien.b
51299c6b79 add CIP Protocol 2023-10-11 02:22:00 -07:00
wgzAIIT
53fc43e077 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into xidatong-arm32 2023-10-11 17:15:12 +08:00
wgzAIIT
fa439abd68 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into jerryscript 2023-10-11 17:03:32 +08:00
Wien.b
242c7d66d2 Merge remote-tracking branch 'upstream/prepare_for_master' into prepare_for_master 2023-10-11 01:56:03 -07:00
wgzAIIT
4f4bbc1d68 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into xidatong-arm32 2023-10-11 16:51:55 +08:00
Wien.b
38481e2ae2 modify s7 read value num 2023-10-11 01:39:36 -07:00
Wien.b
62e3006e1a add frermodbustcp server 2023-10-11 01:29:22 -07:00
wgzAIIT
8c86c3c574 Merge remote-tracking branch 'origin/xidatong-arm32' into jerryscript 2023-10-07 15:06:04 +08:00
wgzAIIT
dbfa37bf44 add ota error_message for platform 2023-10-07 14:57:40 +08:00
wgzAIIT
29853ef76d Merge branch 'xidatong-arm32' into jerryscript 2023-10-07 10:34:44 +08:00
wgzAIIT
5b62808e28 add ota error_message for platform 2023-10-07 10:05:46 +08:00
wgzAIIT
4d3858bf8f Fix jerryscript compilation error 2023-09-27 14:30:34 +08:00
wgzAIIT
987622d1e3 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into jerryscript 2023-09-26 17:08:55 +08:00
wgzAIIT
a473111e5d Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into xidatong-arm32 2023-09-26 17:05:26 +08:00
wgzAIIT
3437bfdc19 Merge pull request 'merge code' (#63) from xidatong-arm32 into jerryscript 2023-09-26 17:03:15 +08:00
wgzAIIT
98587d876d Optimize ota progress display 2023-09-26 16:06:51 +08:00
wgzAIIT
6bbf1e2c4c Merge pull request 'merge code' (#61) from xidatong-arm32 into jerryscript 2023-09-25 09:18:26 +08:00
wgzAIIT
c2abf66f23 OTA prints prompt message when upgrade is not required 2023-09-22 15:04:10 +08:00
wgzAIIT
d14272c55f Merge remote-tracking branch 'origin/xidatong-arm32' into jerryscript 2023-09-21 13:45:21 +08:00
wgzAIIT
aa3e6c9370 1、Optimize mqtt transfer speed 3k/s
2、add json file to sd card by mqtt
3、check the sd card is mounted successfully
2023-09-21 13:40:19 +08:00
wgzAIIT
f7d0b0925c Merge pull request 'merge code' (#59) from xidatong-arm32 into jerryscript 2023-09-21 11:13:15 +08:00
wgzAIIT
b41a1709c6 json file download needs to check whether the sd card is mounted successfully 2023-09-21 11:10:36 +08:00
wgzAIIT
0b1489cfed Merge pull request 'merge code' (#56) from xidatong-arm32 into jerryscript 2023-09-20 16:11:36 +08:00
wgzAIIT
9fd61d3d2a 1、Optimize mqtt transfer speed 3k/s
2、add json file to sd card by mqtt
2023-09-20 14:37:42 +08:00
wgzAIIT
60a7835ef8 Modify the return value of the mqtt function 2023-09-19 09:22:26 +08:00
wgzAIIT
5ef61d14b1 1、Verify file size before ota file transfer
2、update MQTT connection parameter configuration
2023-09-18 18:28:01 +08:00
wgzAIIT
474557a5ac 1、Optimize ota Bootloader function
2、add reboot after flash copy
2023-09-14 16:07:16 +08:00
wgzAIIT
0a76e9c583 update JerryScript README.md 2023-09-12 16:46:24 +08:00
wgzAIIT
e61ffc4589 Optimize ota transfer function 2023-09-12 09:32:14 +08:00
wgzAIIT
e8061577da Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into jerryscript 2023-09-11 10:12:03 +08:00
wgzAIIT
652e5789a7 Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into xidatong-arm32 2023-09-11 10:05:37 +08:00
wgzAIIT
5da9a9c4ae 1、Optimize transmission string matching rules
2、change Kconfig for mqtt and ota
2023-09-08 17:32:43 +08:00
wgzAIIT
117789121e Optimize ota transfer function 2023-09-08 10:08:26 +08:00
wgzAIIT
bad8dc0fc2 1、add support xiuos platform for ota
2、change Kconfig for mqtt and Modify variable name
3、change ota functions for support xiuos platform
2023-09-07 16:53:20 +08:00
wgzAIIT
f24a0f2d47 change Kconfig for JerryScript 2023-09-05 15:23:21 +08:00
wgzAIIT
e33bd9dd78 Merge branch 'mqtt' into xidatong-arm32 2023-08-30 10:03:03 +08:00
wgzAIIT
3427b3629d Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into xidatong-arm32 2023-08-29 11:02:44 +08:00
wgzAIIT
29499a1ec3 Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into jerryscript 2023-08-29 11:01:41 +08:00
wgzAIIT
2ae328c773 Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into jerryscript 2023-08-28 08:41:32 +08:00
wgzAIIT
570e4a029c Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into xidatong-arm32 2023-08-28 08:40:55 +08:00
wgzAIIT
b41748dfb6 Merge pull request 'merge code' (#47) from mqtt into xidatong-arm32 2023-08-24 10:21:40 +08:00
wgzAIIT
23b938f242 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into jerryscript 2023-08-24 10:16:43 +08:00
wgzAIIT
55d63408fe Merge pull request 'merge code' (#46) from mqtt into xidatong-arm32 2023-08-17 20:20:26 +08:00
wgzAIIT
9e031ecee0 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into jerryscript 2023-08-17 19:15:34 +08:00
wgzAIIT
d4b7fd6ba5 Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into xidatong-arm32 2023-08-17 19:15:09 +08:00
wgzAIIT
74b31a5420 add JerryScript test file and update README.md 2023-08-09 15:21:18 +08:00
wgzAIIT
a868ed3238 Merge pull request 'merge code' (#43) from mqtt into xidatong-arm32 2023-08-09 12:19:03 +08:00
wgzAIIT
544b0bcba4 Merge pull request 'merge code' (#40) from prepare_for_master into jerryscript 2023-08-09 12:16:28 +08:00
wgzAIIT
20113601e7 Merge pull request 'merge code' (#41) from prepare_for_master into xidatong-arm32 2023-08-09 12:16:22 +08:00
wgzAIIT
fb458fe6cd git submodule add jerryscript base tag v2.4.0 2023-08-09 10:50:41 +08:00
wgzAIIT
bb0fb51e7e support jerryscript on edu-arm32 board and add test case 2023-08-09 10:29:03 +08:00
wgzAIIT
7ce3748947 add JerryScript test case 2023-08-08 15:10:21 +08:00
wgzAIIT
fa2c91e690 1、git submodule add jerryscript v2.4.0
2、support JerryScript on XiZi for stm32f407-st-discovery board and cortex-m4-emulator
2023-08-08 15:02:48 +08:00
wgzAIIT
e2edd918c3 Merge pull request 'merge code' (#37) from mqtt into xidatong-arm32 2023-08-08 14:26:42 +08:00
wgzAIIT
91ddfea1ed Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into xidatong-arm32 2023-08-08 08:57:35 +08:00
wgzAIIT
2e4eb538b9 Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into xidatong-arm32 2023-07-28 09:09:04 +08:00
wgzAIIT
4d56788af3 Merge branch 'mqtt' into xidatong-arm32 2023-07-27 11:06:05 +08:00
wgzAIIT
0f5546a679 Merge pull request 'merge code' (#33) from prepare_for_master into xidatong-arm32 2023-07-27 10:48:21 +08:00
wgzAIIT
b580f6b377 Merge pull request 'merge code' (#30) from prepare_for_master into xidatong-arm32 2023-07-27 09:16:48 +08:00
4308 changed files with 1077980 additions and 325706 deletions

3
.gitmodules vendored
View File

@@ -22,9 +22,6 @@
[submodule "Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/kendryte-sdk/kendryte-sdk-source"]
path = Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/kendryte-sdk/kendryte-sdk-source
url = https://www.gitlink.org.cn/chunyexixiaoyu/kendryte-sdk-source.git
[submodule "APP_Framework/lib/lorawan/lora_radio_driver"]
path = APP_Framework/lib/lorawan/lora_radio_driver
url = https://gitlink.org.cn/xuos/lora_radio_driver
[submodule "APP_Framework/lib/lorawan/lorawan_devicenode"]
path = APP_Framework/lib/lorawan/lorawan_devicenode
url = https://gitlink.org.cn/xuos/lorawan_devicenode.git

View File

@@ -20,4 +20,5 @@ menu "Applications"
source "$APP_DIR/Applications/sensor_app/Kconfig"
source "$APP_DIR/Applications/embedded_database_app/Kconfig"
source "$APP_DIR/Applications/webnet/Kconfig"
source "$APP_DIR/Applications/webserver/Kconfig"
endmenu

View File

@@ -39,6 +39,10 @@ ifeq ($(CONFIG_ADD_XIZI_FEATURES),y)
ifeq ($(CONFIG_APP_USING_WEBNET),y)
SRC_DIR += webnet
endif
ifeq ($(CONFIG_APPLICATION_WEBSERVER),y)
SRC_DIR += webserver
endif
include $(KERNEL_ROOT)/compiler.mk
endif

View File

@@ -281,6 +281,7 @@ menu "test app"
menuconfig USER_TEST_MQTTCLIENT
bool "Config test mqtt client"
default n
select LIB_USING_CJSON
menuconfig USER_TEST_FTPCLIENT
bool "Config test ftp client"

View File

@@ -150,7 +150,9 @@ ifeq ($(CONFIG_ADD_XIZI_FEATURES),y)
endif
ifeq ($(CONFIG_USER_TEST_FTPCLIENT_RISCV),y)
SRC_FILES += test_ftpclient_riscv/test_ftpclient_riscv.c
ifeq ($(CONFIG_BSP_USING_W5500),y)
SRC_FILES += test_ftpclient_riscv/test_ftpclient_riscv.c
endif
endif
ifeq ($(CONFIG_USER_TEST_LORA_P2P),y)

View File

@@ -0,0 +1,162 @@
/*
* Copyright (c) 2020 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file test_4g_ec200a.c
* @brief Implement the connection 4G function, using QUECTEL EC200A device
* @version 1.1
* @author AIIT XUOS Lab
* @date 2023.10.15
*/
#include <stdio.h>
#include <string.h>
#include <transform.h>
#ifdef ADD_XIZI_FEATURES
char *trans_data = "{\"saleid\": \"52330000MJ87322565\", \"gateid\": \"10100001011\", \"type\": \"report\", \"time\": \"2023-06-15 17:22:00\", \"sequence\": \"268\", \"source\": \"da\", \"meter\": [{\"id\": \"T100106\", \"status\": \"1\", \"name\": \"T100106\", \"values\": {}}]}\r\n";
// const char chk_buad[] = {"AT+IPR?\r\n"};
const char set_mode[] = {"AT+QMTCFG=\"recv/mode\",0,0,1\r\n"};
// const char set_cfg[] = {"AT+QMTCFG=\"aliauth\",0,\"k0celEMx5DK\",\"test_device\",\"411aa14c0dc671f7ee869adced442d13\"\r\n"};
const char set_server[] = {"AT+QMTOPEN=0,\"xyheqmx.e3.luyouxia.net\",13333\r\n"};
// const char set_server[] = {"AT+QMTOPEN=0,\"iot-060a7p7c.mqtt.iothub.aliyuncs.com\",1883\r\n"};
const char set_conn[] = {"AT+QMTCONN=0,\"quectel\",\"test\",\"test123456\"\r\n"};
// const char set_conn[] = {"AT+QMTCONN=0,\"sysoul\"\r\n"};
// const char set_get[] = {"AT+QMTSUB=0,1,\"/get\",0\r\n"};
// const char set_reply[] = {"AT+QMTPUBEX=0,0,0,0,\"/reply\",1000\r\n"};
char recv_buf[100] = {0};
int buf_len = 0;
void Test4G(void)
{
int quectel_fd = PrivOpen(ADAPTER_QUECTEL_DRIVER, O_RDWR);
if (quectel_fd < 0) {
printf("open quectel fd error:%d\n", quectel_fd);
return;
}
printf("quectel fopen success\n");
struct SerialDataCfg quectel_cfg;
memset(&quectel_cfg, 0, sizeof(struct SerialDataCfg));
quectel_cfg.serial_baud_rate = BAUD_RATE_115200;
quectel_cfg.serial_data_bits = DATA_BITS_8;
quectel_cfg.serial_stop_bits = STOP_BITS_1;
quectel_cfg.serial_parity_mode = PARITY_NONE;
quectel_cfg.serial_bit_order = BIT_ORDER_LSB;
quectel_cfg.serial_invert_mode = NRZ_NORMAL;
// quectel_cfg.serial_buffer_size = SERIAL_RB_BUFSZ;
quectel_cfg.serial_buffer_size = 1024;
quectel_cfg.serial_timeout = 1000;
quectel_cfg.is_ext_uart = 0;
// quectel_cfg.ext_uart_no = ADAPTER_QUECTEL_DRIVER_EXT_PORT;
// quectel_cfg.port_configure = PORT_CFG_INIT;
struct PrivIoctlCfg ioctl_cfg;
ioctl_cfg.ioctl_driver_type = SERIAL_TYPE;
ioctl_cfg.args = &quectel_cfg;
if (0 != PrivIoctl(quectel_fd, OPE_INT, &ioctl_cfg)) {
printf("ioctl quectel fd error %d\n", quectel_fd);
PrivClose(quectel_fd);
return;
}
printf("4G module set\n");
// memset(recv_buf, 0, sizeof(recv_buf));
// printf("chk_buad: %s\n", chk_buad);
// printf("chk_buad_len: %d\n", strlen(chk_buad));
// PrivWrite(quectel_fd, chk_buad, strlen(chk_buad));
// PrivTaskDelay(30);
// buf_len = PrivRead(quectel_fd, recv_buf, sizeof(recv_buf));
// printf("buf_len: %d\n", buf_len);
// printf("[%s] Info: Recv from uart: %s\n", __func__, recv_buf);
// PrivTaskDelay(1000);
memset(recv_buf, 0, sizeof(recv_buf));
printf("set_mode: %s\n", set_mode);
printf("set_mode_len: %d\n", strlen(set_mode));
PrivWrite(quectel_fd, set_mode, strlen(set_mode));
PrivTaskDelay(30);
buf_len = PrivRead(quectel_fd, recv_buf, sizeof(recv_buf));
printf("buf_len: %d\n", buf_len);
printf("[%s] Info: Recv from uart: %s\n", __func__, recv_buf);
PrivTaskDelay(1000);
// memset(recv_buf, 0, sizeof(recv_buf));
// printf("set_cfg: %s\n", set_cfg);
// printf("set_cfg_len: %d\n", strlen(set_cfg));
// PrivWrite(quectel_fd, set_cfg, strlen(set_cfg));
// PrivTaskDelay(30);
// buf_len = PrivRead(quectel_fd, recv_buf, sizeof(recv_buf));
// printf("buf_len: %d\n", buf_len);
// printf("[%s] Info: Recv from uart: %s\n", __func__, recv_buf);
// PrivTaskDelay(1000);
memset(recv_buf, 0, sizeof(recv_buf));
printf("set_server: %s\n", set_server);
printf("set_server_len: %d\n", strlen(set_server));
PrivWrite(quectel_fd, set_server, strlen(set_server));
PrivTaskDelay(30);
buf_len = PrivRead(quectel_fd, recv_buf, sizeof(recv_buf));
printf("buf_len: %d\n", buf_len);
printf("[%s] Info: Recv from uart: %s\n", __func__, recv_buf);
PrivTaskDelay(1000);
memset(recv_buf, 0, sizeof(recv_buf));
printf("set_conn: %s\n", set_conn);
printf("set_conn_len: %d\n", strlen(set_conn));
PrivWrite(quectel_fd, set_conn, strlen(set_conn));
PrivTaskDelay(30);
buf_len = PrivRead(quectel_fd, recv_buf, sizeof(recv_buf));
printf("buf_len: %d\n", buf_len);
printf("[%s] Info: Recv from uart: %s\n", __func__, recv_buf);
PrivTaskDelay(1000);
while (1) {
printf("start send\n");
char set_reply[50] = {"AT+QMTPUBEX=0,0,0,0,\"/reply\","};
char data_len_str[20];
sprintf(data_len_str, "%d", strlen(trans_data));
printf("data_len_str: %s\n", data_len_str);
strcat(set_reply, data_len_str);
strcat(set_reply, "\r\n");
memset(recv_buf, 0, sizeof(recv_buf));
printf("set_reply: %s\n", set_reply);
printf("set_reply_len: %d\n", strlen(set_reply));
PrivWrite(quectel_fd, set_reply, strlen(set_reply));
PrivTaskDelay(30);
buf_len = PrivRead(quectel_fd, recv_buf, sizeof(recv_buf));
printf("buf_len: %d\n", buf_len);
printf("[%s] Info: Recv from uart: %s\n", __func__, recv_buf);
PrivTaskDelay(500);
memset(recv_buf, 0, sizeof(recv_buf));
printf("send_data: %s\n", trans_data);
printf("send_data_len: %d\n", strlen(trans_data));
PrivWrite(quectel_fd, trans_data, strlen(trans_data));
PrivTaskDelay(30);
buf_len = PrivRead(quectel_fd, recv_buf, sizeof(recv_buf));
printf("buf_len: %d\n", buf_len);
printf("[%s] Info: Recv from uart: %s\n", __func__, recv_buf);
PrivTaskDelay(5000);
}
PrivClose(quectel_fd);
return;
}
PRIV_SHELL_CMD_FUNCTION(Test4G, a quectel test sample, PRIV_SHELL_CMD_MAIN_ATTR);
#endif

View File

@@ -18,6 +18,7 @@
* @date: 2023/2/17
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <transform.h>
#ifdef ADD_XIZI_FEATURES
@@ -54,28 +55,34 @@ void TestCAN(void)
}
printf("CAN configure successful!\n");
uint8_t data_buff[64u] = {1,2,3,4,4,3,2,1};
uint8_t data_buff[64u] = "12344321";
struct CanSendConfigure frame_send;
frame_send.ide=0;
frame_send.stdid = 0x55;
frame_send.rtr=0;
frame_send.data_lenth=8;
frame_send.data = data_buff;
struct CanSendConfigure frame_recv;
uint8_t recv_buff[65U] = {0};
uint8_t recv_buff[64u] = {};
frame_recv.data = recv_buff;
// CAN write
while (1)
{
PrivTaskDelay(500);
PrivWrite(can_fd, &frame_send, NONE);
PrivTaskDelay(500);
// PrivTaskDelay(500);
// PrivWrite(can_fd, &frame_send, NONE);
// PrivTaskDelay(500);
PrivRead(can_fd, &frame_recv, NONE);
// if any data has received,Then printf message
if(frame_recv.data_lenth > 0){
printf("ID %08x:%s\n",frame_recv.exdid,frame_recv.data);
printf("ID %08x : \n",frame_recv.exdid);
for(int i = 0; i < frame_recv.data_lenth; i ++) {
printf("0x%x ", frame_recv.data[i]);
}
printf("\n");
frame_send.data = recv_buff;
PrivWrite(can_fd, &frame_send, NONE);
}
}

View File

@@ -22,6 +22,7 @@
#include <transform.h>
#ifdef ADD_XIZI_FEATURES
#ifdef BSP_USING_W5500
#include <socket.h>
#define BUFF_SIZE 128
@@ -189,6 +190,6 @@ PRIV_SHELL_CMD_FUNCTION(TestSocketAsClient, a w5500 client-ip-port-msg test samp
#endif
#endif
#endif

View File

@@ -22,7 +22,7 @@
#include <transform.h>
#ifdef ADD_XIZI_FEATURES
#define BSP_LED_PIN 29
#define BSP_LED_PIN 134
#define NULL_PARAMETER 0
static uint16_t pin_fd=0;
@@ -30,6 +30,7 @@ static struct PinStat pin_led;
void LedFlip(void *parameter)
{
printf("%s val %d time %d\n", __func__, pin_led.val, PrivGetTickTime());
pin_led.pin = BSP_LED_PIN;
pin_led.val = !pin_led.val;
PrivWrite(pin_fd, &pin_led, NULL_PARAMETER);
@@ -37,7 +38,7 @@ void LedFlip(void *parameter)
void TestHwTimer(void)
{
x_ticks_t period = 1;
uint32_t period_ms = 500;
pin_fd = PrivOpen(HWTIMER_PIN_DEV_DRIVER, O_RDWR);
if(pin_fd<0) {
@@ -75,7 +76,7 @@ void TestHwTimer(void)
return;
}
ioctl_cfg.args = (void *)&period;
ioctl_cfg.args = (void *)&period_ms;
if (0 != PrivIoctl(timer_fd, OPE_CFG, &ioctl_cfg)) {
printf("timer pin fd error %d\n", pin_fd);
PrivClose(pin_fd);

View File

@@ -98,6 +98,7 @@ void TestLora(int argc, char *argv[])
uart_cfg.serial_buffer_size = SERIAL_RB_BUFSZ;
uart_cfg.serial_timeout = 1000;
uart_cfg.is_ext_uart = 0;
uart_cfg.dev_recv_callback = NULL;
ioctl_cfg.ioctl_driver_type = SERIAL_TYPE;
ioctl_cfg.args = (void *)&uart_cfg;

View File

@@ -62,6 +62,7 @@ static struct SerialDataCfg serial_cfg =
.serial_buffer_size = SERIAL_RB_BUFSZ,
.serial_timeout = E220_DAFAULT_SERIAL_TIMEOUT, // 串口超时配置
.is_ext_uart = 0,
.dev_recv_callback = NULL,
};
enum LoraMode current_mode = -1; // 当前模块处于什么模式

View File

@@ -569,7 +569,7 @@ int32_t MQTTMsgPublish(int32_t sock, char *topic, int8_t qos, uint8_t* msg)
uint8_t buf[MSG_MAX_LEN];
int32_t buflen = sizeof(buf),len;
MQTTString topicString = MQTTString_initializer;
uint16_t packid = 0,packetidbk;
uint16_t packid = 0,packetidbk = 0;
//填充主题
topicString.cstring = (char *)topic;

View File

@@ -138,6 +138,7 @@ void Test485(void)
uart_cfg.serial_buffer_size = SERIAL_RB_BUFSZ;
uart_cfg.serial_timeout = -1;
uart_cfg.is_ext_uart = 0;
uart_cfg.dev_recv_callback = NULL;
ioctl_cfg.ioctl_driver_type = SERIAL_TYPE;
ioctl_cfg.args = (void *)&uart_cfg;

View File

@@ -70,6 +70,7 @@ void Test485(void)
uart_cfg.serial_buffer_size = SERIAL_RB_BUFSZ;
uart_cfg.serial_timeout = 1000;
uart_cfg.is_ext_uart = 0;
uart_cfg.dev_recv_callback = NULL;
ioctl_cfg.ioctl_driver_type = SERIAL_TYPE;
ioctl_cfg.args = (void *)&uart_cfg;

View File

@@ -76,10 +76,12 @@ struct IperfParam {
static void* TestIperfServer(void* param)
{
struct IperfParam* iperf_param = (struct IperfParam*)param;
int sock = socket(AF_INET, SOCK_STREAM, 0);
int sock = socket(AF_INET, SOCK_STREAM, 6);
if (sock < 0) {
printf("[%s] Err: Can't create socker.\n", __func__);
return NULL;
} else {
printf("[%s] Info Create server socket %d\n", __func__, sock);
}
uint8_t* recv_data = (uint8_t*)malloc(IPERF_BUFSZ);
@@ -121,8 +123,9 @@ static void* TestIperfServer(void* param)
socklen_t sin_size = sizeof(struct sockaddr_in);
struct sockaddr_in client_addr;
int connection = accept(sock, (struct sockaddr*)&client_addr, &sin_size);
printf("[%s] Info: New client connected from (%s, %d)\n", __func__,
inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
printf("[%s] Info: New client connected from (%s, %d), connect: %d\n", __func__,
inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port),
connection);
int flag = 1;
setsockopt(connection,
@@ -141,8 +144,8 @@ static void* TestIperfServer(void* param)
inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
break;
} else if (bytes_received < 0) {
KPrintf("recv error, client: (%s, %d)\n",
inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
KPrintf("recv error: %d, client: (%s, %d)\n",
bytes_received, inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
break;
}
@@ -258,8 +261,6 @@ enum IperfParamEnum {
void TestSocket(int argc, char* argv[])
{
lwip_config_tcp(0, lwip_ipaddr, lwip_netmask, lwip_gwaddr);
static char usage_info[] = "Run either a iperf server or iperf client.";
static char program_info[] = "Lwip socket test task, a simple iperf.";
static const char* const usages[] = {

View File

@@ -23,12 +23,13 @@
void TimerFunction(union sigval sig_val)
{
static int cnt = 0;
printf("%s cnt %d\n", __func__, cnt++);
printf("%s cnt %d ms %d\n", __func__, cnt++, PrivGetTickTime());
}
void TestTimer(void)
{
int ret = 0;
static int count = 0;
int timer_flags;
timer_t timer_id;
struct sigevent evp;
@@ -40,7 +41,9 @@ void TestTimer(void)
evp.sigev_notify_function = TimerFunction;
evp.sigev_notify_attributes = &timer_flags;
ret = timer_create(CLOCK_REALTIME, &evp, &timer_id);
count++;
ret = PrivTimerCreate(count, &evp, &timer_id);
if (ret < 0) {
printf("%s create timer failed ret %d\n", __func__, ret);
return;
@@ -48,14 +51,14 @@ void TestTimer(void)
struct itimerspec value;
//active time interval
value.it_interval.tv_sec = 2;
value.it_interval.tv_nsec = 0;
value.it_interval.tv_sec = 0;
value.it_interval.tv_nsec = 1000000 * 10;
//first timer set time
value.it_value.tv_sec = 2;
value.it_value.tv_nsec = 0;
ret = timer_settime(timer_id, 1, &value, NULL);
ret = PrivTimerModify(timer_id, 1, &value, NULL);
if (ret < 0) {
printf("%s set timer time failed ret %d\n", __func__, ret);
return;

View File

@@ -68,6 +68,7 @@ void TestUart(int argc, char* argv[])
uart_cfg.serial_buffer_size = SERIAL_RB_BUFSZ;
uart_cfg.serial_timeout = -1;
uart_cfg.is_ext_uart = 0;
uart_cfg.dev_recv_callback = NULL;
struct PrivIoctlCfg ioctl_cfg;
ioctl_cfg.ioctl_driver_type = SERIAL_TYPE;

View File

@@ -15,6 +15,10 @@ ifeq ($(CONFIG_ADD_XIZI_FEATURES),y)
SRC_DIR += socket_demo
endif
ifeq ($(CONFIG_CONNECTION_ADAPTER_FREEMODBUSTCP),y)
SRC_DIR += freemodbus_tcp_slave
endif
include $(KERNEL_ROOT)/compiler.mk
endif

View File

@@ -0,0 +1,3 @@
SRC_FILES := tcpserver_sample.c
include $(KERNEL_ROOT)/compiler.mk

View File

@@ -0,0 +1,259 @@
/*
* FreeModbus Libary: Win32 Demo Application
* Copyright (C) 2006 Christian Walter <wolti@sil.at>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* File: $Id$
*/
/**********************************************************
* Linux TCP support.
* Based on Walter's project.
* Modified by Steven Guo <gotop167@163.com>
***********************************************************/
/* ----------------------- Standard C Libs includes --------------------------*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
#include <signal.h>
#include <transform.h>
#include "lwip/sys.h"
#include "lwip/sockets.h"
/* ----------------------- Modbus includes ----------------------------------*/
#include "mb.h"
#include "mbport.h"
/* ----------------------- Defines ------------------------------------------*/
#define PROG "freemodbus"
#define REG_INPUT_START 1000
#define REG_INPUT_NREGS 4
#define REG_HOLDING_START 2000
#define REG_HOLDING_NREGS 10
/* ----------------------- Static variables ---------------------------------*/
static USHORT usRegInputStart = REG_INPUT_START;
static USHORT usRegInputBuf[REG_INPUT_NREGS];
static USHORT usRegHoldingStart = REG_HOLDING_START;
static USHORT usRegHoldingBuf[REG_HOLDING_NREGS];
static pthread_mutex_t xLock;
static enum ThreadState
{
STOPPED,
RUNNING,
SHUTDOWN
} ePollThreadState;
/* ----------------------- Static functions ---------------------------------*/
static BOOL bCreatePollingThread( void );
static enum ThreadState eGetPollingThreadState( void );
static void eSetPollingThreadState( enum ThreadState eNewState );
static void* pvPollingThread( void *pvParameter );
int LWIPConnectSocket(uint16_t port);
/* ----------------------- Start implementation -----------------------------*/
int MBSlave()
{
int iExitCode;
CHAR cCh;
BOOL bDoExit;
usRegHoldingBuf[5] = 123;
usRegHoldingBuf[7] = 234;
printf("%s ip %d.%d.%d.%d mask %d.%d.%d.%d gw %d.%d.%d.%d\n", __func__,
192, 168, 250, 233,
255, 255, 255, 255,
192, 168, 250, 1);
uint8_t local_ip[4] = {192,168,250,233};
uint8_t gateway[4] = {192,168,250,1};
uint8_t netmask[4] = {255,255,255,0};
lwip_config_tcp(0, local_ip, netmask, gateway);
printf("%s LWIPInit done\n", __func__);
if( eMBTCPInit( MB_TCP_PORT_USE_DEFAULT ) != MB_ENOERR )
{
fprintf( stderr, "%s: can't initialize modbus stack!\r\n", PROG );
iExitCode = EXIT_FAILURE;
}
else
{
eSetPollingThreadState( STOPPED );
/* CLI interface. */
if( bCreatePollingThread( ) != TRUE )
{
printf( "Can't start protocol stack! Already running?\r\n" );
}
}
printf("%d %d %s\n",sizeof(usRegHoldingBuf),__LINE__,__func__);
while(1)
{
for(int i =0; i<sizeof(usRegHoldingBuf)/2;i++)
{
printf("poll recv is %3d\n", usRegHoldingBuf[i]);
MdelayKTask(100);
}
}
return iExitCode;
}
PRIV_SHELL_CMD_FUNCTION(MBSlave, a Mtcp server Demo, PRIV_SHELL_CMD_MAIN_ATTR);
BOOL bCreatePollingThread( void )
{
BOOL bResult;
pthread_t xThread;
if( eGetPollingThreadState( ) == STOPPED )
{
if( pthread_create( &xThread, NULL, pvPollingThread, NULL ) != 0 )
{
/* Can't create the polling thread. */
bResult = FALSE;
}
else
{
bResult = TRUE;
}
}
else
{
bResult = FALSE;
}
return bResult;
}
void* pvPollingThread( void *pvParameter )
{
eSetPollingThreadState( RUNNING );
if( eMBEnable( ) == MB_ENOERR )
{
do
{
if( eMBPoll( ) != MB_ENOERR )
break;
}
while( eGetPollingThreadState( ) != SHUTDOWN );
}
( void )eMBDisable( );
eSetPollingThreadState( STOPPED );
return 0;
}
enum ThreadState eGetPollingThreadState( )
{
enum ThreadState eCurState;
( void )pthread_mutex_lock( &xLock );
eCurState = ePollThreadState;
( void )pthread_mutex_unlock( &xLock );
return eCurState;
}
void eSetPollingThreadState( enum ThreadState eNewState )
{
( void )pthread_mutex_lock( &xLock );
ePollThreadState = eNewState;
( void )pthread_mutex_unlock( &xLock );
}
eMBErrorCode eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs )
{
eMBErrorCode eStatus = MB_ENOERR;
int iRegIndex;
if( ( usAddress >= REG_INPUT_START )
&& ( usAddress + usNRegs <= REG_INPUT_START + REG_INPUT_NREGS ) )
{
iRegIndex = ( int )( usAddress - usRegInputStart );
while( usNRegs > 0 )
{
*pucRegBuffer++ = ( unsigned char )( usRegInputBuf[iRegIndex] >> 8 );
*pucRegBuffer++ = ( unsigned char )( usRegInputBuf[iRegIndex] & 0xFF );
iRegIndex++;
usNRegs--;
}
}
else
{
eStatus = MB_ENOREG;
}
return eStatus;
}
eMBErrorCode eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegisterMode eMode )
{
eMBErrorCode eStatus = MB_ENOERR;
int iRegIndex;
if( ( usAddress >= REG_HOLDING_START ) &&
( usAddress + usNRegs <= REG_HOLDING_START + REG_HOLDING_NREGS ) )
{
iRegIndex = ( int )( usAddress - usRegHoldingStart );
switch ( eMode )
{
/* Pass current register values to the protocol stack. */
case MB_REG_READ:
while( usNRegs > 0 )
{
*pucRegBuffer++ = ( UCHAR ) ( usRegHoldingBuf[iRegIndex] >> 8 );
*pucRegBuffer++ = ( UCHAR ) ( usRegHoldingBuf[iRegIndex] & 0xFF );
iRegIndex++;
usNRegs--;
}
break;
/* Update current register values with new values from the
* protocol stack. */
case MB_REG_WRITE:
while( usNRegs > 0 )
{
usRegHoldingBuf[iRegIndex] = *pucRegBuffer++ << 8;
usRegHoldingBuf[iRegIndex] |= *pucRegBuffer++;
iRegIndex++;
usNRegs--;
}
}
}
else
{
eStatus = MB_ENOREG;
}
return eStatus;
}
eMBErrorCode eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNCoils, eMBRegisterMode eMode )
{
return MB_ENOREG;
}
eMBErrorCode eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNDiscrete )
{
return MB_ENOREG;
}

View File

@@ -1,3 +1,3 @@
SRC_DIR := advantech beckhoff br delta mitsubishi omron schneider siemens ge xinje inovance keyence
SRC_DIR := advantech beckhoff br delta mitsubishi omron schneider siemens ge xinje inovance keyence panasonic fatek ab abb
include $(KERNEL_ROOT)/compiler.mk

View File

@@ -0,0 +1,3 @@
SRC_FILES := ab_l30erm.c ab_micro850.c
include $(KERNEL_ROOT)/compiler.mk

View File

@@ -0,0 +1,91 @@
# AB_850通信测试
[TOC]
## 通信接线及参数设置
* 网口
*Mosbus TCP协议IP192.168.250.56Port502
## 存储区
- 存储区D区
## JSON配方设计
* AB_850类型PLC需要配置控制器映射
![](./image/modbus映射.png)
* 共测试Word和real共2种类型数据,real型数据有2个Word组成以下为JSON文件解释。
- ```json
{
"device_id": 1, //设备ID默认是1此参数无效
"device_name": "AB_850", //设备名称,自定义
"communication_type": 0, //通讯协议类型 0是以太网1是串口
"socket_config": { //以太网配置
"plc_ip": "192.168.250.56", //PLC的IP地址
"local_ip": "192.168.250.233", //矽达通IP地址设定
"gateway": "192.168.250.1", //矽达通的网关地址设定
"netmask": "255.255.255.0", //矽达通子网掩码设定
"port":502 //端口号设定
},
"protocol_type": 2, //通讯协议2代表modbus-tcp协议
"read_period": 100, //交互周期ms
"read_item_list": [
{
"value_name": "CON_DATA[0]", //变量名称,自定义
"value_type": 1, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"function_code": 1, //功能码。1是读线圈
"start_address": 0, //起始地址
"data_length": 1 //默认是1代表读取1个数据类型长度
},
{
"value_name": "CON_DATA[1]", //变量名称,自定义
"value_type": 1, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"function_code": 1, //功能码。1是读
"start_address": 1, //起始地址偏移1位106*8+1=849
"data_length": 1 //默认是1代表读取1个数据类型长度
},
{
"value_name": "CON_INT", //变量名称,自定义
"value_type": 3, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"function_code": 3, //功能码。3是读
"start_address": 2, //起始地址偏移2位
"data_length": 1 //默认是1代表读取1个数据类型长度
},
{
"value_name": "CON_ARRAY[0]_1", //变量名称,自定义
"value_type": 3, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"function_code": 3, //功能码。3是读
"start_address": 3, //起始地址偏移3位
"data_length": 1 //默认是1代表读取1个数据类型长度
},
{
"value_name": "CON_ARRAY[0]_2", //变量名称,自定义,CON_ARRAY[0]_1和CON_ARRAY[0]_2组成real型数据
"value_type": 3, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"function_code": 3, //功能码。3是读
"start_address": 4, //起始地址偏移4位
"data_length": 1 //默认是1代表读取1个数据类型长度
}
]
}
```
## 通信测试
(1) 新增1个通信demo命名为ab_micro850.c
(2) 复制modbus_tcp样例代码程序到ab_micro850.c文件中
(3) void **ControlAB850Test**(void) 更改函数名;
(4) PRIV_SHELL_CMD_FUNCTION(**ControlAB850Test**, AB Plc micro850 Demo**, PRIV_SHELL_CMD_MAIN_ATTR);更改测试指令;
(5) 剪裁配置完成后,用过烧写器下载至矽数通中,重启后完成测试。

View File

@@ -0,0 +1,71 @@
# AB_L30ERM通信测试
[TOC]
## 通信接线及参数设置
* 网口
*Ethernet/ip协议IP192.168.250.57Port44818
## 存储区
- Ethernet/ip协议是根据变量名称搜索寄存器地址
## JSON配方设计
* 本实例共测试Word和real共2种类型数据以下为JSON文件解释。
- ```json
{
"device_id": “ab_l30”, //
"device_name": "robot", //设备名称,自定义
"communication_type": 0, //通讯协议类型 0是以太网1是串口
"socket_config": { //以太网配置
"plc_ip": "192.168.250.37", //PLC的IP地址
"local_ip": "192.168.250.123", //矽达通IP地址设定
"gateway": "192.168.250.1", //矽达通的网关地址设定
"netmask": "255.255.255.0", //矽达通子网掩码设定
"port":502 //端口号设定
},
"protocol_type": 12, //通讯协议12代表ethernet/ip协议
"read_period": 100, //交互周期ms
"read_item_list": [
{
"value_name": "L30_SPEED", //变量名称,自定义
"value_type": 3, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"wordlen": "WORD", //以WORD方式传输
"amount": 1 //默认是1代表读取1个数据类型长度
},
{
"value_name": "L30_TORQUE", //变量名称,自定义
"value_type": 9, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"wordlen": 2, //以WORD方式传输
"amount": 1 //默认是1代表读取1个数据类型长度
},
{
"value_name": "D", //变量名称,自定义
"value_type": 3, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"wordlen": 3, //以WORD方式传输
"amount": 1 //默认是1代表读取1个数据类型长度
}
]
}
```
## 通信测试
(1) 新增1个通信demo命名为ab_l30erm.c
(2) 复制modbus_tcp样例代码程序到ab_l30erm.c文件中
(3) void **ControlABL30Test**(void) 更改函数名;
(4) PRIV_SHELL_CMD_FUNCTION(**ControlABL30Test**, AB Plc l30ermDemo**, PRIV_SHELL_CMD_MAIN_ATTR);更改测试指令;
(5) 剪裁配置完成后,用过烧写器下载至矽数通中,重启后完成测试。

View File

@@ -0,0 +1,48 @@
/*
* Copyright (c) 2022 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file ab_l30.c
* @brief PLC ABB L30 app
* @version 3.0
* @author AIIT XUOS Lab
* @date 2023.8.27
*/
#include <control.h>
void ControlABL30Test(void)
{
int i = 0;
uint16_t read_data_length = 0;
uint8_t read_data[1024] = {0};
ControlProtocolType CIP_protocol = ControlProtocolFind();
if (NULL == CIP_protocol) {
printf("%s get CIP protocol %p failed\n", __func__, CIP_protocol);
return;
}
printf("%s get CIP protocol %p successfull\n", __func__, CIP_protocol);
if (CONTROL_REGISTERED == CIP_protocol->protocol_status) {
ControlProtocolOpen(CIP_protocol);
for (;;) {
read_data_length = ControlProtocolRead(CIP_protocol, read_data, sizeof(read_data));
printf("%s read [%d] CIP data %d using receipe file\n", __func__, i, read_data_length);
i++;
PrivTaskDelay(1000);
}
//ControlProtocolClose(CIP_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlABL30Test, Ab Plc CIP Demo, PRIV_SHELL_CMD_MAIN_ATTR);

View File

@@ -0,0 +1,52 @@
/*
* Copyright (c) 2022 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file ab_micro850.c
* @brief PLC AB MICRO850 app
* @version 3.0
* @author AIIT XUOS Lab
* @date 2023.10.5
*/
#include <control.h>
void ControlAB850Test(void)
{
int i, j = 0;
int read_data_length = 0;
uint8_t read_data[128] = {0};
ControlProtocolType modbus_tcp_protocol = ControlProtocolFind();
if (NULL == modbus_tcp_protocol) {
printf("%s get modbus tcp protocol %p failed\n", __func__, modbus_tcp_protocol);
return;
}
printf("%s get modbus tcp protocol %p successfull\n", __func__, modbus_tcp_protocol);
if (CONTROL_REGISTERED == modbus_tcp_protocol->protocol_status) {
ControlProtocolOpen(modbus_tcp_protocol);
for (;;) {
read_data_length = ControlProtocolRead(modbus_tcp_protocol, read_data, sizeof(read_data));
printf("%s read [%d] modbus tcp data %d using receipe file\n", __func__, i, read_data_length);
if (read_data_length) {
for (j = 0; j < read_data_length; j ++) {
printf("j %d data 0x%x\n", j, read_data[j]);
}
}
i++;
memset(read_data, 0, sizeof(read_data));
PrivTaskDelay(10000);
}
//ControlProtocolClose(modbus_tcp_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlAB850Test, AB Plc MICRO850 Demo, PRIV_SHELL_CMD_MAIN_ATTR);

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,34 @@
{
"device_id": "ab_l30",
"device_name": "robot",
"communication_type": 0,
"socket_config": {
"plc_ip": "192.168.250.57",
"local_ip": "192.168.250.123",
"gateway": "192.168.250.1",
"netmask": "255.255.255.0",
"port": 44818
},
"protocol_type": 12,
"read_period": 100,
"read_item_list": [
{
"value_name": "L30_SPEED",
"value_type": 3,
"wordlen": "WORD",
"amount": 1
},
{
"value_name": "L30_TORQUE",
"value_type": 9,
"wordlen": "WORD",
"amount": 1
},
{
"value_name": "D",
"value_type": 3,
"wordlen": "WORD",
"amount": 1
}
]
}

View File

@@ -0,0 +1,51 @@
{
"device_id": 1,
"device_name": "AB_850",
"communication_type": 0,
"socket_config": {
"plc_ip": "192.168.250.32",
"local_ip": "192.168.250.56",
"gateway": "192.168.250.1",
"netmask": "255.255.255.0",
"port": 502
},
"protocol_type": 2,
"read_period": 100,
"read_item_list": [
{
"value_name": "D106.0",
"value_type": 1,
"function_code": 1,
"start_address": 848,
"quantity": 1
},
{
"value_name": "D106.1",
"value_type": 1,
"function_code": 1,
"start_address":849,
"quantity": 1
},
{
"value_name": "D100",
"value_type": 3,
"function_code": 3,
"start_address": 100,
"quantity": 1
},
{
"value_name": "D102",
"value_type": 3,
"function_code": 3,
"start_address": 102,
"quantity": 1
},
{
"value_name": "D103",
"value_type": 3,
"function_code": 3,
"start_address": 103,
"quantity": 1
}
]
}

View File

@@ -0,0 +1,3 @@
SRC_FILES := abb_pm5630.c
include $(KERNEL_ROOT)/compiler.mk

View File

@@ -0,0 +1,87 @@
# ABB通信测试
[TOC]
## 通信接线及参数设置
* 网口
*Mosbus TCP协议IP192.168.250.58Port502
## 存储区
- 存储区MW区
## JSON配方设计
* 共测试Word和real共2种类型数据,real型数据有2个Word组成以下为JSON文件解释。
- ```json
{
"device_id": 1, //设备ID默认是1此参数无效
"device_name": "ABB_PM5630", //设备名称,自定义
"communication_type": 0, //通讯协议类型 0是以太网1是串口
"socket_config": { //以太网配置
"plc_ip": "192.168.250.58", //PLC的IP地址
"local_ip": "192.168.250.233", //矽达通IP地址设定
"gateway": "192.168.250.1", //矽达通的网关地址设定
"netmask": "255.255.255.0", //矽达通子网掩码设定
"port":502 //端口号设定
},
"protocol_type": 2, //通讯协议2代表modbus-tcp协议
"read_period": 100, //交互周期ms
"read_item_list": [
{
"value_name": "MW0", //变量名称,自定义
"value_type": 3, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"function_code": 3, //功能码。3是读
"start_address": 0, //起始地址
"data_length": 1 //默认是1代表读取1个数据类型长度
},
{
"value_name": "MW1", //变量名称,自定义
"value_type": 3, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"function_code": 3, //功能码。3是读
"start_address": 1, //起始地址偏移1位
"data_length": 1 //默认是1代表读取1个数据类型长度
},
{
"value_name": "MW10", //变量名称,自定义
"value_type": 3, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"function_code": 3, //功能码。3是读
"start_address": 10, //起始地址偏移10位
"data_length": 1 //默认是1代表读取1个数据类型长度
},
{
"value_name": "MD20_1", //变量名称,自定义
"value_type": 3, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"function_code": 3, //功能码。3是读
"start_address": 20, //起始地址偏移20位
"data_length": 1 //默认是1代表读取1个数据类型长度
},
{
"value_name": "MD20_2", //变量名称,自定义,MD20_1和MD20_2组成real型数据
"value_type": 3, //变量类型BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
"function_code": 3, //功能码。3是读
"start_address": 21, //起始地址偏移21位
"data_length": 1 //默认是1代表读取1个数据类型长度
}
]
}
```
## 通信测试
(1) 新增1个通信demo命名为abb_pm5630.c
(2) 复制modbus_tcp样例代码程序到abb_pm5630.c文件中
(3) void **ControlABBPM5630Test**(void) 更改函数名;
(4) PRIV_SHELL_CMD_FUNCTION(**ControlABBPM5630Test**, ABB Plc PM5630 Demo**, PRIV_SHELL_CMD_MAIN_ATTR);更改测试指令;
(5) 剪裁配置完成后,用过烧写器下载至矽数通中,重启后完成测试。

View File

@@ -0,0 +1,52 @@
/*
* Copyright (c) 2022 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file abb_pm5630.c
* @brief PLC ABB pm5630 app
* @version 3.0
* @author AIIT XUOS Lab
* @date 2023.10.20
*/
#include <control.h>
void ControlABBPM5630Test(void)
{
int i, j = 0;
int read_data_length = 0;
uint8_t read_data[128] = {0};
ControlProtocolType modbus_tcp_protocol = ControlProtocolFind();
if (NULL == modbus_tcp_protocol) {
printf("%s get modbus tcp protocol %p failed\n", __func__, modbus_tcp_protocol);
return;
}
printf("%s get modbus tcp protocol %p successfull\n", __func__, modbus_tcp_protocol);
if (CONTROL_REGISTERED == modbus_tcp_protocol->protocol_status) {
ControlProtocolOpen(modbus_tcp_protocol);
for (;;) {
read_data_length = ControlProtocolRead(modbus_tcp_protocol, read_data, sizeof(read_data));
printf("%s read [%d] modbus tcp data %d using receipe file\n", __func__, i, read_data_length);
if (read_data_length) {
for (j = 0; j < read_data_length; j ++) {
printf("j %d data 0x%x\n", j, read_data[j]);
}
}
i++;
memset(read_data, 0, sizeof(read_data));
PrivTaskDelay(10000);
}
//ControlProtocolClose(modbus_tcp_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlABBPM5630Test, ABB Plc PM5630 Demo, PRIV_SHELL_CMD_MAIN_ATTR);

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

View File

@@ -0,0 +1,51 @@
{
"device_id": 1,
"device_name": "ABB_PM5630",
"communication_type": 0,
"socket_config": {
"plc_ip": "192.168.250.32",
"local_ip": "192.168.250.58",
"gateway": "192.168.250.1",
"netmask": "255.255.255.0",
"port": 502
},
"protocol_type": 2,
"read_period": 100,
"read_item_list": [
{
"value_name": "MW0",
"value_type": 3,
"function_code": 3,
"start_address": 0,
"quantity": 1
},
{
"value_name": "MW1",
"value_type": 3,
"function_code": 3,
"start_address":1,
"quantity": 1
},
{
"value_name": "MW10",
"value_type": 3,
"function_code": 3,
"start_address": 10,
"quantity": 1
},
{
"value_name": "MD20_1",
"value_type": 3,
"function_code": 3,
"start_address":20,
"quantity": 1
},
{
"value_name": "MD20_2",
"value_type": 3,
"function_code": 3,
"start_address":21,
"quantity": 1
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

View File

@@ -1,22 +1,48 @@
# 台达 DVP通信测试
# 台达 PLC与矽达通ARM通信测试
[TOC]
## 通信接线及参数设置
## 台达DVP与矽达通ARM通信处测试
### 通信接线及参数设置
* 网口
* 通过自带 RJ45 网口连接
* 网口参数IP192.168.250.27 Port502
* 测试的协议:Modbus TCP
## 存储区
### 存储区
- 含MDXY。台达PLC中 各存储区地址和Modbus地址有明确的对应表详见台达DVP协议解析测试文档。
## 通信测试
### 通信测试
- 共测试BOOLINT16INT32FLOAT 共四种类型数据。
- 测试D区M区和Y区。
## 台达AS332T与矽达通ARM通信处测试
### 通信接线及参数设置
* 网口
* 通过自带 RJ45 网口连接
* 网口参数IP192.168.250.5 Port502
* 测试的协议:Modbus TCP
### 存储区
- 含MDXY。台达PLC中 各存储区地址和Modbus地址有明确的对应表详见台达AS332T协议解析测试文档。
### 通信测试结果
- 共测试BOOLINT16INT32FLOAT 共四种类型数据。
- 测试D区M区和Y区。
![](./image/recipe.png)
![](./image/test_result1.png)
![](./image/test_result2.png)

View File

@@ -1,4 +1,6 @@
/*
* Copyright (c) 2022 AIIT XUOS Lab
/*
* Copyright (c) 2022 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
@@ -15,9 +17,53 @@
* @brief PLC DELTA AS332T app
* @version 3.0
* @author AIIT XUOS Lab
* @date 2022.9.27
* @date 2022.10.10
*/
#include <control.h>
extern int Adapter4GActive(void);
void ControlDeltaas332tTest(void)
{
int i, j = 0;
int read_data_length = 0;
uint8_t read_data[128] = {0};
#ifdef CONNECTION_ADAPTER_4G
Adapter4GActive();
#endif
ControlProtocolType modbus_tcp_protocol = ControlProtocolFind();
if (NULL == modbus_tcp_protocol) {
printf("%s get modbus tcp protocol %p failed\n", __func__, modbus_tcp_protocol);
return;
}
printf("%s get modbus tcp protocol %p successfull\n", __func__, modbus_tcp_protocol);
if (CONTROL_REGISTERED == modbus_tcp_protocol->protocol_status) {
ControlProtocolOpen(modbus_tcp_protocol);
for (;;) {
read_data_length = ControlProtocolRead(modbus_tcp_protocol, read_data, sizeof(read_data));
printf("%s read [%d] modbus tcp data %d using receipe file\n", __func__, i, read_data_length);
if (read_data_length) {
for (j = 0; j < read_data_length; j ++) {
printf("j %d data 0x%x\n", j, read_data[j]);
}
}
i++;
memset(read_data, 0, sizeof(read_data));
PrivTaskDelay(10000);
}
//ControlProtocolClose(modbus_tcp_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlDeltaas332tTest, Delta as332t Demo, PRIV_SHELL_CMD_MAIN_ATTR);

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,79 @@
{
"device_id": 1,
"device_name": "DELTA_AS332T_TCP",
"communication_type": 0,
"socket_config": {
"plc_ip": "192.168.250.5",
"local_ip": "192.168.250.233",
"gateway": "192.168.250.1",
"netmask": "255.255.254.0",
"port": 502
},
"protocol_type": 2,
"read_period": 1000,
"read_item_list": [
{
"value_name": "M16",
"value_type": 1,
"function_code": 1,
"start_address": 16,
"quantity": 1
},
{
"value_name": "M17",
"value_type": 1,
"function_code": 1,
"start_address": 17,
"quantity": 1
},
{
"value_name": "M18",
"value_type": 1,
"function_code": 1,
"start_address": 30,
"quantity": 1
},
{
"value_name": "D300",
"value_type": 3,
"function_code": 3,
"start_address": 300,
"quantity": 1
},
{
"value_name": "D301",
"value_type": 3,
"function_code": 3,
"start_address": 302,
"quantity": 1
},
{
"value_name": "D302",
"value_type": 4,
"function_code": 3,
"start_address": 302,
"quantity": 2
},
{
"value_name": "D304",
"value_type": 9,
"function_code": 3,
"start_address": 304,
"quantity": 2
},
{
"value_name": "Y1.0",
"value_type": 1,
"function_code": 1,
"start_address": 40976,
"quantity": 1
},
{
"value_name": "Y10",
"value_type": 3,
"function_code": 3,
"start_address": 40970,
"quantity": 1
}
]
}

View File

@@ -0,0 +1,3 @@
SRC_FILES := fatek_fbs_24mc_uart.c
include $(KERNEL_ROOT)/compiler.mk

View File

@@ -0,0 +1,42 @@
# 永宏通信测试
[TOC]
## 永宏FBs-24MCT2-AC通信测试
### 通信接线及参数设置
* 网口和串口
* FBS-24MCT2自带圆口232用于程序的下载。
* 可本体拓展FBs-CBES用于Modbus TCP永宏私有协议永宏协议等通信。板卡默认IP192.168.2.3.端口号500永宏协议
* 通过本体拓展FBs-CM22通信模板可用于Modbus RTU及永宏协议通信。串口接线+接485A-接485B。
* 串口模块MODBUS RTU通信参数配置通信速率9600数据位8bit停止位1bit校验偶校验
* 串口模块永宏协议通信参数配置通信速率9600数据位8bit停止位1bit校验偶校验
* 终端与PLC通信测试PC编程软件与PLC不能处于联机状态。
### 存储区
- 存储区 XYRD区等。
### 通信测试
- 共测试BOOLINT16等类型数据。
- 测试Y区R区及D区数据。
- 测试截图:
测试PLC环境搭建
![](./image/FATEK.jpg)
解析完成的配方为:
![](./image/panasonic_fpxh_recipe.png)
测试结果:
![](./image/panasonic_fpxh_communication_test.png)

View File

@@ -0,0 +1,64 @@
/*
* Copyright (c) 2022 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file fatek_fbs_24mc_uart.c
* @brief PLC fatek fbs app
* @version 3.0
* @author AIIT XUOS Lab
* @date 2023.11.28
*/
#include <control.h>
extern int Adapter4GActive(void);
void ControlFatekFBsUartTest(void)
{
int i, j = 0;
int read_data_length = 0;
uint8_t read_data[128] = {0};
#ifdef CONNECTION_ADAPTER_4G
Adapter4GActive();
#endif
ControlProtocolType modbus_rtu_protocol = ControlProtocolFind();
if (NULL == modbus_rtu_protocol) {
printf("%s get modbus rtu protocol %p failed\n", __func__, modbus_rtu_protocol);
return;
}
printf("%s get modbus rtu protocol %p successfull\n", __func__, modbus_rtu_protocol);
if (CONTROL_REGISTERED == modbus_rtu_protocol->protocol_status) {
ControlProtocolOpen(modbus_rtu_protocol);
for (;;) {
read_data_length = ControlProtocolRead(modbus_rtu_protocol, read_data, sizeof(read_data));
printf("%s read [%d] modbus rtu data %d using receipe file\n", __func__, i, read_data_length);
if (read_data_length) {
for (j = 0; j < read_data_length; j ++) {
printf("j %d data 0x%x\n", j, read_data[j]);
}
}
i++;
memset(read_data, 0, sizeof(read_data));
PrivTaskDelay(10000);
}
//ControlProtocolClose(modbus_rtu_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlFatekFBsUartTest, fatek fbs uart Demo, PRIV_SHELL_CMD_MAIN_ATTR);

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View File

@@ -0,0 +1,37 @@
{
"device_id": 1,
"device_name": "FATEK_FBSMC24T_RTU",
"communication_type": 1,
"serial_config": {
"station": 1,
"baud_rate": 9600,
"data_bits": 8,
"stop_bits": 1,
"check_mode":3
},
"protocol_type": 3,
"read_period": 2000,
"read_item_list": [
{
"value_name": "Y0",
"value_type": 1,
"function_code": 1,
"start_address": 0,
"quantity": 1
},
{
"value_name": "D0",
"value_type": 3,
"function_code": 3,
"start_address": 6000,
"quantity": 1
},
{
"value_name": "R10",
"value_type": 3,
"function_code": 3,
"start_address": 10,
"quantity": 1
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

View File

@@ -1,3 +1,3 @@
SRC_FILES := mitsubishi_fx3u.c mitsubishi_fx5u.c mitsubishi_fx2n.c mitsubishi_q02u.c
SRC_FILES := mitsubishi_fx3u.c mitsubishi_fx5u.c mitsubishi_fx2n.c mitsubishi_q02u.c mitsubishi_q06h.c mitsubishi_q03udv.c
include $(KERNEL_ROOT)/compiler.mk

View File

@@ -1,24 +1,88 @@
# 三菱 FX2N通信测试
# 三菱通信测试
[TOC]
## 通信接线及参数设置
## 三菱FX2N通信测试
### 通信接线及参数设置
* 串口
* FX2N自带8针圆口422用于程序的下载。全系列不支持网口且需购买串口拓展模块FX2N-485-BD用于通信测试。
* 接线RDA和SDA短接引出ARDB与SDB短接引出B。
* 串口模块支持MC-1C协议通信速率9600数据位7bit停止位1bit校验偶校验
## 存储区
### 存储区
- 存储区 IQMD区。
## 通信测试
### 通信测试
- 共测试BOOLINT16FLOAT共三种类型数据。
- 测试M区及D区数据。
## 三菱Q06H通信测试
### 通信接线及参数设置
* 接口
* 首次连接时可通过CPU自带的串口打印机方口线进行程序的下载。
* 本次测试通过Q06H拓展的模块QJ71E71_100模块的网口模块进行MC—3E通信测试。
* PLC网口模块IP192.168.250.21 端口号4000
### 存储区
- 存储区 IQMD区。
### 通信测试
- 共测试BOOLINT16FLOAT共三种类型数据。
- 测试M区及D区数据。
- 测试截图:
解析完成的配方为
![](./image/q06h_recipe.png)
测试结果:
![](./image/q06h_communication_test.png)
## 三菱Q03UDV通信测试
### 通信接线及参数设置
* 接口
* 本次测试通过Q03UDV拓展的模块QJ71E71_100模块的网口模块进行MC—3E通信测试。网口模块IP192.168.250.21 端口号4000
* 本次测试还可通过Q03UDV自身网口进行MC—3E通信测试。网口模块IP192.168.250.22 端口号6000
### 存储区
- 存储区 IQMD区。
### 通信测试
- 共测试BOOLINT16FLOAT共三种类型数据。
- 测试M区及D区数据。
- 测试截图:
扩展模块解析完成的配方为
![](./image/q03udv_recipe.png)
CPU自带网口解析完成的配方为
![](image/Q03udv_recipe_1.png)
测试结果:
![](./image/q03udv_communication_test.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -0,0 +1,368 @@
{
"device_id": 1,
"device_name": "FX3U_MC_1E",
"communication_type": 0,
"socket_config": {
"plc_ip": "192.168.250.25",
"local_ip": "192.168.250.233",
"gateway": "192.168.250.1",
"netmask": "255.255.254.0",
"port": 2000
},
"protocol_type": 6,
"read_period": 2000,
"read_item_list": [
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "0",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "ֹͣ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "1",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "ʹ<><CAB9>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "2",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "3",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><>ͣ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "4",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>λ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "5",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>λ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "6",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "20",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "21",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "22",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22>ֶ<EFBFBD>ģʽ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "23",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22>Զ<EFBFBD>ģʽ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "24",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD>з<EFBFBD><D0B7><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "25",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><>λ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "26",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>1",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "27",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "0",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>1",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "1",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>2",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "2",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>3",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "3",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>4",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "4",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>5",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "5",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>6",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "50",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>7",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "51",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>8",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "52",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>9",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "53",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22>ٶ<EFBFBD>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "200",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD>ٶ<EFBFBD>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "202",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD>ٶ<EFBFBD>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "204",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><>ʼλ<CABC><CEBB>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "206",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22>յ<EFBFBD>λ<EFBFBD><CEBB>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "208",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>ֵ",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "300",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "302",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "304",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "306",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "308",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "Y001",
"value_type": 1,
"device_code": "Y",
"head_device_number_string": "1",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "Y002",
"value_type": 1,
"device_code": "Y",
"head_device_number_string": "2",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "Y010",
"value_type": 1,
"device_code": "Y",
"head_device_number_string": "10",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "D400",
"value_type": 4,
"device_code": "D",
"head_device_number_string": "400",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
}
]
}

View File

@@ -0,0 +1,331 @@
{
"device_id": 769,
"device_name": "Q02UCPU",
"communication_type": 1,
"serial_config": {
"station": 0,
"baud_rate": 19200,
"data_bits": 7,
"stop_bits": 1,
"check_mode": 3
},
"protocol_type": 10,
"read_period": 1000,
"read_item_list": [
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "0",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "ֹͣ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "1",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "ʹ<><CAB9>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "2",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "3",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><>ͣ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "4",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>λ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "5",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>λ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "6",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "20",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "21",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "22",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22>ֶ<EFBFBD>ģʽ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "23",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22>Զ<EFBFBD>ģʽ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "24",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD>з<EFBFBD><D0B7><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "25",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><>λ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "26",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>1",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "27",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "0",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>1",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "1",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>2",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "2",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>3",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "3",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>4",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "4",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>5",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "5",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>6",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "50",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>7",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "51",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>8",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "52",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>9",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "53",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22>ٶ<EFBFBD>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "200",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD>ٶ<EFBFBD>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "202",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD>ٶ<EFBFBD>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "204",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><>ʼλ<CABC><CEBB>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "206",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22>յ<EFBFBD>λ<EFBFBD><CEBB>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "208",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>ֵ",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "300",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "302",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "304",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "306",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "308",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
}
]
}

View File

@@ -0,0 +1,494 @@
{
"device_id": 1,
"device_name": "Q02UCPU_MC_3E",
"communication_type": 0,
"socket_config": {
"plc_ip": "192.168.250.21",
"local_ip": "192.168.250.233",
"gateway": "192.168.250.1",
"netmask": "255.255.254.0",
"port": 4000
},
"protocol_type": 7,
"read_period": 2000,
"read_item_list": [
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "0",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "ֹͣ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "1",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "ʹ<><CAB9>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "2",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "3",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><>ͣ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "4",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>λ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "5",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>λ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "6",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "20",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "21",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "22",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22>ֶ<EFBFBD>ģʽ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "23",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22>Զ<EFBFBD>ģʽ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "24",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD>з<EFBFBD><D0B7><EFBFBD>",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "25",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><>λ",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "26",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>1",
"value_type": 1,
"device_code": "M",
"head_device_number_string": "27",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "0",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>1",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "1",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>2",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "2",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>3",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "3",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>4",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "4",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>5",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "5",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>6",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "50",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>7",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "51",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>8",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "52",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>9",
"value_type": 3,
"device_code": "D",
"head_device_number_string": "53",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22>ٶ<EFBFBD>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "200",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD>ٶ<EFBFBD>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "202",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD>ٶ<EFBFBD>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "204",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><>ʼλ<CABC><CEBB>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "206",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22>յ<EFBFBD>λ<EFBFBD><CEBB>",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "208",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD>ֵ",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "300",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "302",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "304",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "306",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4",
"value_type": 9,
"device_code": "D",
"head_device_number_string": "308",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "Y001",
"value_type": 1,
"device_code": "Y",
"head_device_number_string": "1",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "Y002",
"value_type": 1,
"device_code": "Y",
"head_device_number_string": "2",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "Y010",
"value_type": 1,
"device_code": "Y",
"head_device_number_string": "10",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "D400",
"value_type": 4,
"device_code": "D",
"head_device_number_string": "400",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "D402",
"value_type": 8,
"device_code": "D",
"head_device_number_string": "402",
"device_points_count": 4,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "D406",
"value_type": 8,
"device_code": "D",
"head_device_number_string": "406",
"device_points_count": 4,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "B1",
"value_type": 1,
"device_code": "B",
"head_device_number_string": "1",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "B10",
"value_type": 1,
"device_code": "B",
"head_device_number_string": "10",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "B20",
"value_type": 1,
"device_code": "B",
"head_device_number_string": "20",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 100
},
{
"value_name": "W1",
"value_type": 3,
"device_code": "W",
"head_device_number_string": "1",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "W2",
"value_type": 4,
"device_code": "W",
"head_device_number_string": "2",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "W4",
"value_type": 9,
"device_code": "W",
"head_device_number_string": "4",
"device_points_count": 2,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "W6",
"value_type": 8,
"device_code": "W",
"head_device_number_string": "6",
"device_points_count": 4,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "W22",
"value_type": 3,
"device_code": "W",
"head_device_number_string": "22",
"device_points_count": 1,
"command_type": 1,
"monitoring_timer": 100
},
{
"value_name": "B44",
"value_type": 1,
"device_code": "B",
"head_device_number_string": "44",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 500
},
{
"value_name": "B200",
"value_type": 1,
"device_code": "B",
"head_device_number_string": "200",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 500
},
{
"value_name": "Y100",
"value_type": 1,
"device_code": "Y",
"head_device_number_string": "100",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 500
},
{
"value_name": "X150",
"value_type": 1,
"device_code": "X",
"head_device_number_string": "150",
"device_points_count": 1,
"command_type": 0,
"monitoring_timer": 500
}
]
}

View File

@@ -0,0 +1,64 @@
/*
* Copyright (c) 2022 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file mitsubishi_q03udv.c
* @brief PLC MITSUBISHI Q03udv app
* @version 3.0
* @author AIIT XUOS Lab
* @date 2023.10.30
*/
#include <control.h>
extern int Adapter4GActive(void);
void ControlQ03udvTest(void)
{
int i, j = 0;
int read_data_length = 0;
uint8_t read_data[128] = {0};
#ifdef CONNECTION_ADAPTER_4G
Adapter4GActive();
#endif
ControlProtocolType melsec_3e_protocol = ControlProtocolFind();
if (NULL == melsec_3e_protocol) {
printf("%s get melsec 3e protocol %p failed\n", __func__, melsec_3e_protocol);
return;
}
printf("%s get melsec 3e protocol %p successfull\n", __func__, melsec_3e_protocol);
if (CONTROL_REGISTERED == melsec_3e_protocol->protocol_status) {
ControlProtocolOpen(melsec_3e_protocol);
for (;;) {
read_data_length = ControlProtocolRead(melsec_3e_protocol, read_data, sizeof(read_data));
printf("%s read [%d] melsec 3c data %d using receipe file\n", __func__, i, read_data_length);
if (read_data_length) {
for (j = 0; j < read_data_length; j ++) {
printf("j %d data 0x%x\n", j, read_data[j]);
}
}
i++;
memset(read_data, 0, sizeof(read_data));
PrivTaskDelay(10000);
}
//ControlProtocolClose(melsec_3c_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlQ03udvTest, Mitsubishi Q03udv Demo, PRIV_SHELL_CMD_MAIN_ATTR);

View File

@@ -0,0 +1,64 @@
/*
* Copyright (c) 2022 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file mitsubishi_q06h.c
* @brief PLC MITSUBISHI Q06H app
* @version 3.0
* @author AIIT XUOS Lab
* @date 2023.10.30
*/
#include <control.h>
extern int Adapter4GActive(void);
void ControlQ06hTest(void)
{
int i, j = 0;
int read_data_length = 0;
uint8_t read_data[128] = {0};
#ifdef CONNECTION_ADAPTER_4G
Adapter4GActive();
#endif
ControlProtocolType melsec_3e_protocol = ControlProtocolFind();
if (NULL == melsec_3e_protocol) {
printf("%s get melsec 3e protocol %p failed\n", __func__, melsec_3e_protocol);
return;
}
printf("%s get melsec 3e protocol %p successfull\n", __func__, melsec_3e_protocol);
if (CONTROL_REGISTERED == melsec_3e_protocol->protocol_status) {
ControlProtocolOpen(melsec_3e_protocol);
for (;;) {
read_data_length = ControlProtocolRead(melsec_3e_protocol, read_data, sizeof(read_data));
printf("%s read [%d] melsec 3c data %d using receipe file\n", __func__, i, read_data_length);
if (read_data_length) {
for (j = 0; j < read_data_length; j ++) {
printf("j %d data 0x%x\n", j, read_data[j]);
}
}
i++;
memset(read_data, 0, sizeof(read_data));
PrivTaskDelay(10000);
}
//ControlProtocolClose(melsec_3c_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlQ06hTest, Mitsubishi Q06H Demo, PRIV_SHELL_CMD_MAIN_ATTR);

View File

@@ -0,0 +1,26 @@
{
"device_id": 1,
"device_name": "NJ501",
"communication_type": 0,
"socket_config": {
"plc_ip": "192.168.250.22",
"local_ip": "192.168.250.233",
"gateway": "192.168.250.1",
"netmask": "255.255.255.0",
"port": 9600
},
"protocol_type": 5,
"read_period": 100,
"read_item_list": [
{
"value_name": "整型1",
"value_type": 3,
"area_char": "D",
"data_type": 1,
"start_address": 100,
"bit_address": 0,
"data_length": 1
}
]
}

View File

@@ -18,6 +18,34 @@
* @date 2022.9.27
*/
#include <control.h>
void ControlNj501Test(void)
{
int i = 0;
uint16_t read_data_length = 0;
uint8_t read_data[1024] = {0};
ControlProtocolType fins_protocol = ControlProtocolFind();
if (NULL == fins_protocol) {
printf("%s get fins protocol %p failed\n", __func__, fins_protocol);
return;
}
printf("%s get fins protocol %p successfull\n", __func__, fins_protocol);
if (CONTROL_REGISTERED == fins_protocol->protocol_status) {
ControlProtocolOpen(fins_protocol);
for (;;) {
read_data_length = ControlProtocolRead(fins_protocol, read_data, sizeof(read_data));
printf("%s read [%d] fins data %d using receipe file\n", __func__, i, read_data_length);
i++;
PrivTaskDelay(100000);
}
//ControlProtocolClose(fins_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlNj501Test, Omron Plc FINS Demo, PRIV_SHELL_CMD_MAIN_ATTR);

View File

@@ -0,0 +1,3 @@
SRC_FILES := panasonic_fpxh_tcp.c panasonic_fpxh_uart.c
include $(KERNEL_ROOT)/compiler.mk

View File

@@ -0,0 +1,39 @@
# 松下通信测试
[TOC]
## 松下FPXHC40ET通信测试
### 通信接线及参数设置
* 网口和串口
* FPXHC40ET自带miniUSB用于程序的下载。本体自带的串口为RS232。
* 本体自带的网口可用于Modbus TCPEthernet/IP等通信。目前用于Modbus TCP通信测试网口IP192.168.250.51 Port502
* 通过本体拓展FPXH-COM3通信模板可用于Modbus RTU通信。串口接线S+接485AS-接485B。
* 串口模块通信参数配置通信速率115200数据位8bit停止位1bit校验偶校验
### 存储区
- 存储区 XYRDL区等。
### 通信测试
- 共测试BOOLINT16等类型数据。
- 测试Y区R区及DT区数据。
- 测试截图:
测试PLC环境搭建
![](./image/PLC_xidatong.jpg)
解析完成的配方为:
![](./image/panasonic_fpxh_recipe.png)
测试结果:
![](./image/panasonic_fpxh_communication_test.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -0,0 +1,65 @@
{
"device_id": 1,
"device_name": "PANASONIC_FPXH_TCP",
"communication_type": 0,
"socket_config": {
"plc_ip": "192.168.250.51",
"local_ip": "192.168.250.233",
"gateway": "192.168.250.1",
"netmask": "255.255.254.0",
"port": 502
},
"protocol_type": 2,
"read_period": 1000,
"read_item_list": [
{
"value_name": "Y0",
"value_type": 1,
"function_code": 1,
"start_address": 0,
"quantity": 1
},
{
"value_name": "R0",
"value_type": 1,
"function_code": 1,
"start_address":2048,
"quantity": 1
},
{
"value_name": "R100",
"value_type": 1,
"function_code": 1,
"start_address": 2208,
"quantity": 1
},
{
"value_name": "R101",
"value_type": 1,
"function_code": 1,
"start_address": 2209,
"quantity": 1
},
{
"value_name": "DT0",
"value_type": 3,
"function_code": 3,
"start_address": 0,
"quantity": 1
},
{
"value_name": "DT1",
"value_type": 3,
"function_code": 3,
"start_address": 1,
"quantity": 1
},
{
"value_name": "DT200",
"value_type": 3,
"function_code": 3,
"start_address": 200,
"quantity": 1
}
]
}

View File

@@ -0,0 +1,66 @@
{
"device_id": 1,
"device_name": "PANASONIC_FPXH_RTU",
"communication_type": 1,
"serial_config": {
"station": 1,
"baud_rate": 9600,
"data_bits": 8,
"stop_bits": 1,
"check_mode":3
},
"protocol_type": 3,
"read_period": 2000,
"read_item_list": [
{
"value_name": "Y0",
"value_type": 1,
"function_code": 1,
"start_address": 0,
"quantity": 1
},
{
"value_name": "R0",
"value_type": 1,
"function_code": 1,
"start_address":2048,
"quantity": 1
},
{
"value_name": "R100",
"value_type": 1,
"function_code": 1,
"start_address": 2208,
"quantity": 1
},
{
"value_name": "R101",
"value_type": 1,
"function_code": 1,
"start_address": 2209,
"quantity": 1
},
{
"value_name": "DT0",
"value_type": 3,
"function_code": 3,
"start_address": 0,
"quantity": 1
},
{
"value_name": "DT1",
"value_type": 3,
"function_code": 3,
"start_address": 1,
"quantity": 1
},
{
"value_name": "DT200",
"value_type": 3,
"function_code": 3,
"start_address": 200,
"quantity": 1
}
]
}

View File

@@ -0,0 +1,64 @@
/*
* Copyright (c) 2022 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file panasonic_fpxh_ethernet.c
* @brief PLC panasonic fpxh app
* @version 3.0
* @author AIIT XUOS Lab
* @date 2023.11.22
*/
#include <control.h>
extern int Adapter4GActive(void);
void ControlPanasonicFpxhTCPTest(void)
{
int i, j = 0;
int read_data_length = 0;
uint8_t read_data[128] = {0};
#ifdef CONNECTION_ADAPTER_4G
Adapter4GActive();
#endif
ControlProtocolType modbus_tcp_protocol = ControlProtocolFind();
if (NULL == modbus_tcp_protocol) {
printf("%s get modbus tcp protocol %p failed\n", __func__, modbus_tcp_protocol);
return;
}
printf("%s get modbus tcp protocol %p successfull\n", __func__, modbus_tcp_protocol);
if (CONTROL_REGISTERED == modbus_tcp_protocol->protocol_status) {
ControlProtocolOpen(modbus_tcp_protocol);
for (;;) {
read_data_length = ControlProtocolRead(modbus_tcp_protocol, read_data, sizeof(read_data));
printf("%s read [%d] modbus tcp data %d using receipe file\n", __func__, i, read_data_length);
if (read_data_length) {
for (j = 0; j < read_data_length; j ++) {
printf("j %d data 0x%x\n", j, read_data[j]);
}
}
i++;
memset(read_data, 0, sizeof(read_data));
PrivTaskDelay(10000);
}
//ControlProtocolClose(modbus_tcp_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlPanasonicFpxhTCPTest, panasonic Fpxh TCP Demo, PRIV_SHELL_CMD_MAIN_ATTR);

View File

@@ -0,0 +1,64 @@
/*
* Copyright (c) 2022 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file panasonic_fpxh_uart.c
* @brief PLC panasonic fpxh app
* @version 3.0
* @author AIIT XUOS Lab
* @date 2023.11.22
*/
#include <control.h>
extern int Adapter4GActive(void);
void ControlPanasonicFpxhUartTest(void)
{
int i, j = 0;
int read_data_length = 0;
uint8_t read_data[128] = {0};
#ifdef CONNECTION_ADAPTER_4G
Adapter4GActive();
#endif
ControlProtocolType modbus_rtu_protocol = ControlProtocolFind();
if (NULL == modbus_rtu_protocol) {
printf("%s get modbus rtu protocol %p failed\n", __func__, modbus_rtu_protocol);
return;
}
printf("%s get modbus rtu protocol %p successfull\n", __func__, modbus_rtu_protocol);
if (CONTROL_REGISTERED == modbus_rtu_protocol->protocol_status) {
ControlProtocolOpen(modbus_rtu_protocol);
for (;;) {
read_data_length = ControlProtocolRead(modbus_rtu_protocol, read_data, sizeof(read_data));
printf("%s read [%d] modbus rtu data %d using receipe file\n", __func__, i, read_data_length);
if (read_data_length) {
for (j = 0; j < read_data_length; j ++) {
printf("j %d data 0x%x\n", j, read_data[j]);
}
}
i++;
memset(read_data, 0, sizeof(read_data));
PrivTaskDelay(10000);
}
//ControlProtocolClose(modbus_rtu_protocol);
}
}
PRIV_SHELL_CMD_FUNCTION(ControlPanasonicFpxhUartTest, panasonic fpxh uart Demo, PRIV_SHELL_CMD_MAIN_ATTR);

View File

@@ -1,3 +1,3 @@
SRC_FILES := siemens_s7_200_cn.c siemens_s7_200_smart.c siemens_s7_300.c siemens_s7_1200.c siemens_s7_1500.c
SRC_FILES := siemens_s7_200_cn.c siemens_s7_200_smart.c siemens_s7_1200.c siemens_s7_1500.c
include $(KERNEL_ROOT)/compiler.mk

View File

@@ -0,0 +1,25 @@
{
"device_id": 1,
"device_name": "S7-1215",
"communication_type": 0,
"socket_config": {
"plc_ip": "192.168.250.5",
"local_ip": "192.168.250.233",
"gateway": "192.168.250.252",
"netmask": "255.255.255.0",
"port": 102
},
"protocol_type": 1,
"read_period": 100,
"read_item_list": [
{
"value_name": "浮点数",
"value_type": 9,
"area": "DB",
"wordlen": "Real",
"db_number": 10,
"start": 32,
"amount": 1
}
]
}

View File

@@ -18,3 +18,28 @@
* @date 2023.3.27
*/
#include <control.h>
void ControlS71200Test(void)
{
int i = 0;
uint16_t read_data_length = 0;
uint8_t read_data[1024] = {0};
ControlProtocolType s7_protocol = ControlProtocolFind();
if (NULL == s7_protocol) {
printf("%s get s7 protocol %p failed\n", __func__, s7_protocol);
return;
}
printf("%s get s7 protocol %p successfull\n", __func__, s7_protocol);
if (CONTROL_REGISTERED == s7_protocol->protocol_status) {
ControlProtocolOpen(s7_protocol);
for (;;) {
read_data_length = ControlProtocolRead(s7_protocol, read_data, sizeof(read_data));
printf("%s read [%d] s7 data %d using receipe file\n", __func__, i, read_data_length);
i++;
memset(read_data, 0, sizeof(read_data));
PrivTaskDelay(10000);
}
}
}
PRIV_SHELL_CMD_FUNCTION(ControlS71200Test, Siemens Plc S7_1215 Demo, PRIV_SHELL_CMD_MAIN_ATTR);

View File

@@ -22,9 +22,13 @@ extern void ApplicationOtaTaskInit(void);
extern int OtaTask(void);
#endif
#ifdef APPLICATION_WEBSERVER
extern int webserver(void);
#endif
int main(void)
{
printf("Hello, world! \n");
printf("\nHello, world!\n");
FrameworkInit();
#ifdef APPLICATION_OTA
ApplicationOtaTaskInit();
@@ -33,6 +37,11 @@ int main(void)
#ifdef OTA_BY_PLATFORM
OtaTask();
#endif
#ifdef APPLICATION_WEBSERVER
webserver();
#endif
return 0;
}
// int cppmain(void);

7
APP_Framework/Applications/ota/Kconfig Executable file → Normal file
View File

@@ -1,7 +0,0 @@
menu "ota app "
menuconfig APPLICATION_OTA
bool "Using app bin ota"
default n
endmenu

View File

@@ -1,3 +1,3 @@
SRC_FILES := ota.c
include $(KERNEL_ROOT)/compiler.mk
include $(KERNEL_ROOT)/compiler.mk

View File

@@ -1,19 +0,0 @@
# OTA README
xiuos当前的ota功能允许应用bin文件可以通过4G实现远程的bin文件更新限制1、bin文件存放在设备SD卡并且应用从SD卡启动2、暂且支持4G实现3、暂时只支持aiit终端;4、只支持xiuos内核
## 文件说明
| 名称 | 说明 |
| -- | -- |
| ota.c| xiuos设备OTA代码 |
| ota_server.c | pc服务端的实例代码供参考 |
## 使用说明
xiuos的应用bin文件更新依赖上层的adapter框架因此需要在menuconfig同时配置以下选项
1、ota开关APPLICATION_OTA打开
2、adapter的4G功能开关
3、拆分的应用启动SEPARATE_COMPILE开关从SD卡启动的配置开关APP_STARTUP_FROM_SDCARD。

View File

@@ -1,411 +0,0 @@
/*
* Copyright (c) 2020 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file: ota.c
* @brief: a application ota task of system
* @version: 1.0
* @author: AIIT XUOS Lab
* @date: 2021/11/3
*
*/
#include <transform.h>
#include <adapter.h>
extern int main(void);
struct ota_header_t
{
int16 frame_flag; ///< frame start flag 2 Bytes
uint8 dev_type; ///< device type
uint8 burn_mode; ///< data burn way
uint32 total_len; ///< send data total length caculated from each frame_len
uint32 dev_hid; ///< device hardware version
uint32 dev_sid; ///< device software version
char resv[8]; ///< reserve
};
struct ota_frame_t
{
uint32 frame_id; ///< Current frame id
uint32 frame_len; ///< Current frame data length
char frame_data[64]; ///< Current frame data,max length 64
uint32 crc; ///< Current frame data crc
};
struct ota_data
{
struct ota_header_t header;
struct ota_frame_t frame;
char end[4];
};
pthread_t ota_task;
pthread_t restart_main;
/**
* @description: CRC16 check
* @param data data buffer
* @param length data length
* @return check code
*/
uint32_t OtaCrc16(uint8_t * data, uint32_t length)
{
int j;
unsigned int reg_crc=0xFFFF;
printf("crc data length[%d] Bytes,",length);
while (length--) {
reg_crc ^= *data++;
for (j=0;j<8;j++) {
if(reg_crc & 0x01)
reg_crc=reg_crc >>1 ^ 0xA001;
else
reg_crc=reg_crc >>1;
}
}
printf(" crc = [0x%x]\n",reg_crc);
return reg_crc;
}
uint32_t FileCrc16(uint8_t * data, uint32_t length, unsigned int last_crc)
{
int j;
//printf("crc data length[%d] Bytes,",length);
while (length--) {
last_crc ^= *data++;
for (j=0;j<8;j++) {
if(last_crc & 0x01)
last_crc = last_crc >>1 ^ 0xA001;
else
last_crc = last_crc >>1;
}
}
//printf(" crc = [0x%x]\n",last_crc);
return last_crc;
}
static int SaveAppBin(int fd, char* buf, int len)
{
int ret = 0;
int fd_t = 0;
fd_t = open( BOARD_APP_NAME, O_RDWR | O_APPEND);
ret = write(fd, buf, len);
if(ret < 0){
printf("fd = %d write buf len[%d] failed.ret = %d\n",fd_t,len,ret);
}
else
{
printf("fd[%d] write buf length[%d] done.\n",fd_t,ret);
}
close(fd_t);
}
static int CrcFileCheck(uint32 crc_check, unsigned long total_len)
{
int ret = 0;
int fd = 0;
int len = 0;
char *buf = NULL;
unsigned int last_crc = 0xffff;
unsigned long already_crc_length = 0;
fd = open( BOARD_APP_NAME, O_RDONLY );
if(fd < 0){
printf("open %s bin failed.\n",BOARD_APP_NAME);
return -1;
}
buf = PrivMalloc(128);
if(NULL == buf)
{
printf("malloc failed.\n");
close(fd);
return 0;
}
/* crc check every 1024 Bytes until crc all the total file */
while(already_crc_length != total_len)
{
memset(buf , 0 , 128);
len = read(fd, buf, 128);
if(len < 0)
{
printf("file read failed.ret = %d\n",len);
ret = -1;
break;
}
last_crc = FileCrc16(buf, len, last_crc);
already_crc_length += len;
printf("read len[%d] Bytes,already_crc_length[%d]\n",len,already_crc_length);
}
if (last_crc != crc_check)
{
printf("file crc error!!! last crc[%x] != check[%x]\n",last_crc,crc_check);
ret =-1;
}
PrivFree(buf);
close(fd);
return ret;
}
static void RestartApplication(void)
{
pthread_attr_t attr;
attr.schedparam.sched_priority = 10;
attr.stacksize = 2048;
while(1)
{
unsigned long pid = PrivUserTaskSearch();
if ((pid > 0) && (pid != pthread_self()))
{
printf("kill usertask pid[%d]\n",pid);
PrivTaskDelete(pid, 0);
PrivTaskDelay(1000); /* NOTE:this delay will make a schedule and recycle all user task */
}
else
{
break;
}
}
printf("restart main.\n");
PrivTaskCreate(&restart_main, &attr, (void *)main, NULL);
}
static int OtaDataRecv(struct Adapter* adapter)
{
struct ota_data recv_msg;
char reply[16] = {0};
int ret = 0;
int try_times = 10;
int fd = 0;
int frame_cnt = 0;
fd = open( BOARD_APP_NAME, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
if(fd < 0)
{
printf("open %s failed\n",BOARD_APP_NAME);
return -1;
}
close(fd);
while(1) {
memset(&recv_msg, 0, sizeof(struct ota_data));
printf("recv msg...\n");
ret = AdapterDeviceRecv(adapter, &recv_msg, sizeof(struct ota_data));
if(ret >= 0 && recv_msg.header.frame_flag == 0x5A5A)
{
if(0 == strncmp("aiit_ota_end",recv_msg.frame.frame_data, strlen("aiit_ota_end")))
{
printf("total [%d]frames [%d]Bytes crc[%x],receive successful,\n",frame_cnt,recv_msg.header.total_len,recv_msg.frame.crc);
if(0 != CrcFileCheck(recv_msg.frame.crc, recv_msg.header.total_len))
{
printf("crc check %s bin failed.please try again.\n", BOARD_APP_NAME);
ret = -1;
break;
}
PrivTaskDelay(500);
printf("tolal file crc done.send ok\n");
memset(reply, 0, 16);
memcpy(reply, "ok", strlen("ok"));
AdapterDeviceSend(adapter, reply, strlen(reply));
ret = 0;
break;
}
frame_cnt = recv_msg.frame.frame_id;
if(0 == strncmp("wait_ok_timeout",recv_msg.frame.frame_data, strlen("wait_ok_timeout")))
{
printf("go to send ok again.\n");
goto send_ok_again;
}
if (recv_msg.frame.crc == OtaCrc16(recv_msg.frame.frame_data,recv_msg.frame.frame_len))
{
printf("save current [%d] frame,length[%d] Bytes.\n",frame_cnt,recv_msg.frame.frame_len);
for(int i = 0; i < recv_msg.frame.frame_len;i++ ){
printf(" %x ",*((char *)&recv_msg.frame.frame_data + i));
}
printf("\n");
SaveAppBin(fd, recv_msg.frame.frame_data, recv_msg.frame.frame_len);
}
else
{
printf("current [%d] frame crc check failed,try again!\n",frame_cnt);
goto try_again;
}
send_ok_again:
memset(reply, 0, 16);
memcpy(reply, "ok", strlen("ok"));
// PrivTaskDelay(100);
ret = AdapterDeviceSend(adapter, reply, strlen(reply));
if(ret < 0){
printf("send ok failed.\n");
goto send_ok_again;
}
printf("send reply[%s] done.\n",reply);
try_times = 10;
continue;
}
else
{
try_again:
if(try_times == 0)
{
printf("oops!!! current [%d] frame try 10 times failed,break out!\n",frame_cnt);
ret = -1;
break;
}
memset(reply, 0, 16);
memcpy(reply, "retry", strlen("retry"));
printf("[%d] frame receive failed. retry\n",frame_cnt);
AdapterDeviceSend(adapter, reply, strlen(reply));
try_times--;
continue;
}
}
close(fd);
if(0 == ret) {
printf("ota file done,start application.\n");
RestartApplication();
}
return ret;
}
static void *OtaKTaskEntry(void *parameter)
{
struct ota_data recv_msg;
char reply[16] = {0};
int baud_rate = BAUD_RATE_115200;
int len = 0;
int ret = 0;
struct Adapter* adapter = AdapterDeviceFindByName("4G");
uint8 server_addr[64] = "115.238.53.61";
uint8 server_port[64] = "9898";
adapter->socket.socket_id = 0;
AdapterDeviceOpen(adapter);
AdapterDeviceControl(adapter, OPE_INT, &baud_rate);
AdapterDeviceConnect(adapter, CLIENT, server_addr, server_port, IPV4);
/* using nbiot as connection way*/
// struct Adapter* adapter = AdapterDeviceFindByName("nbiot");
// while(1)
// {
// int connect_times = 5;
// ret = AdapterDeviceOpen(adapter);
// if(ret < 0)
// {
// printf("open adapter failed\n");
// continue;
// }
// connect_again:
// connect_times--;
// ret = AdapterDeviceConnect(adapter, 1, "115.238.53.61","9898",1);
// if(ret < 0)
// {
// if(connect_times > 0){
// goto connect_again;
// }
// else
// {
// AdapterDeviceClose(adapter);
// continue;
// }
// }
// break;
// }
PrivTaskDelay(5000);
while(1)
{
memset(&recv_msg, 0, sizeof(struct ota_data));
/* step1: Confirm the start signal of transmission*/
printf("waiting for start msg...\n");
ret = AdapterDeviceRecv(adapter, &recv_msg, sizeof(struct ota_data));
for(int i = 0; i < sizeof(struct ota_data);i++ ){
printf(" %x ",*((char *)&recv_msg + i));
}
printf("\n");
if(ret >= 0 && recv_msg.header.frame_flag == 0x5A5A)
{
if (0 == strncmp("aiit_ota_start",recv_msg.frame.frame_data, strlen("aiit_ota_start")))
{
memset(reply, 0, 16);
memcpy(reply, "ready", strlen("ready"));
// PrivTaskDelay(3000);
printf("receive start signal,send [ready] signal to server\n");
send_ready_again:
ret = AdapterDeviceSend(adapter, reply, strlen(reply));
if(ret < 0)
{
goto send_ready_again;
}
PrivTaskDelay(3000);
printf("start receive ota file.\n");
/* step2: start receive source bin file of application*/
ret = OtaDataRecv(adapter);
if (0 != ret)
{
memset(reply, 0, 16);
memcpy(reply, "ota_restart", strlen("ota_restart"));
AdapterDeviceSend(adapter, reply, strlen(reply));
continue;
}
else
{
break;
}
}
}
else
{
memset(reply, 0, 16);
memcpy(reply, "notready", strlen("notready"));
printf("ota status:not ready\n");
ret = AdapterDeviceSend(adapter, reply, strlen(reply));
}
PrivTaskDelay(3000); /* check ota signal every 5s */
}
AdapterDeviceClose(adapter);
}
void ApplicationOtaTaskInit(void)
{
pthread_attr_t attr;
attr.schedparam.sched_priority = 20;
attr.stacksize = 4096;
PrivTaskCreate(&ota_task, &attr, OtaKTaskEntry, NULL);
}

View File

@@ -1,385 +0,0 @@
/*
* Copyright (c) 2020 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file: ota_server.c
* @brief: a application ota task of system running in Linux
* @version: 1.0
* @author: AIIT XUOS Lab
* @date: 2021/11/3
*
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <pthread.h>
#include <time.h>
#include <sys/types.h>
#include <errno.h>
#include <sys/time.h>
#include <assert.h>
#include <netdb.h>
#include <sys/stat.h>
#include <fcntl.h>
typedef int BOOL;
#define true 1
#define false 0
int serverfd;//服务器socket
int clientfd[100000];//客户端的socketfd,100个元素clientfd[0]~clientfd[99]
int size = 99999;//用来控制进入聊天室的人数为50以内
int PORT = 9898;//端口号
typedef struct sockaddr meng;
struct ota_header_t
{
int16_t frame_flag; ///< frame start flag 2 Bytes
uint8_t dev_type; ///< device type
uint8_t burn_mode; ///< data burn way
uint32_t total_len; ///< send data total length caculated from each frame_len
uint32_t dev_hid; ///< device hardware version
uint32_t dev_sid; ///< device software version
char resv[8]; ///< reserve
};
struct ota_frame_t
{
uint32_t frame_id; ///< Current frame id
uint32_t frame_len; ///< Current frame data length
char frame_data[64]; ///< Current frame data,max length 224
uint32_t crc; ///< Current frame data crc
};
struct ota_data
{
struct ota_header_t header;
struct ota_frame_t frame;
char end[4];
};
pthread_t ota_ktask;
/**
* @description: CRC16 check
* @param data data buffer
* @param length data length
* @return check code
*/
uint32_t OtaCrc16(uint8_t * data, uint32_t length)
{
int j;
unsigned int reg_crc=0xFFFF;
printf("crc data length[%d] Bytes,",length);
while (length--) {
reg_crc ^= *data++;
for (j=0;j<8;j++) {
if(reg_crc & 0x01)
reg_crc=reg_crc >>1 ^ 0xA001;
else
reg_crc=reg_crc >>1;
}
}
printf(" crc = [0x%x]\n",reg_crc);
return reg_crc;
}
void init(void)
{
serverfd = socket(PF_INET,SOCK_STREAM,0);
if (serverfd == -1)
{
perror("创建socket失败");
exit(-1);
}
//为套接字设置ip协议 设置端口号 并自动获取本机ip转化为网络ip
struct sockaddr_in addr;//存储套接字的信息
addr.sin_family = AF_INET;//地址族
addr.sin_port = htons(PORT);//设置server端端口号你可以随便设置,当sin_port = 0时系统随机选择一个未被使用的端口号
addr.sin_addr.s_addr = htons(INADDR_ANY);//当sin_addr = INADDR_ANY时表示从本机的任一网卡接收数据
//绑定套接字
// int on = 1;
struct timeval timeout;
timeout.tv_sec = 5;
timeout.tv_usec = 0;
if(setsockopt(serverfd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(struct timeval)) < 0)
{
perror("端口设置失败");
exit(-1);
}
if (bind(serverfd,(meng*)&addr,sizeof(addr)) == -1)
{
perror("绑定失败");
exit(-1);
}
if (listen(serverfd,100) == -1)
{//监听最大连接数
perror("设置监听失败");
exit(-1);
}
}
int OtaFileSend(int fd)
{
unsigned char buf[32] = { 0 };
struct ota_data data;
FILE *file_fd;
char ch;
int length = 0;
int try_times = 10;
int recv_end_times = 3;
int ret = 0;
int frame_cnt = 0;
int file_length = 0;
char * file_buf = NULL;
file_fd = fopen("/home/aep04/wwg/XiUOS_aiit-arm32-board_app.bin", "r");
if (NULL == file_fd){
printf("open file failed.\n");
return -1;
}
fseek(file_fd, 0, SEEK_SET);
printf("start send file.\n");
while(!feof(file_fd))
{
memset(&data, 0, sizeof(data));
data.header.frame_flag = 0x5A5A;
length = fread( data.frame.frame_data, 1, 64, file_fd );
if(length > 0)
{
printf("read %d Bytes\n",length);
data.frame.frame_id = frame_cnt;
data.frame.frame_len = length;
data.frame.crc = OtaCrc16(data.frame.frame_data, length);
file_length += length;
}
send_again:
usleep(50000);
printf("ota send current[%d] frame.\n",frame_cnt);
length = send(fd, &data, sizeof(data), MSG_NOSIGNAL);
if(length < 0){
printf("send [%d] frame faile.go to send again\n",frame_cnt);
goto send_again;
}
recv_again:
memset(buf, 0, 32);
length = recv(fd, buf, sizeof(buf), 0);
if(length < 0 ){
printf("[%d] frame waiting for ok timeout,receive again.\n",frame_cnt);
goto recv_again;
}
printf("receive buf[%s] length = %d\n",buf, length);
if(0 == strncmp(buf, "ok", length))
{
try_times = 10;
printf("[%d]frame data send done.\n",frame_cnt);
frame_cnt++;
continue;
}
else
{
if(try_times > 0)
{
try_times--;
goto send_again;
}
else
{
printf("send frame[%d] 10 times failed.\n",frame_cnt);
ret = -1;
break;
}
}
}
/* finally,crc check total bin file.*/
if (ret == 0)
{
sleep(1);
printf("total send file length[%d] Bytes [%d] frames.\n",file_length,frame_cnt);
printf("now crc check total bin file.\n");
file_buf = malloc(file_length);
memset(file_buf, 0, file_length);
memset(&data, 0, sizeof(data));
data.header.frame_flag = 0x5A5A;
file_fd = fopen("/home/aep04/wwg/XiUOS_aiit-arm32-board_app.bin", "r");
if (NULL == file_fd){
printf("open file failed.\n");
return -1;
}
fseek(file_fd, 0, SEEK_SET);
length = fread(file_buf,1, file_length, file_fd);
printf("read file length = %d\n",length);
if(length > 0) {
data.frame.frame_id = frame_cnt;
data.header.total_len = file_length;
data.frame.frame_len = strlen("aiit_ota_end");
data.frame.crc = OtaCrc16(file_buf, length);
memcpy(data.frame.frame_data,"aiit_ota_end",strlen("aiit_ota_end"));
}
send_end_signal:
printf("send aiit_ota_end signal.\n");
length = send(fd, &data, sizeof(data), MSG_NOSIGNAL);
if(length < 0){
printf("send end signal faile,send end signal again\n");
goto send_end_signal;
}
recv_end_signal:
memset(buf, 0, 32);
length = recv(fd, buf, sizeof(buf), 0);
if(length < 0 )
{
recv_end_times--;
printf("end signal waiting for ok timeout,receive again.\n");
if(recv_end_times > 0)
{
goto recv_end_signal;
}
else
{
ret = -1;
}
}
if(0 != strncmp(buf, "ok", length))
{
printf("error end !!!\n");
ret = -1;
}
free(file_buf);
}
fclose(file_fd);
return ret;
}
void* server_thread(void* p)
{
int fd = *(int*)p;
unsigned char buf[32] = { 0 };
struct ota_data data;
int ret = 0;
int length = 0;
printf("pthread = %d\n",fd);
sleep(8);
while(1)
{
memset(&data, 0x0 , sizeof(struct ota_data));
data.header.frame_flag = 0x5A5A;
memcpy(data.frame.frame_data,"aiit_ota_start",strlen("aiit_ota_start"));
data.frame.frame_len = strlen("aiit_ota_start");
printf("send start signal.\n");
ret = send(fd, &data, sizeof(data), MSG_NOSIGNAL);
if (ret > 0){
printf("send %s[%d] Bytes\n",data.frame.frame_data,ret);
}
// sleep(1);
memset(buf, 0, 32);
length = recv(fd, buf, sizeof(buf), 0);
if (length <= 0)
{
continue;
}
else
{
printf("recv buf %s length %d\n",buf,length);
if(0 == strncmp(buf, "ready", length))
{
ret = OtaFileSend(fd);
if (ret == 0) {
printf("ota file send successful.\n");
break;
} else { /* ota failed then restart the ota process */
continue;
}
}
}
}
printf("exit fd = %d\n",fd);
close(fd);
pthread_exit(0);
}
void server(void)
{
printf("ota Server startup\n");
while(1)
{
struct sockaddr_in fromaddr;
socklen_t len = sizeof(fromaddr);
int fd = accept(serverfd,(meng*)&fromaddr,&len);
//调用accept进入堵塞状态等待客户端的连接
if (fd == -1)
{
// printf("The client connection is wrong...\n");
continue;
}
int i = 0;
for (i = 0;i < size;i++)
{
if (clientfd[i] == 0)
{
//记录客户端的socket
clientfd[i] = fd;
//有客户端连接之后,启动线程给此客户服务
pthread_t tid;
pthread_create(&tid,0,server_thread,&fd);
break;
}
if (size == i)
{
//发送给客户端说聊天室满了
char* str = "Devices full";
printf("%s", str);
send(fd,str,strlen(str),0);
close(fd);
}
}
}
}
int main(void)
{
init();
server();
}

View File

@@ -0,0 +1,29 @@
menuconfig APPLICATION_WEBSERVER
bool "Application webserver using mongoose"
default n
if APPLICATION_WEBSERVER
choice
prompt "choose board for webserver"
default APPLICATION_WEBSERVER_XISHUTONG_4G
config APPLICATION_WEBSERVER_XISHUTONG_4G
bool "board select xishutong-4g, support dual ethernet port and 4G"
select BSP_USING_SDIO
select BSP_USING_W5500
select BSP_USING_ETHERNET
select SUPPORT_CONNECTION_FRAMEWORK
select CONNECTION_ADAPTER_4G
select ADAPTER_EC200A
select LIB_USING_LORAWAN
select LIB_USING_LORA_RADIO
config APPLICATION_WEBSERVER_XISHUTONG
bool "board select xishutong, support single ethernet port"
select BSP_USING_SDIO
select BSP_USING_LWIP
select LIB_USING_LORAWAN
select LIB_USING_LORA_RADIO
endchoice
endif

View File

@@ -0,0 +1,3 @@
SRC_FILES += webserver_project.c
include $(KERNEL_ROOT)/compiler.mk

Some files were not shown because too many files have changed in this diff Show More