├── .gitignore ├── .vscode ├── c_cpp_properties.json └── settings.json ├── LICENSE ├── PLANS.md ├── README.md ├── build ├── README.md ├── buildmod.mk ├── buildmulti.mk └── buildrules.mk ├── config.template.json ├── desktop ├── README.md ├── logger_tool │ ├── MainFrame.Designer.cs │ ├── MainFrame.cs │ ├── MainFrame.resx │ ├── Program.cs │ ├── SocketInfo.cs │ ├── Tools.csproj │ ├── Tools.csproj.user │ └── Tools.sln ├── manage_client │ └── README.md └── manage_tool │ ├── api │ ├── api.pri │ ├── app.cpp │ ├── app.hpp │ ├── quiwidget.cpp │ └── quiwidget.h │ ├── appthread.cpp │ ├── commandinfo.cpp │ ├── configfile.cpp │ ├── debugwindows.cpp │ ├── debugwindows.h │ ├── debugwindows.ui │ ├── icon.rc │ ├── image │ └── test.jpg │ ├── imageprocess.cpp │ ├── include │ ├── appthread.h │ ├── commandinfo.h │ ├── configfile.h │ ├── head.h │ ├── imageprocess.h │ ├── mainwindow.h │ ├── protocol.h │ ├── tcpclient.h │ ├── typedef.h │ ├── uartclient.h │ └── udpclient.h │ ├── main.cpp │ ├── main.ico │ ├── main.qrc │ ├── mainwindow.cpp │ ├── mainwindow.ui │ ├── manage_tool.pro │ ├── manage_tool.pro.user │ ├── other │ ├── main.qrc │ ├── qss.qrc │ └── qss │ │ ├── flatwhite.css │ │ ├── flatwhite │ │ ├── add_bottom.png │ │ ├── add_left.png │ │ ├── add_right.png │ │ ├── add_top.png │ │ ├── branch_close.png │ │ ├── branch_open.png │ │ ├── calendar_nextmonth.png │ │ ├── calendar_prevmonth.png │ │ ├── checkbox_checked.png │ │ ├── checkbox_checked_disable.png │ │ ├── checkbox_parcial.png │ │ ├── checkbox_parcial_disable.png │ │ ├── checkbox_unchecked.png │ │ ├── checkbox_unchecked_disable.png │ │ ├── radiobutton_checked.png │ │ ├── radiobutton_checked_disable.png │ │ ├── radiobutton_unchecked.png │ │ └── radiobutton_unchecked_disable.png │ │ ├── lightblue.css │ │ ├── lightblue │ │ ├── add_bottom.png │ │ ├── add_left.png │ │ ├── add_right.png │ │ ├── add_top.png │ │ ├── branch_close.png │ │ ├── branch_open.png │ │ ├── calendar_nextmonth.png │ │ ├── calendar_prevmonth.png │ │ ├── checkbox_checked.png │ │ ├── checkbox_checked_disable.png │ │ ├── checkbox_parcial.png │ │ ├── checkbox_parcial_disable.png │ │ ├── checkbox_unchecked.png │ │ ├── checkbox_unchecked_disable.png │ │ ├── radiobutton_checked.png │ │ ├── radiobutton_checked_disable.png │ │ ├── radiobutton_unchecked.png │ │ └── radiobutton_unchecked_disable.png │ │ ├── psblack.css │ │ └── psblack │ │ ├── add_bottom.png │ │ ├── add_left.png │ │ ├── add_right.png │ │ ├── add_top.png │ │ ├── branch_close.png │ │ ├── branch_open.png │ │ ├── calendar_nextmonth.png │ │ ├── calendar_prevmonth.png │ │ ├── checkbox_checked.png │ │ ├── checkbox_checked_disable.png │ │ ├── checkbox_parcial.png │ │ ├── checkbox_parcial_disable.png │ │ ├── checkbox_unchecked.png │ │ ├── checkbox_unchecked_disable.png │ │ ├── radiobutton_checked.png │ │ ├── radiobutton_checked_disable.png │ │ ├── radiobutton_unchecked.png │ │ └── radiobutton_unchecked_disable.png │ ├── protocol.cpp │ ├── qextserialport │ ├── qextserialport.cpp │ ├── qextserialport.h │ ├── qextserialport.pri │ ├── qextserialport_global.h │ ├── qextserialport_p.h │ ├── qextserialport_unix.cpp │ ├── qextserialport_win.cpp │ └── readme.txt │ ├── screenshot │ ├── screenshot.cpp │ └── screenshot.h │ ├── socketthread.cpp │ ├── tcpclient.cpp │ ├── uartclient.cpp │ ├── udpclient.cpp │ └── updclient.cpp ├── doc ├── feature.md ├── image │ └── mainFrame.png ├── mainFrame.drawio ├── notes │ ├── 1.开发技术说明.md │ ├── 2.Ubuntu编译环境构建.md │ ├── 3.嵌入式Linux编译.md │ └── 4.Linux命令和Shell整理.md ├── protocol.md ├── rootfs构建方法.md ├── 协议文档定义.docx ├── 嵌入式Linux应用综合设计文档.xlsx ├── 嵌入式Linux应用设计文档.docx └── 进程间交互协议.md ├── embed ├── Makefile ├── README.md ├── common │ ├── calculate.cpp │ ├── common.hpp │ ├── common.mk │ ├── common_unit.hpp │ ├── device_common.hpp │ ├── event │ │ ├── event.hpp │ │ ├── semaphore.hpp │ │ └── thread_queue.hpp │ ├── fifo │ │ ├── fifo_manage.cpp │ │ └── fifo_manage.hpp │ ├── global_def.hpp │ ├── jsonconfig │ │ ├── json_config.cpp │ │ └── json_config.hpp │ ├── logger │ │ ├── logger_manage.cpp │ │ └── logger_manage.hpp │ ├── mock.hpp │ ├── parameter_parser.cpp │ ├── parameter_parser.hpp │ ├── server │ │ ├── asio_server.cpp │ │ └── asio_server.hpp │ ├── timer_manage.cpp │ ├── timer_manage.hpp │ └── tty.hpp ├── gui_manage │ └── README.md ├── local_device │ ├── Makefile │ ├── README.md │ ├── device_manage.cpp │ ├── device_manage.hpp │ ├── driver │ │ ├── beep.hpp │ │ ├── device_base.cpp │ │ ├── device_base.hpp │ │ ├── driver.cpp │ │ ├── driver.hpp │ │ ├── i2c_ap.hpp │ │ ├── iio_device.hpp │ │ ├── key.cpp │ │ ├── key.hpp │ │ ├── led.hpp │ │ ├── loopled.hpp │ │ ├── pwm_dev.hpp │ │ ├── rtc.cpp │ │ ├── rtc.hpp │ │ ├── spi_icm.cpp │ │ └── spi_icm.hpp │ ├── include │ │ └── productConfig.hpp │ ├── main.cpp │ └── module │ │ ├── cmd_process.cpp │ │ └── cmd_process.hpp ├── logger_tool │ ├── Makefile │ ├── README.md │ ├── include │ │ └── productConfig.hpp │ ├── log_process.cpp │ ├── log_process.hpp │ ├── log_server.cpp │ ├── log_server.hpp │ └── main.cpp ├── lower_device │ ├── Makefile │ ├── README.md │ ├── asio_client.cpp │ ├── asio_client.hpp │ ├── include │ │ └── productConfig.hpp │ ├── main.cpp │ ├── module │ │ ├── cmd_process.cpp │ │ └── cmd_process.hpp │ ├── serial.cpp │ └── serial.hpp ├── main_process │ ├── .vscode │ │ ├── c_cpp_properties.json │ │ └── settings.json │ ├── Makefile │ ├── README.md │ ├── include │ │ └── productConfig.hpp │ ├── lower_app.code-workspace │ ├── main.cpp │ ├── mb │ │ ├── ascii │ │ │ ├── mbascii.c │ │ │ └── mbascii.h │ │ ├── functions │ │ │ ├── mbfunccoils.c │ │ │ ├── mbfuncdiag.c │ │ │ ├── mbfuncdisc.c │ │ │ ├── mbfuncholding.c │ │ │ ├── mbfuncinput.c │ │ │ ├── mbfuncother.c │ │ │ └── mbutils.c │ │ ├── include │ │ │ ├── mb.h │ │ │ ├── mbconfig.h │ │ │ ├── mbframe.h │ │ │ ├── mbfunc.h │ │ │ ├── mbport.h │ │ │ ├── mbproto.h │ │ │ └── mbutils.h │ │ ├── mb.c │ │ ├── mb_app.cpp │ │ ├── mb_app.hpp │ │ ├── port │ │ │ ├── mbport.cpp │ │ │ ├── port.h │ │ │ ├── portevent.cpp │ │ │ ├── portserial.cpp │ │ │ ├── porttcp.cpp │ │ │ └── porttimer.cpp │ │ ├── rtu │ │ │ ├── mbcrc.c │ │ │ ├── mbcrc.h │ │ │ ├── mbrtu.c │ │ │ └── mbrtu.h │ │ └── tcp │ │ │ ├── mbtcp.c │ │ │ └── mbtcp.h │ ├── module │ │ ├── cmd_process.cpp │ │ ├── cmd_process.hpp │ │ ├── device_process.cpp │ │ └── device_process.hpp │ ├── mqtt │ │ ├── mqtt_process.cpp │ │ ├── mqtt_process.hpp │ │ ├── mqtt_protocol.cpp │ │ └── mqtt_protocol.hpp │ ├── remote │ │ ├── protocol.cpp │ │ ├── protocol.hpp │ │ ├── tcp_thread.cpp │ │ └── tcp_thread.hpp │ └── shutdown ├── node_server │ ├── README.md │ ├── config_json.js │ ├── dynamic_engine.js │ ├── main.js │ ├── mqtt_run.js │ ├── node_modules.tar │ ├── static_engine.js │ ├── tool.js │ └── webpage │ │ ├── css │ │ └── global.css │ │ ├── favicon.ico │ │ ├── index.html │ │ └── js │ │ ├── axios.js │ │ ├── axios.js.map │ │ ├── main.js │ │ └── vue.global.js └── test │ ├── device_info.c │ └── test.c ├── env ├── .bashrc_template ├── EnvConfig.mk ├── buildAlias ├── configAlias ├── defineAlias ├── defineEnvVars └── jumpAlias ├── mod ├── .vscode │ ├── c_cpp_properties.json │ └── settings.json ├── 01.led │ ├── Makefile │ ├── README.md │ ├── kernel_led.c │ └── test │ │ ├── Makefile │ │ └── led_test.c ├── 02.loopled │ ├── Makefile │ ├── kernel_loopled.c │ └── test │ │ ├── Makefile │ │ └── loopled_test.c ├── 03.beep │ ├── Makefile │ ├── kernel_miscbeep.c │ └── test │ │ ├── Makefile │ │ └── beep_test.c ├── 04.i2c_ap │ ├── bus_i2c │ │ ├── Makefile │ │ └── kernel_bus_i2c.c │ ├── regmap_i2c │ │ ├── Makefile │ │ └── kernel_regmap_i2c.c │ └── test │ │ ├── Makefile │ │ └── ap_i2c_test.c ├── 05.spi_icm │ ├── README.md │ ├── bus_spi │ │ ├── Makefile │ │ ├── kernel_bus_spi.c │ │ └── kernel_bus_spi.h │ ├── regmap_spi │ │ ├── Makefile │ │ ├── kernel_regmap_spi.c │ │ └── kernel_regmap_spi.h │ └── test │ │ ├── Makefile │ │ └── icm_spi_test.c ├── 06.key │ ├── key_async │ │ ├── Makefile │ │ ├── kernel_key_async.c │ │ └── test │ │ │ ├── Makefile │ │ │ └── key_async_test.cpp │ ├── key_input │ │ ├── Makefile │ │ ├── kernel_input.c │ │ └── test │ │ │ ├── Makefile │ │ │ └── key_input_test.c │ └── key_rwio │ │ ├── Makefile │ │ ├── kernel_key_rwio.c │ │ └── test │ │ ├── Makefile │ │ └── key_rwio_test.cpp ├── 07.adc │ ├── Makefile │ ├── kernel_iio_adc.c │ ├── kernel_iio_adc.h │ └── test │ │ ├── Makefile │ │ └── iio_test.c ├── 08.wire │ ├── dev_hx711 │ │ ├── Makefile │ │ ├── kernel_dev_hx711.c │ │ └── test │ │ │ ├── Makefile │ │ │ └── hx711_dev_test.c │ └── iio_hx711 │ │ ├── Makefile │ │ ├── kernel_iio_hx711.c │ │ └── test │ │ ├── Makefile │ │ └── hx711_iio_test.c ├── 09.rtc │ ├── bus_rtc │ │ ├── Makefile │ │ ├── kernel_bus_rtc.c │ │ └── test │ │ │ ├── Makefile │ │ │ └── rtc_test.c │ └── regmap_rtc │ │ ├── Makefile │ │ ├── kernel_regmap_rtc.c │ │ └── test │ │ ├── Makefile │ │ └── rtc_test.c ├── 10.rng │ ├── hw_rngc │ │ ├── Makefile │ │ └── imx-rng.c │ ├── sf_rngc │ │ ├── Makefile │ │ └── sf-rng.c │ └── test │ │ ├── Makefile │ │ └── rngc_test.c ├── 11.nvmem │ ├── nvmem_drv │ │ ├── Makefile │ │ └── kernel_nvmem.c │ ├── nvmem_ref │ │ ├── Makefile │ │ └── kernel_nvmem_ref.c │ └── test │ │ ├── Makefile │ │ └── nvmem_test.c ├── 12.serial │ ├── imx.c │ └── test │ │ ├── Makefile │ │ └── rs232_test.c ├── 13.block_dev │ ├── no_queue │ │ ├── Makefile │ │ └── ram_disk.c │ └── queue │ │ ├── Makefile │ │ └── ram_disk_queue.c ├── 14.touch_key │ ├── goodix_ts │ │ ├── goodix.c │ │ ├── goodix.h │ │ └── goodix_fwupload.c │ ├── goodix_ts_i2c │ │ ├── Makefile │ │ └── goodix_ts_i2c.c │ └── goodix_ts_regmap │ │ ├── Makefile │ │ └── kernel_ts_regmap.c ├── 15.can_net │ ├── README.md │ └── flexcan │ │ ├── Makefile │ │ ├── flexcan-core.c │ │ ├── flexcan-ethtool.c │ │ └── flexcan.h ├── 16.thermal │ ├── kernel │ │ ├── Makefile │ │ ├── imx_thermal.c │ │ └── pwm-fan.c │ ├── thermal_cooling │ │ ├── Makefile │ │ └── thermal_fan.c │ └── thermal_zone │ │ ├── Makefile │ │ └── thermal_sensor.c ├── 17.pwm │ ├── kernel │ │ ├── README.md │ │ ├── kernel_pwm_fan.c │ │ ├── pwm-fan.c │ │ └── pwm-imx27.c │ ├── pwm_consumer │ │ ├── Makefile │ │ └── kernel_pwm_consumer.c │ └── pwm_provider │ │ ├── Makefile │ │ ├── kernel_pwm.c │ │ └── test │ │ ├── Makefile │ │ └── pwm_test.c ├── 18.wdt │ ├── Makefile │ ├── kernel_wdt.c │ └── test │ │ ├── Makefile │ │ └── wdt_test.c ├── 19.drm │ ├── README.md │ ├── kernel_fb.c │ └── spi_oled │ │ ├── Makefile │ │ └── kernel_spi_oled.c ├── 20.csi │ └── mx6s_capture.c ├── 21.joystick │ ├── Makefile │ ├── adc-joystick.c │ └── test │ │ ├── Makefile │ │ └── joystick_test.c ├── 22.brightness │ ├── Makefile │ └── kernel_pwm_bl.c ├── 23.usb │ └── usb_host_serial │ │ ├── Makefile │ │ └── usb_serial_test.c ├── Makefile ├── README.md ├── kernal_mod.code-workspace ├── x1.relay │ ├── export │ │ ├── Makefile │ │ └── export.c │ ├── multi │ │ ├── Makefile │ │ ├── kernel_base.c │ │ └── kernel_main.c │ └── relay │ │ ├── Makefile │ │ └── relay.c ├── x2.param │ ├── Makefile │ └── kernel_param.c └── x3.example │ ├── Makefile │ └── kernel_example.c ├── platform ├── H618 │ ├── README.md │ ├── platform-shell │ │ ├── install-thirdparts.sh │ │ └── make.sh │ └── uboot │ │ ├── boot.cmd │ │ └── config.txt ├── I.MX6ULL │ ├── README.md │ ├── bootcmd-shell │ │ ├── READM.md │ │ ├── boot.cmd │ │ ├── build_shell.sh │ │ ├── config.txt │ │ ├── imx6ull-rmk-overlay.dts │ │ └── kernel_fit.its │ ├── buildroot-2023.02.9-patch │ │ ├── README.md │ │ └── imx6ullrmk_defconfig │ ├── linux-imx-lf-6.1.y-patch │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── README.md │ │ ├── arch │ │ │ └── arm │ │ │ │ ├── boot │ │ │ │ └── dts │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── imx6ul-14x14-rmk.dtsi │ │ │ │ │ ├── imx6ul.dtsi │ │ │ │ │ ├── imx6ull-14x14-emmc-4.3-800x480-c.dts │ │ │ │ │ ├── imx6ull-14x14-nand-4.3-800x480-c.dts │ │ │ │ │ ├── imx6ull-qemu.dts │ │ │ │ │ └── imx6ull.dtsi │ │ │ │ └── configs │ │ │ │ ├── imx_qemu_defconfig │ │ │ │ └── imx_rmk_v7_defconfig │ │ ├── drivers │ │ │ └── video │ │ │ │ └── logo │ │ │ │ ├── Kconfig │ │ │ │ ├── Makefile │ │ │ │ ├── logo.c │ │ │ │ └── logo_user_clut224.ppm │ │ ├── firmware │ │ │ ├── imx │ │ │ │ └── sdma │ │ │ │ │ └── sdma-imx6q.bin │ │ │ ├── regulatory.db │ │ │ └── regulatory.db.p7s │ │ ├── include │ │ │ └── linux │ │ │ │ └── linux_logo.h │ │ ├── kernel_upgrade.sh │ │ └── scripts │ │ │ └── Makefile.lib │ ├── platform-diff.xlsx │ ├── platform-shell │ │ ├── install-debian.sh │ │ ├── install-thirdparts.sh │ │ ├── kill_all.sh │ │ ├── make.sh │ │ ├── qemu-nogui.sh │ │ └── start_app.sh │ ├── uboot-imx-lf_v2022.04-patch.7z │ └── uboot-imx-lf_v2022.04-patch │ │ ├── .vscode │ │ └── settings.json │ │ ├── README.md │ │ ├── arch │ │ └── arm │ │ │ ├── dts │ │ │ ├── Makefile │ │ │ ├── imx6ul-14x14-rmk.dtsi │ │ │ ├── imx6ul.dtsi │ │ │ ├── imx6ull-14x14-rmk-emmc.dts │ │ │ ├── imx6ull-14x14-rmk-nand.dts │ │ │ └── imx6ull.dtsi │ │ │ └── mach-imx │ │ │ └── mx6 │ │ │ └── Kconfig │ │ ├── board │ │ └── freescale │ │ │ └── mx6ullrmk │ │ │ ├── Kconfig │ │ │ ├── MAINTAINERS │ │ │ ├── Makefile │ │ │ ├── imximage.cfg │ │ │ ├── imximage_lpddr2.cfg │ │ │ ├── mx6ullrmk.c │ │ │ └── plugin.S │ │ ├── configs │ │ ├── mx6ull_14x14_rmk_emmc_defconfig │ │ ├── mx6ull_14x14_rmk_nand_defconfig │ │ └── mx6ull_14x14_rmk_sd_defconfig │ │ ├── drivers │ │ └── net │ │ │ └── phy │ │ │ └── phy.c │ │ ├── include │ │ └── configs │ │ │ └── mx6ullrmk.h │ │ └── uboot_upgrade.sh ├── README.md └── RK3568 │ ├── README.md │ └── linux │ ├── .vscode │ └── settings.json │ └── arch │ └── arm64 │ ├── boot │ └── dts │ │ └── rockchip │ │ ├── rk3568-atk-atompi-ca1.dts │ │ ├── rk3568-atk-atompi-ca1.dtsi │ │ ├── rk3568-dram-default-timing.dtsi │ │ ├── rk3568-pinctrl.dtsi │ │ ├── rk3568.dtsi │ │ └── rockchip-pinconf.dtsi │ └── configs │ └── atompi_defconfig ├── preBuildEnvironment.sh ├── rootfs ├── etc │ ├── README.md │ ├── mosquitto │ │ └── mosquitto.conf │ └── resolv.conf ├── home │ └── sys │ │ ├── configs │ │ ├── README.md │ │ └── dynamic.json │ │ ├── env │ │ ├── defineAlias │ │ └── defineEnvVars │ │ ├── executable │ │ └── README.md │ │ ├── logger │ │ └── README.md │ │ ├── modules │ │ └── README.md │ │ └── server │ │ └── README.md └── root │ └── .bashrc └── thirdparts ├── README.md ├── cJSON-master ├── LICENSE ├── Makefile ├── README.md ├── cJSON.c ├── cJSON.h ├── cJSON_Utils.c └── cJSON_Utils.h ├── fmt └── include │ └── fmt │ ├── args.h │ ├── chrono.h │ ├── color.h │ ├── compile.h │ ├── core.h │ ├── format-inl.h │ ├── format.h │ ├── os.h │ ├── ostream.h │ ├── printf.h │ ├── ranges.h │ ├── std.h │ └── xchar.h ├── jsoncpp.tar.bz2 └── mosquitto └── include ├── mosquitto.h ├── mosquitto_broker.h ├── mosquitto_plugin.h ├── mosquittopp.h └── mqtt_protocol.h /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | #this shows not include by git 3 | 4 | *.o 5 | *.d 6 | *.mod.c 7 | *.mod.o 8 | *.mod 9 | *.order 10 | *.symvers 11 | *.tar.xz 12 | *.a 13 | *.so 14 | *.so* 15 | *.ko 16 | *.tar.gz 17 | *.scr 18 | *.export* 19 | *.module* 20 | *.Module* 21 | 22 | thirdparts/asio/ 23 | thirdparts/jsoncpp/ 24 | thirdparts/mosquitto/m* 25 | thirdparts/mosquitto/c* 26 | thirdparts/mosquitto/o* 27 | thirdparts/mosquitto/z* 28 | 29 | rootfs/home/sys/server/* 30 | rootfs/home/sys/webpage/* 31 | !rootfs/etc/* 32 | 33 | buildout/aarch64/ 34 | buildout/arm/ 35 | 36 | embed/lower_device/lower_device 37 | embed/main_process/main_process 38 | embed/local_device/local_device 39 | embed/logger_tool/logger_tool 40 | embed/node_server/node_modules 41 | embed/node_server/*.json 42 | embed/test/device_info 43 | 44 | sdk/* 45 | !sdk/*.md -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "${workspaceFolder}/embed/common", 8 | "${workspaceFolder}/embed/common/event", 9 | "${workspaceFolder}/embed/lower_device/include", 10 | "${workspaceFolder}/embed/logger_tool/include", 11 | "${workspaceFolder}/embed/main_process/mb/include" 12 | ], 13 | "defines": [ 14 | "_DEBUG", 15 | "UNICODE", 16 | "_UNICODE", 17 | "__ARM_PCS_VFP", 18 | "MODULE_DEFINE_MQTT", 19 | "USE_OPENCV=1", 20 | "CONFIG_CPU_FREQ=y" 21 | ], 22 | "windowsSdkVersion": "8.1", 23 | "compilerPath": "/bin/gcc", 24 | "cStandard": "c11", 25 | "cppStandard": "c++17", 26 | "intelliSenseMode": "gcc-arm" 27 | } 28 | ], 29 | "version": 4 30 | } -------------------------------------------------------------------------------- /build/README.md: -------------------------------------------------------------------------------- 1 | # 编译规则说明 2 |   基于linux下Makefile语法实现的支持c,cpp编译的脚本,支持编译可执行文件,静态库和动态库,脚本执行依赖部分env环境,使用前需要将env/*中的信息加载到系统环境中,具体加载系统环境可参考外部目录下README.md说明,具体实现脚本的规则详细见下面分类。
3 | 编译后所有文件会放置在buildout目录下,支持arm(arm32), aarch64(arm64), i386(x86)三个平台。 4 | 5 | ## 编译可执行文件Makefile例程 6 | ```shell 7 | #编译输出可执行文件 8 | BUILD?=e 9 | 10 | #添加CPP flags 11 | CCFLAGS:=-O3 -std=c++17 -fno-strict-aliasing -lrt 12 | 13 | #添加头文件目录 14 | INCLUDES=-I include/ 15 | 16 | #编译输出 17 | buildout=test 18 | 19 | #编译的cpp文件 20 | cpp_objects=test_cpp.o 21 | 22 | include $(ENV_PATH_ROOT)/build/buildrules.mk 23 | ``` 24 | 25 | ## 编译静态库Makefile例程 26 | ```shell 27 | #编译输出可执行文件 28 | BUILD?=s 29 | 30 | #添加C flags 31 | CFLAGS := 32 | 33 | #添加头文件目录 34 | INCLUDES=-I include/ 35 | 36 | #编译输出格式为libtest.a 37 | buildout=libtest 38 | 39 | #编译的c文件 40 | c_objects=test_c.o 41 | 42 | include $(ENV_PATH_ROOT)/build/buildrules.mk 43 | ``` 44 | 45 | ## 编译动态库Makefile例程 46 | ```shell 47 | #编译输出可执行文件 48 | BUILD?=d 49 | 50 | #添加C/CPP flags 51 | CFLAGS := 52 | CCFLAGS := 53 | 54 | #添加头文件目录 55 | INCLUDES=-I include/ 56 | 57 | #编译输出格式为libtest.so 58 | buildout=libtest 59 | 60 | #编译的c/cpp文件 61 | c_objects=test_c.o 62 | cpp_obects=test_cpp.o 63 | 64 | include $(ENV_PATH_ROOT)/build/buildrules.mk 65 | ``` -------------------------------------------------------------------------------- /build/buildmod.mk: -------------------------------------------------------------------------------- 1 | KERNELDIR := $(shell printenv SUPPORT_ENV_KERNEL_DIR) 2 | CURRENT_PATH := $(shell pwd) 3 | 4 | ifeq ($(FIRMWARE_CURRENT_PLATFORMS),ARM) 5 | ARCH=arm 6 | else 7 | ARCH=arm64 8 | endif 9 | CROSS_COMPILE=${NEW_KERNEL_CC} 10 | 11 | build: kernel_modules 12 | mkdir -m 755 -p ${APPLICATION_EMBED_MODUILES}/ 13 | mv *.ko ${APPLICATION_EMBED_MODUILES}/ 14 | ifeq ($(FIRMWARE_CLEAN),1) 15 | make clean 16 | endif 17 | 18 | kernel_modules: 19 | echo "platform:${ARCH}, COMPILE:${CROSS_COMPILE}" 20 | $(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) modules 21 | 22 | clean: 23 | $(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) clean 24 | -------------------------------------------------------------------------------- /build/buildmulti.mk: -------------------------------------------------------------------------------- 1 | dir ?= ${ENV_PATH_ROOT} 2 | subdirs ?= $(wildcard $(dir)/*) 3 | with_kernel ?=1 4 | 5 | modules: 6 | set -e; 7 | for dir in ${subdirs}; do \ 8 | if [ -d $${dir} ] && [ -f $${dir}/Makefile ]; then \ 9 | if [ ${with_kernel} -eq 0 ]; then \ 10 | make -j4 ARCH=arm CROSS_COMPILE=${NEW_KERNEL_CC} -C $${dir}; \ 11 | else \ 12 | make clean -C $${dir}; \ 13 | make -j4 -C $${dir}; \ 14 | fi \ 15 | fi \ 16 | done 17 | 18 | clean: 19 | set -e; 20 | for dir in ${subdirs}; do \ 21 | if [ -d $${dir} ] && [ -f $${dir}/Makefile ]; then \ 22 | make clean -C $${dir}; \ 23 | fi \ 24 | done 25 | 26 | all : modules 27 | 28 | .PHONY : all 29 | -------------------------------------------------------------------------------- /desktop/README.md: -------------------------------------------------------------------------------- 1 | # remote_manage 2 | 3 | 上位机使用QT实现的界面, 支持opencv的方法说明: 4 | 5 | 1. 解压support\opencv_install.7z, 并复制到和remote_manage同目录 6 | 2. 将xxx\opencv_install\x64\mingw\bin路径添加到系统环境Path中 7 | 3. 在QT中选择项目->Buid&Run, 将编译选项切换为MinGW 64-bit(选择其它选项会出现链接错误) 8 | 4. 编译即可,如果编译后出现程序执行异常,可能原因为动态库路径没有正确链接,可以检查Path,或者将bin下的dll文件 9 | 添加到系统路径中 10 | 11 | 开发日志记录 12 | 13 | ## version 0.0.0.1 14 | 15 | 1.实现了界面框架,后续功能添加 16 | 17 | ## version 0.0.0.2 18 | 19 | 1.添加了串口驱动的的配置实现 20 | 2.增加了协议的封装处理 21 | 3.增加环形队列和多线程的实现,用于多线程同步处理 22 | 4.增加了信号槽,用于子线程和主线程通讯 23 | 24 | ## version 0.0.0.3 25 | 26 | 1.增加TCP通讯相关的实现 27 | 28 | ## version 0.0.0.4 29 | 30 | 1.增加对读取数据的处理,添加应用回调函数 31 | 32 | ## version 0.0.0.5 33 | 34 | 1.增加对于UDP的通讯实现 35 | 2.对应用的线程进行整理,由一个线程管理所有通讯 36 | 3.添加对界面的table处理 37 | 4.添加对opencv的支持,并提供编译完成的opencv库,不支持opencv的可以使用宏管理 38 | -------------------------------------------------------------------------------- /desktop/logger_tool/Program.cs: -------------------------------------------------------------------------------- 1 | namespace Tools 2 | { 3 | internal static class Program 4 | { 5 | /// 6 | /// The main entry point for the application. 7 | /// 8 | [STAThread] 9 | static void Main() 10 | { 11 | // To customize application configuration such as set high DPI settings or default font, 12 | // see https://aka.ms/applicationconfiguration. 13 | ApplicationConfiguration.Initialize(); 14 | Application.Run(new MainFrame()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /desktop/logger_tool/Tools.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | net6.0-windows 6 | enable 7 | true 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /desktop/logger_tool/Tools.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Form 6 | 7 | 8 | -------------------------------------------------------------------------------- /desktop/logger_tool/Tools.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33110.190 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools", "Tools.csproj", "{6897CCC9-327B-4A75-8F1A-A9B9CCB1012B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {6897CCC9-327B-4A75-8F1A-A9B9CCB1012B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {6897CCC9-327B-4A75-8F1A-A9B9CCB1012B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {6897CCC9-327B-4A75-8F1A-A9B9CCB1012B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {6897CCC9-327B-4A75-8F1A-A9B9CCB1012B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {2B9C01D0-FA1B-4D3A-87DC-9A89AA89BD27} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /desktop/manage_client/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_client/README.md -------------------------------------------------------------------------------- /desktop/manage_tool/api/api.pri: -------------------------------------------------------------------------------- 1 | HEADERS += \ 2 | $$PWD/app.h \ 3 | $$PWD/quiwidget.h 4 | 5 | SOURCES += \ 6 | $$PWD/app.cpp \ 7 | $$PWD/quiwidget.cpp 8 | -------------------------------------------------------------------------------- /desktop/manage_tool/api/app.hpp: -------------------------------------------------------------------------------- 1 | #ifndef APP_H 2 | #define APP_H 3 | 4 | #include "head.h" 5 | 6 | class App 7 | { 8 | public: 9 | static QString ConfigFile; //配置文件路径 10 | static QString SendFileName; //发送配置文件名 11 | static QString DeviceFileName; //模拟设备数据文件名 12 | 13 | static QString PortName; //串口号 14 | static int BaudRate; //波特率 15 | static int DataBit; //数据位 16 | static QString Parity; //校验位 17 | static double StopBit; //停止位 18 | 19 | static bool HexSend; //16进制发送 20 | static bool HexReceive; //16进制接收 21 | static bool Debug; //模拟设备 22 | static bool AutoClear; //自动清空 23 | 24 | static bool AutoSend; //自动发送 25 | static int SendInterval; //自动发送间隔 26 | static bool AutoSave; //自动保存 27 | static int SaveInterval; //自动保存间隔 28 | 29 | static QString Mode; //转换模式 30 | static QString ServerIP; //服务器IP 31 | static int ServerPort; //服务器端口 32 | static int ListenPort; //监听端口 33 | static int SleepTime; //延时时间 34 | static bool AutoConnect; //自动重连 35 | 36 | //读写配置参数及其他操作 37 | static void readConfig(); //读取配置参数 38 | static void writeConfig(); //写入配置参数 39 | static void newConfig(); //以初始值新建配置文件 40 | static bool checkConfig(); //校验配置文件 41 | 42 | static QStringList Intervals; 43 | static QStringList Datas; 44 | static QStringList Keys; 45 | static QStringList Values; 46 | static void readSendData(); 47 | static void readDeviceData(); 48 | }; 49 | 50 | #endif // APP_H 51 | -------------------------------------------------------------------------------- /desktop/manage_tool/debugwindows.cpp: -------------------------------------------------------------------------------- 1 | #include "debugwindows.h" 2 | #include "ui_debugwindows.h" 3 | 4 | debugWindows::debugWindows(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::debugWindows) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | debugWindows::~debugWindows() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /desktop/manage_tool/debugwindows.h: -------------------------------------------------------------------------------- 1 | #ifndef DEBUGWINDOWS_H 2 | #define DEBUGWINDOWS_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class debugWindows; 8 | } 9 | 10 | class debugWindows : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit debugWindows(QWidget *parent = nullptr); 16 | ~debugWindows(); 17 | 18 | private: 19 | Ui::debugWindows *ui; 20 | }; 21 | 22 | #endif // DEBUGWINDOWS_H 23 | -------------------------------------------------------------------------------- /desktop/manage_tool/debugwindows.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | debugWindows 6 | 7 | 8 | 9 | 0 10 | 0 11 | 400 12 | 300 13 | 14 | 15 | 16 | Form 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /desktop/manage_tool/icon.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "main.ico" -------------------------------------------------------------------------------- /desktop/manage_tool/image/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/image/test.jpg -------------------------------------------------------------------------------- /desktop/manage_tool/include/appthread.h: -------------------------------------------------------------------------------- 1 | #ifndef APPTHREAD_H 2 | #define APPTHREAD_H 3 | 4 | #include 5 | #include "protocol.h" 6 | #include "udpclient.h" 7 | 8 | class CAppThreadInfo:public QThread 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | CAppThreadInfo() 14 | { 15 | m_pQueue = new CProtocolQueue(); 16 | } 17 | ~CAppThreadInfo() 18 | { 19 | delete m_pQueue; 20 | m_pQueue = nullptr; 21 | } 22 | CProtocolQueue *m_pQueue; 23 | 24 | int QueuePost(SSendBuffer *pSendBuffer) 25 | { 26 | if (m_pQueue != nullptr) 27 | { 28 | return m_pQueue->QueuePost(pSendBuffer); 29 | } 30 | return QUEUE_INFO_INVALID; 31 | } 32 | 33 | protected: 34 | virtual void run(); 35 | 36 | void CloseThread(){ 37 | m_nIsStop = 0; 38 | } 39 | 40 | private: 41 | volatile bool m_nIsStop{false}; 42 | }; 43 | 44 | void AppThreadInit(void); 45 | CAppThreadInfo *GetAppThreadInfo(); 46 | #endif // APPTHREAD_H 47 | -------------------------------------------------------------------------------- /desktop/manage_tool/include/commandinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMANDINFO_H 2 | #define COMMANDINFO_H 3 | 4 | #include 5 | #include "typedef.h" 6 | 7 | #define CMD_LIST_SIZE 8 8 | 9 | #define LED_ON_CMD 0x00 10 | #define LED_OFF_CMD 0x01 11 | #define BEEP_ON_CMD 0x02 12 | #define BEEP_OFF_CMD 0x03 13 | #define DEV_REBOOT_CMD 0x04 14 | #define GET_INFO_CMD 0x05 15 | #define ABORT_CMD 0x06 16 | #define SYSTEM_UPDATE_CMD 0x07 17 | 18 | #define DEV_WRITE_THROUGH_CMD 0xFF 19 | 20 | union UBaseStatus 21 | { 22 | uint32_t d32; 23 | 24 | struct 25 | { 26 | uint32_t led:1; 27 | uint32_t beep:1; 28 | uint32_t reserved:30; 29 | }b; 30 | }; 31 | 32 | #pragma pack(push) 33 | #pragma pack(1) 34 | struct SRegInfoList 35 | { 36 | union UBaseStatus s_base_status; //基础状态信息 37 | uint16_t sensor_ia; 38 | uint16_t sensor_als; 39 | uint16_t sensor_ps; 40 | uint16_t reserved0; 41 | uint32_t sensor_gyro_x; 42 | uint32_t sensor_gyro_y; 43 | uint32_t sensor_gyro_z; 44 | uint32_t sensor_accel_x; 45 | uint32_t sensor_accel_y; 46 | uint32_t sensor_accel_z; 47 | uint32_t sensor_temp; 48 | uint32_t rtc_sec; 49 | uint32_t rtc_minute; 50 | uint32_t rtc_hour; 51 | }; 52 | #pragma pack(pop) 53 | 54 | struct SCommandInfo 55 | { 56 | uint8_t *m_pbuffer{nullptr}; 57 | uint16_t m_nSize{0}; 58 | uint8_t m_nCommand{0}; 59 | std::function m_pFunc; 60 | }; 61 | 62 | void CommandInfoInit(void); 63 | SCommandInfo *GetCommandPtr(uint16_t index); 64 | #endif // COMMANDINFO_H 65 | -------------------------------------------------------------------------------- /desktop/manage_tool/include/configfile.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIGFILE_H 2 | #define CONFIGFILE_H 3 | 4 | #include "typedef.h" 5 | 6 | struct SSystemConfig 7 | { 8 | //串口相关 9 | QString m_SCom{"COM1"}; 10 | QString m_SBaud{"115200"}; 11 | QString m_SDataBits{"8"}; 12 | QString m_SStopBits{"1"}; 13 | QString m_SParity{"N"}; 14 | 15 | //设备ID 16 | QString m_SDeviceID{"1"}; 17 | 18 | //网络Socket相关 19 | QString m_SProtocol{"TCP"}; 20 | QString m_SIpAddr{"127.0.0.1"}; 21 | QString m_SLocalIpAddr{"127.0.0.1"}; 22 | QString m_SPort{"8000"}; 23 | QString m_SLocalPort{"8100"}; 24 | }; 25 | 26 | void SystemConfigUpdate(void); 27 | void SystemConfigInfoInit(void); 28 | struct SSystemConfig *GetSystemConfigInfo(void); 29 | 30 | #endif // CONFIGFILE_H 31 | -------------------------------------------------------------------------------- /desktop/manage_tool/include/head.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if (QT_VERSION > QT_VERSION_CHECK(5,0,0)) 5 | #include 6 | #endif 7 | 8 | #include "app.hpp" 9 | 10 | #pragma execution_character_set("utf-8") 11 | -------------------------------------------------------------------------------- /desktop/manage_tool/include/tcpclient.h: -------------------------------------------------------------------------------- 1 | #ifndef SOCKETCLIENT_H 2 | #define SOCKETCLIENT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "mainwindow.h" 9 | #include "ui_mainwindow.h" 10 | #include "protocol.h" 11 | 12 | class CTcpSocketInfo:public QWidget, public protocol_info 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | CTcpSocketInfo(uint8_t *pRxBuffer, uint8_t *pTxBuffer, int nMaxBufSize): 18 | protocol_info(pRxBuffer, pTxBuffer, nMaxBufSize){ 19 | m_pSemphore = new QSemaphore(0); 20 | } 21 | ~CTcpSocketInfo() 22 | { 23 | m_pTcpSocket->deleteLater(); 24 | delete m_pSemphore; 25 | delete m_pServerIp; 26 | } 27 | 28 | int DeviceRead(uint8_t *pStart, uint16_t nMaxSize){ 29 | uint16_t nReadSize = 0; 30 | 31 | if (m_pTcpSocket->bytesAvailable() > 0) 32 | { 33 | nReadSize = m_pTcpSocket->read((char *)pStart, nMaxSize); 34 | } 35 | return nReadSize; 36 | } 37 | 38 | int DeviceWrite(uint8_t *pStart, uint16_t nSize){ 39 | return m_pTcpSocket->write((char *)pStart, nSize); 40 | } 41 | 42 | void SetSocketInfo(QString SIpAddress, int nPort) 43 | { 44 | if (!m_pServerIp->setAddress(SIpAddress)){ 45 | qDebug()<<"SetAddress error\n"; 46 | } 47 | m_nPort = nPort; 48 | } 49 | 50 | void TcpClientSocketInitForThread(); 51 | int TcpClientSocketLoopThread(SSendBuffer *pSendbuffer); 52 | QTcpSocket *m_pTcpSocket; 53 | QHostAddress *m_pServerIp; 54 | int m_nPort; 55 | QSemaphore *m_pSemphore; 56 | 57 | private: 58 | bool status{false}; 59 | 60 | signals: 61 | void send_edit_recv(QString); 62 | void send_edit_test(QString); 63 | 64 | public slots: 65 | void slotConnected(); 66 | void slotDisconnected(); 67 | void dataReceived(); 68 | }; 69 | 70 | void TcpClientSocketInit(void); 71 | CTcpSocketInfo *GetTcpClientSocketInfo(); 72 | 73 | #endif // SOCKETCLIENT_H 74 | -------------------------------------------------------------------------------- /desktop/manage_tool/include/typedef.h: -------------------------------------------------------------------------------- 1 | #ifndef TYPEDEF_H 2 | #define TYPEDEF_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | typedef unsigned char uint8_t; 9 | typedef unsigned short uint16_t; 10 | typedef unsigned int uint32_t; 11 | 12 | #define USE_OPENCV 0//是否使用OPENCV模块 13 | 14 | 15 | #define UDP_DEFAULT_PORT 8100 16 | 17 | #define RT_PROTOCOL_OK 0 18 | #define RT_PROTOCOL_TIMOUT 1 19 | #define RT_PROTOCOL_IDERR 2 20 | #define RT_PROTOCOL_PACKETERR 3 21 | #define RT_PROTOCOL_CHECKERR 4 22 | 23 | //协议相关的指令 24 | #define PROTOCOL_SEND_HEAD 0x5A 25 | #define PROTOCOL_RECV_HEAD 0x5B 26 | #define PROTOCOL_RECV_HEAD_SIZE 3 27 | #define PROTOCOL_CRC_SIZE 2 28 | #define PROTOCOL_TIMEOUT 3000 29 | 30 | //缓存的大小 31 | #define BUFF_CACHE_SIZE 1200 32 | 33 | //接收数据的头部长度 34 | #define RECV_DATA_HEAD 7 35 | 36 | #define RT_OK 0 37 | #define RT_EMPTY -1 38 | #define RT_TIMEOUT -2 39 | #define RT_CRC_ERROR -3 40 | #define RT_FAIL -4 41 | 42 | //队列相关的信息 43 | #define MAX_QUEUE 20 44 | #define QUEUE_INFO_OK 0 45 | #define QUEUE_INFO_FULL -1 46 | #define QUEUE_INFO_INVALID -2 47 | #define QUEUE_INFO_EMPTY -3 48 | 49 | //文件大小 50 | #define FILE_BLOCK_SIZE 1000 51 | 52 | #define TEST_DEBUG 1 53 | 54 | #define DEFAULT_CONFIG_FILE "config.json" 55 | //当前的协议类型 56 | enum PROTOCOL_STATUS 57 | { 58 | PROTOCOL_NULL = 0, 59 | PROTOCOL_UART, 60 | PROTOCOL_TCP, 61 | PROTOCOL_UDP 62 | }; 63 | 64 | #define SYSTEM_VERSION "v0.05" 65 | #endif // TYPEDEF_H 66 | -------------------------------------------------------------------------------- /desktop/manage_tool/include/uartclient.h: -------------------------------------------------------------------------------- 1 | #ifndef CUartThread_H_H 2 | #define CUartThread_H_H 3 | 4 | #include 5 | #include "mainwindow.h" 6 | #include "ui_mainwindow.h" 7 | #include "protocol.h" 8 | #include "qextserialport/qextserialport.h" 9 | 10 | class CUartProtocolInfo:public QWidget, public protocol_info 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | CUartProtocolInfo(uint8_t *pRxBuffer, uint8_t *pTxBuffer, int nMaxBufSize): 16 | protocol_info(pRxBuffer, pTxBuffer, nMaxBufSize){ 17 | } 18 | ~CUartProtocolInfo(){ 19 | } 20 | 21 | int DeviceRead(uint8_t *pStart, uint16_t nMaxSize){ 22 | return m_pSerialPortCom->read((char *)pStart, nMaxSize); 23 | } 24 | 25 | int DeviceWrite(uint8_t *pStart, uint16_t nSize){ 26 | m_pSerialPortCom->write((char *)pStart, nSize); 27 | return nSize; 28 | } 29 | 30 | int UartLoopThread(SSendBuffer *pSendbuffer); 31 | 32 | volatile bool m_bComStatus{false}; 33 | QextSerialPort *m_pSerialPortCom; 34 | 35 | signals: 36 | void send_edit_recv(QString); 37 | void send_edit_test(QString); 38 | }; 39 | 40 | void UartThreadInit(void); 41 | CUartProtocolInfo *GetUartProtocolInfo(void); 42 | #endif // CUartThread_H_H 43 | -------------------------------------------------------------------------------- /desktop/manage_tool/main.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | 主界面相关显示应用 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include "mainwindow.h" 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | QApplication a(argc, argv); 13 | MainWindow w; 14 | 15 | QTextCodec *codec = QTextCodec::codecForName("utf-8"); 16 | QTextCodec::setCodecForLocale(codec); 17 | w.setWindowTitle(QString::fromUtf8("远程界面管理")); 18 | w.show(); 19 | return a.exec(); 20 | } 21 | -------------------------------------------------------------------------------- /desktop/manage_tool/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/main.ico -------------------------------------------------------------------------------- /desktop/manage_tool/main.qrc: -------------------------------------------------------------------------------- 1 |  2 | 3 | image/test.jpg 4 | 5 | 6 | -------------------------------------------------------------------------------- /desktop/manage_tool/manage_tool.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | QT += network 3 | 4 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 5 | 6 | CONFIG += c++11 7 | 8 | include ($$PWD/qextserialport/qextserialport.pri) 9 | 10 | # The following define makes your compiler emit warnings if you use 11 | # any Qt feature that has been marked deprecated (the exact warnings 12 | # depend on your compiler). Please consult the documentation of the 13 | # deprecated API in order to know how to port your code away from it. 14 | DEFINES += QT_DEPRECATED_WARNINGS 15 | 16 | # You can also make your code fail to compile if it uses deprecated APIs. 17 | # In order to do so, uncomment the following line. 18 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 19 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 20 | 21 | SOURCES += \ 22 | appthread.cpp \ 23 | commandinfo.cpp \ 24 | configfile.cpp \ 25 | imageprocess.cpp \ 26 | main.cpp \ 27 | mainwindow.cpp \ 28 | protocol.cpp \ 29 | tcpclient.cpp \ 30 | uartclient.cpp \ 31 | udpclient.cpp \ 32 | screenshot/screenshot.cpp 33 | 34 | HEADERS += \ 35 | include/appthread.h \ 36 | include/commandinfo.h \ 37 | include/configfile.h \ 38 | include/imageprocess.h \ 39 | include/mainwindow.h \ 40 | include/protocol.h \ 41 | include/tcpclient.h \ 42 | include/typedef.h \ 43 | include/uartclient.h \ 44 | include/udpclient.h \ 45 | screenshot/screenshot.h 46 | 47 | FORMS += \ 48 | mainwindow.ui 49 | 50 | INCLUDEPATH += $$PWD\..\..\..\opencv_install\include 51 | INCLUDEPATH += $$PWD\include 52 | 53 | #LIBS += $$PWD\..\..\..\opencv_install\x64\mingw\lib\libopencv_*.a 54 | 55 | # Default rules for deployment. 56 | qnx: target.path = /tmp/$${TARGET}/bin 57 | else: unix:!android: target.path = /opt/$${TARGET}/bin 58 | !isEmpty(target.path): INSTALLS += target 59 | 60 | DISTFILES += \ 61 | icon.rc 62 | 63 | RC_FILE = icon.rc 64 | 65 | RESOURCES += main.qrc \ 66 | other/qss.qrc 67 | -------------------------------------------------------------------------------- /desktop/manage_tool/other/main.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/btn_close.png 4 | image/btn_ok.png 5 | image/fontawesome-webfont.ttf 6 | image/msg_error.png 7 | image/msg_info.png 8 | image/msg_question.png 9 | image/qt_zh_CN.qm 10 | image/widgets.qm 11 | 12 | 13 | -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/add_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/add_bottom.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/add_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/add_left.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/add_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/add_right.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/add_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/add_top.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/branch_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/branch_close.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/branch_open.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/calendar_nextmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/calendar_nextmonth.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/calendar_prevmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/calendar_prevmonth.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/checkbox_checked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/checkbox_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/checkbox_checked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/checkbox_parcial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/checkbox_parcial.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/checkbox_parcial_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/checkbox_parcial_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/checkbox_unchecked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/checkbox_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/checkbox_unchecked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/radiobutton_checked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/radiobutton_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/radiobutton_checked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/radiobutton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/radiobutton_unchecked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/flatwhite/radiobutton_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/flatwhite/radiobutton_unchecked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/add_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/add_bottom.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/add_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/add_left.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/add_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/add_right.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/add_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/add_top.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/branch_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/branch_close.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/branch_open.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/calendar_nextmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/calendar_nextmonth.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/calendar_prevmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/calendar_prevmonth.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/checkbox_checked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/checkbox_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/checkbox_checked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/checkbox_parcial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/checkbox_parcial.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/checkbox_parcial_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/checkbox_parcial_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/checkbox_unchecked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/checkbox_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/checkbox_unchecked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/radiobutton_checked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/radiobutton_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/radiobutton_checked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/radiobutton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/radiobutton_unchecked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/lightblue/radiobutton_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/lightblue/radiobutton_unchecked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/add_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/add_bottom.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/add_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/add_left.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/add_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/add_right.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/add_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/add_top.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/branch_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/branch_close.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/branch_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/branch_open.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/calendar_nextmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/calendar_nextmonth.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/calendar_prevmonth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/calendar_prevmonth.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/checkbox_checked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/checkbox_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/checkbox_checked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/checkbox_parcial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/checkbox_parcial.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/checkbox_parcial_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/checkbox_parcial_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/checkbox_unchecked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/checkbox_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/checkbox_unchecked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/radiobutton_checked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/radiobutton_checked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/radiobutton_checked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/radiobutton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/radiobutton_unchecked.png -------------------------------------------------------------------------------- /desktop/manage_tool/other/qss/psblack/radiobutton_unchecked_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/other/qss/psblack/radiobutton_unchecked_disable.png -------------------------------------------------------------------------------- /desktop/manage_tool/qextserialport/qextserialport.pri: -------------------------------------------------------------------------------- 1 | HEADERS += \ 2 | $$PWD/qextserialport.h \ 3 | $$PWD/qextserialport_global.h \ 4 | $$PWD/qextserialport_p.h 5 | 6 | SOURCES += $$PWD/qextserialport.cpp 7 | 8 | win32:SOURCES += $$PWD/qextserialport_win.cpp 9 | unix:SOURCES += $$PWD/qextserialport_unix.cpp 10 | -------------------------------------------------------------------------------- /desktop/manage_tool/qextserialport/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/qextserialport/readme.txt -------------------------------------------------------------------------------- /desktop/manage_tool/socketthread.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/desktop/manage_tool/socketthread.cpp -------------------------------------------------------------------------------- /desktop/manage_tool/uartclient.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | Uart通讯的线程处理和回调执行实现 3 | */ 4 | #include "uartclient.h" 5 | #include "mainwindow.h" 6 | 7 | static CUartProtocolInfo *pUartProtocolInfo; 8 | static uint8_t rx_buffer[BUFF_CACHE_SIZE]; 9 | static uint8_t tx_buffer[BUFF_CACHE_SIZE]; 10 | 11 | /*! 12 | uart线程循环的应用执行 13 | */ 14 | int CUartProtocolInfo::UartLoopThread(SSendBuffer *pSendbuffer) 15 | { 16 | int nLen; 17 | 18 | if (m_bComStatus) 19 | { 20 | nLen = this->CreateSendBuffer(this->GetId(), pSendbuffer->m_nSize, 21 | pSendbuffer->m_pBuffer, pSendbuffer->m_IsWriteThrough); 22 | this->DeviceWrite(tx_buffer, nLen); 23 | emit send_edit_test(byteArrayToHexString("Sendbuf:", tx_buffer, nLen, "\n")); 24 | 25 | if (this->CheckReceiveData(false) == RT_OK) 26 | { 27 | emit send_edit_test(byteArrayToHexString("Recv Buf:", 28 | m_pRxBuffer, m_RxBufSize, "\n")); 29 | if (pSendbuffer->m_pFunc != nullptr) 30 | { 31 | emit send_edit_recv(pSendbuffer->m_pFunc(m_pRxDataBuffer, m_RxBufSize-RECV_DATA_HEAD)); 32 | } 33 | } 34 | else 35 | { 36 | emit send_edit_test(QString("Receive Failed")); 37 | return RT_FAIL; 38 | } 39 | } 40 | 41 | qDebug()<<"uart thread queue test OK"; 42 | return RT_OK; 43 | } 44 | 45 | /*! 46 | Uart应用线程初始化 47 | */ 48 | void UartThreadInit(void) 49 | { 50 | pUartProtocolInfo = new CUartProtocolInfo(rx_buffer, tx_buffer, BUFF_CACHE_SIZE); 51 | } 52 | 53 | /*! 54 | 获取Uart的信息数据结构 55 | */ 56 | CUartProtocolInfo *GetUartProtocolInfo(void) 57 | { 58 | return pUartProtocolInfo; 59 | } 60 | -------------------------------------------------------------------------------- /desktop/manage_tool/updclient.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "udpclient.h" 3 | -------------------------------------------------------------------------------- /doc/feature.md: -------------------------------------------------------------------------------- 1 | # feature 2 | 3 | 本文档主要说明关键功能的设计思路和方法的整理,具体如下。 4 | 5 | ## logger-module 6 | 7 | logger模块主要为所有模块提供logger打印, 记录和命令远程调试功能. 对于打印,记录功能,流程如下。 8 | 9 | 1. PRINT_LOG应用接口(各应用中)。 10 | 2. logger_rx_fifo,通过logger_tool进程。 11 | 3. logger输出接口,支持网络,stdout, 以及本地文件。 12 | 13 | 在打印基础上,支持打印信息控制,按照等级分为: 14 | 15 | - LOG_TRACE trace level,此时打印所有信息 16 | - LOG_DEBUG debug level,在调试模式下打印的信息 17 | - LOG_INFO info level,此时打印执行中的常用信息 18 | - LOG_WARN warning level,仅打印警告以上的信息 19 | - LOG_ERROR error level, 仅打印错误以上的信息 20 | - LOG_FATAL fatal level, 仅打印致命以上的信息 21 | 22 | 关于系统的权限管理,分为两部分,主要是调试信息打印权限和记录权限,打印权限主要用于产品出问题时代码调试,记录权限则用于记录系统长期运行的状态,用于后期产品工作状态分析,对于系统权限的修改,主要包含功能实现为。 23 | 24 | 1. 支持logger权限的修改,支持桌面工具(开启调试模式密码),UI界面和logger工具直接修改权限 25 | 2. 权限修改能够存储文件,在下次启动时保留。 26 | 3. 打印权限由各个模块独自管理,提高工作效率,记录权限由logger管理,确定何时记录logger信息。 27 | 28 | 上述时logger模块的核心述求。另外为了验证新功能,权限的配置文件用数据库文件存储(基于sqlite)。 29 | -------------------------------------------------------------------------------- /doc/image/mainFrame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/doc/image/mainFrame.png -------------------------------------------------------------------------------- /doc/协议文档定义.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/doc/协议文档定义.docx -------------------------------------------------------------------------------- /doc/嵌入式Linux应用综合设计文档.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/doc/嵌入式Linux应用综合设计文档.xlsx -------------------------------------------------------------------------------- /doc/嵌入式Linux应用设计文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/doc/嵌入式Linux应用设计文档.docx -------------------------------------------------------------------------------- /doc/进程间交互协议.md: -------------------------------------------------------------------------------- 1 | # 进程间交互协议 2 | 3 | 本项目涉及进程包含如下。 4 | 5 | 1. logger_tool: 调试打印进程,支持打印输出和命令管理 6 | 2. local_device: 本地硬件信息管理 7 | 3. main_process: 主进程,转换和管理所有数据 8 | 4. lower_device: 管理下位机设备信息(CAN/RS485/) 9 | 5. gui_manage: 图形管理进程 10 | 6. node_server: web交互进程 11 | 12 | ## 调试进程和所有进程 13 | 14 | 调试进程和所有进程通过FIFO通讯 15 | 16 | ```shell 17 | #所有进程=>调试进程 18 | 通讯FIFO: /tmp/app/log_rx.fifo 19 | 字符串打印,直接输出。 20 | 21 | #logger_tool=>local_device命令 22 | 通讯FIFO: "/tmp/app/log_loc_dev_tx.fifo" 23 | !local_dev [command] 24 | 25 | #logger_tool=>main_process 26 | 通讯FIFO: "/tmp/app/log_mp_tx.fifo" 27 | !main_process [command] 28 | 29 | #logger_tool=>lower_device 30 | 通讯FIFO: "/tmp/app/log_low_dev_tx.fifo" 31 | !lower_dev [command] 32 | 33 | #logger_tool=>gui_manage 34 | 通讯FIFO: "/tmp/app/log_gui_tx.fifo" 35 | !gui [command] 36 | ``` 37 | -------------------------------------------------------------------------------- /embed/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for multi files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | dir := ${ENV_PATH_ROOT}/embed 9 | 10 | include $(ENV_PATH_ROOT)/build/buildmulti.mk 11 | -------------------------------------------------------------------------------- /embed/README.md: -------------------------------------------------------------------------------- 1 | # 嵌入式系统设计文档 2 | 3 | ## embed_framework 4 | 5 | 对于嵌入式端设计开发,主要包含如下功能模块,有相应文件目录实现。 6 | 7 | - gui_manage :gui界面管理,展示设备支持信息。 8 | - local_device :本地设备管理,管理本地硬件设备。 9 | - logger_tool :用于logger打印调试工具。支持调试信息打印和远端命令调试 10 | - lower_device :用于管理下位机设备数据的进程。 11 | - main_process :核心进程,管理数据交互提交到mqtt服务器,用于其它模块访问。 12 | - node_server :node web后台服务,启用node服务器应用。 13 | 14 | ## logger_tool 15 | 16 | logger_tool是用于处理调试信息的工具,其它模块通过接口**PRINT_LOG(level, time, fmt, ...)**将logger信息发送服务器中 17 | -------------------------------------------------------------------------------- /embed/common/common.mk: -------------------------------------------------------------------------------- 1 | 2 | common_path = $(ENV_PATH_ROOT)/embed/common 3 | 4 | #cpp 5 | cpp_objects += ${common_path}/fifo/fifo_manage.o 6 | cpp_objects += ${common_path}/jsonconfig/json_config.o 7 | cpp_objects += ${common_path}/logger/logger_manage.o 8 | cpp_objects += ${common_path}/server/asio_server.o 9 | cpp_objects += ${common_path}/calculate.o 10 | cpp_objects += ${common_path}/timer_manage.o 11 | cpp_objects += $(common_path)/parameter_parser.o 12 | 13 | #include 14 | INCLUDES += -I ${common_path}/ 15 | INCLUDES += -I ${common_path}/event/ 16 | INCLUDES += -I ${common_path}/fifo/ 17 | INCLUDES += -I ${common_path}/jsonconfig/ 18 | INCLUDES += -I ${common_path}/logger/ 19 | INCLUDES += -I ${common_path}/server/ 20 | INCLUDES += -I $(ENV_PATH_ROOT)/thirdparts/fmt/include/ 21 | -------------------------------------------------------------------------------- /embed/common/common_unit.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // common.hpp 7 | // 8 | // Purpose: 9 | // 全局的用于支持项目编译包含的库 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "common.hpp" 22 | 23 | //common unit for all application 24 | #include "tty.hpp" 25 | #include "timer_manage.hpp" 26 | #include "fifo/fifo_manage.hpp" 27 | #include "jsonconfig/json_config.hpp" 28 | #include "logger/logger_manage.hpp" 29 | 30 | uint16_t crc16(uint16_t crc, uint8_t const *buffer, uint16_t len); 31 | -------------------------------------------------------------------------------- /embed/common/event/thread_queue.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // thread_queue.hpp 7 | // 8 | // Purpose: 9 | // 基于Semaphore实现的消息队列, 用于线程间传递消息 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include 22 | #include 23 | #include "semaphore.hpp" 24 | 25 | namespace EVENT 26 | { 27 | 28 | template 29 | class Thread_Queue 30 | { 31 | public: 32 | /// \brief send 33 | /// - This method is used to post queue. 34 | /// \param Object - the object send to queue. 35 | void send(T& Object) 36 | { 37 | { 38 | std::unique_lock lock(mutex_); 39 | queue_.push(Object); 40 | } 41 | 42 | semaphore_.signal(); 43 | } 44 | 45 | /// \brief receive 46 | /// - This method is used to receive queue. 47 | /// \param timeout - timeout wait for the queue. 48 | /// \param Object - the object receive from queue. 49 | /// \return wheather success receive the queue. 50 | bool receive(T& Object, uint32_t timeout) 51 | { 52 | int ret = false; 53 | 54 | if (semaphore_.wait(timeout)) 55 | { 56 | std::unique_lock lock(mutex_); 57 | if (queue_.size() != 0) 58 | { 59 | Object = queue_.front(); 60 | queue_.pop(); 61 | ret = true; 62 | } 63 | } 64 | return ret; 65 | } 66 | 67 | private: 68 | /// \brief queue_ 69 | /// - the queue for the communication. 70 | std::queue queue_; 71 | 72 | /// \brief mutex_ 73 | /// - mutex used to protect the queue. 74 | std::mutex mutex_; 75 | 76 | /// \brief semaphore_ 77 | /// - semaphore used to protect the queue. 78 | semaphore semaphore_; 79 | }; 80 | 81 | } 82 | -------------------------------------------------------------------------------- /embed/common/global_def.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // global_def.hpp 7 | // 8 | // Purpose: 9 | // 用于全局共享的定义 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | //定义common执行的进程 22 | #define PROCESS_MAIN_PROCESS 0 23 | #define PROCESS_LOWER_DEVICE 1 24 | #define PROCESS_LOCAL_DEVICE 2 25 | #define PROCESS_LOGGER_TOOL 3 26 | 27 | //定义全局的返回状态 28 | #define RT_INVALID_MQ_SIZE -4 29 | #define RT_INVALID_BUF_SIZE -3 30 | #define RT_INVALID_MQ -2 31 | #define RT_OK 0 32 | #define RT_FAIL 1 33 | #define RT_EMPTY 2 34 | #define RT_TIMEOUT 3 35 | #define RT_INVALID 4 36 | 37 | //定义使用的配置文件名称 38 | #define DEFAULT_CONFIG_FILE "config.json" 39 | -------------------------------------------------------------------------------- /embed/common/parameter_parser.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // parameter_parser.hpp 7 | // 8 | // Purpose: 9 | // 解析输入参数 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 8/16/2024 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "common.hpp" 22 | 23 | struct _Params { 24 | std::string configfile; 25 | bool is_default_config; 26 | 27 | std::string ipaddress; 28 | std::string mqtt_host; 29 | uint16_t mqtt_port; 30 | }; 31 | 32 | bool parse_parameter(struct _Params *params, int argc, char **argv); 33 | -------------------------------------------------------------------------------- /embed/gui_manage/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/embed/gui_manage/README.md -------------------------------------------------------------------------------- /embed/local_device/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # THIS FILE IS BASIC MAKE FILE FOR 4 | # Copyright (c) 2020-2021 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | 9 | # This is object should be build and will link to generate 10 | # the executables 11 | BUILD=e 12 | 13 | CCFLAGS := -O3 -std=c++17 -fno-strict-aliasing -lrt 14 | 15 | cpp_objects = main.o \ 16 | device_manage.o \ 17 | driver/device_base.o \ 18 | driver/driver.o \ 19 | driver/key.o \ 20 | driver/rtc.o \ 21 | driver/spi_icm.o \ 22 | module/cmd_process.o 23 | 24 | INCLUDES = -I include/ \ 25 | -I driver/ \ 26 | -I module/ 27 | 28 | INCLUDES += -I $(ENV_PATH_ROOT)/thirdparts/asio/include/ \ 29 | -I $(ENV_PATH_ROOT)/thirdparts/jsoncpp/include/ 30 | 31 | library = $(SUPPORT_ENV_INSTALL)/lib/libjsoncpp.a 32 | 33 | # This is the file name of the executables and path where 34 | # place the executables 35 | buildout = local_device 36 | 37 | # Including this file allows access to the Build System. 38 | include $(ENV_PATH_ROOT)/embed/common/common.mk 39 | include $(ENV_PATH_ROOT)/build/buildrules.mk 40 | -------------------------------------------------------------------------------- /embed/local_device/README.md: -------------------------------------------------------------------------------- 1 | # local_device 2 | 3 | 用于管理本地设备的模块,访问本地所有设备,进行操作。 4 | -------------------------------------------------------------------------------- /embed/local_device/driver/beep.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // beep.hpp 7 | // 8 | // Purpose: 9 | // 蜂鸣器管理驱动,包含IO支持特性 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "device_base.hpp" 22 | 23 | class beep_device:public io_base 24 | { 25 | public: 26 | /// \brief constructor 27 | using io_base::io_base; 28 | }; 29 | -------------------------------------------------------------------------------- /embed/local_device/driver/driver.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // driver.cpp 7 | // 8 | // Purpose: 9 | // 驱动管理模块,用于初始化开启所有硬件使用的外设 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | #include "driver.hpp" 20 | 21 | driver_manage* driver_manage::instance_pointer_ = nullptr; 22 | driver_manage* driver_manage::get_instance() 23 | { 24 | if (instance_pointer_ == nullptr) 25 | { 26 | instance_pointer_ = new(std::nothrow) driver_manage; 27 | if (instance_pointer_ == nullptr) 28 | { 29 | //do something 30 | } 31 | } 32 | return instance_pointer_; 33 | } 34 | 35 | bool driver_manage::init() 36 | { 37 | bool ret = true; 38 | 39 | system_config *pConfig = system_config::get_instance(); 40 | 41 | ret &= led_zero_.init(pConfig->get_led_config().dev, O_RDWR | O_NONBLOCK); 42 | ret &= beep_zero_.init(pConfig->get_beep_config().dev, O_RDWR | O_NONBLOCK); 43 | ret &= ap3216_dev_.init(pConfig->get_ap_config().dev, O_RDONLY | O_NONBLOCK); 44 | ret &= icm20608_dev_.init(pConfig->get_icm_config().dev, O_RDONLY | O_NONBLOCK); 45 | ret &= rtc_dev_.init(pConfig->get_rtc_config().dev, O_RDONLY | O_NONBLOCK); 46 | ret &= key_zero_.init(pConfig->get_key_config().dev, O_RDWR); 47 | ret &= hx711_dev_.init(pConfig->get_iio_config().hx711_dev); 48 | ret &= vf610_adc_dev_.init(pConfig->get_iio_config().vf610_adc_dev); 49 | ret &= pwm_dev_.init(pConfig->get_pwm_config().pwm_chip); 50 | ret &= pwm_dev_.pwm_setup(pConfig->get_pwm_config().state, pConfig->get_pwm_config().peroid, pConfig->get_pwm_config().duty_cycle); 51 | ret &= loopled_dev_.init(pConfig->get_loopled_config().dev, O_RDWR | O_NONBLOCK); 52 | 53 | if (ret) 54 | { 55 | led_zero_.write_io_status(pConfig->get_led_config().init); 56 | beep_zero_.write_io_status(pConfig->get_beep_config().init); 57 | PRINT_LOG(LOG_INFO, 0, "Device driver_manage Init Success!"); 58 | } 59 | 60 | return true; 61 | } 62 | -------------------------------------------------------------------------------- /embed/local_device/driver/i2c_ap.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // i2c_ap.hpp 7 | // 8 | // Purpose: 9 | // AP模块对应的I2C接口,通过继承支持直接读取模块信息 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "device_base.hpp" 22 | 23 | class ap_device:public info_base 24 | { 25 | public: 26 | /// \brief constructor 27 | using info_base::info_base; 28 | }; 29 | -------------------------------------------------------------------------------- /embed/local_device/driver/key.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // key.hpp 7 | // 8 | // Purpose: 9 | // 按键管理模块,处理按键的初始化和注册回调事件 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/24/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "device_base.hpp" 22 | 23 | #define KEY_NUM 11 24 | #define KEY_PREES 1 25 | #define KEY_RELEASE 0 26 | 27 | class key_device:public device_base 28 | { 29 | public: 30 | /// \brief constructor 31 | using device_base::device_base; 32 | 33 | /// \brief init 34 | /// - This method is used to init the object. 35 | /// \param DevicePath - path of the system device. 36 | /// \param flags - flags process the device. 37 | /// \return Wheather initialize is success or failed. 38 | virtual bool init(const std::string &DevicePath, int flags) override; 39 | 40 | /// \brief register_func 41 | /// - This method is used to register function for key callback. 42 | /// \param func - function register for the key. 43 | /// \return Wheather register is success or failed. 44 | bool register_func(uint16_t key_num, uint16_t key_event, std::function func); 45 | 46 | private: 47 | /// \brief run 48 | /// - This method is used for thread run key. 49 | void run(); 50 | }; -------------------------------------------------------------------------------- /embed/local_device/driver/led.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // led.hpp 7 | // 8 | // Purpose: 9 | // LED管理驱动,包含IO支持特性 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "device_base.hpp" 22 | 23 | class led_device: public io_base 24 | { 25 | public: 26 | /// \brief constructor 27 | using io_base::io_base; 28 | }; 29 | -------------------------------------------------------------------------------- /embed/local_device/driver/rtc.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // rtc.cpp 7 | // 8 | // Purpose: 9 | // rtc时钟, 支持访问本地和硬件时钟 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | #include 20 | #include "rtc.hpp" 21 | 22 | #define FMT_HEADER_ONLY 23 | #include "fmt/core.h" 24 | 25 | bool rtc_device::update_rtc_time() 26 | { 27 | bool ret = false; 28 | 29 | #if __WORK_IN_WSL 30 | time_t timep; 31 | struct tm mytime, *p; 32 | 33 | time(&timep); 34 | p = localtime_r(&timep, &mytime); //gmtime_r将秒数转换成UTC时钟的时区值 35 | 36 | if (p != NULL) 37 | { 38 | rtc_time_.tm_sec = p->tm_sec; 39 | rtc_time_.tm_min = p->tm_min; 40 | rtc_time_.tm_hour = p->tm_hour; 41 | ret = true; 42 | } 43 | #else 44 | int retval; 45 | 46 | if (device_fd_>=0) 47 | { 48 | retval = ioctl(device_fd_, RTC_RD_TIME, &rtc_time_); 49 | if (retval >= 0) 50 | { 51 | time_str_ = fmt::format("{0:0>4}:{1:0>2}:{2:0>2} {3:0>2}:{4:0>2}:{5:0>2}", 52 | rtc_time_.tm_year, rtc_time_.tm_mon, rtc_time_.tm_mday, 53 | rtc_time_.tm_hour, rtc_time_.tm_min, rtc_time_.tm_sec); 54 | ret = true; 55 | } 56 | } 57 | #endif 58 | return ret; 59 | } 60 | 61 | bool rtc_device::init(const std::string &DevicePath, int flags) 62 | { 63 | start_time_ = get_run_time(); 64 | 65 | return device_base::init(DevicePath, flags); 66 | } 67 | 68 | int rtc_device::get_run_time() 69 | { 70 | uint64_t second = 0; 71 | 72 | if (update_rtc_time()) 73 | { 74 | second = rtc_time_.tm_hour*3600; 75 | second += rtc_time_.tm_min*60; 76 | second += rtc_time_.tm_sec; 77 | } 78 | return second-start_time_; 79 | } 80 | 81 | std::string &rtc_device::get_timer_str() 82 | { 83 | return time_str_; 84 | } -------------------------------------------------------------------------------- /embed/local_device/driver/rtc.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // rtc.hpp 7 | // 8 | // Purpose: 9 | // rtc时钟, 支持访问本地和硬件时钟 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include 22 | #include "device_base.hpp" 23 | 24 | class rtc_device:public device_base 25 | { 26 | public: 27 | /// \brief constructor 28 | using device_base::device_base; 29 | 30 | /// \brief init 31 | /// - This method is used to init the object. 32 | /// \param DevicePath - path of the system device. 33 | /// \param flags - flags process the device. 34 | /// \return Wheather initialize is success or failed. 35 | bool init(const std::string &DevicePath, int flags); 36 | 37 | /// \brief update_rtc_time 38 | /// - This method is used to update the rtc time. 39 | /// \return Wheather time update is success or failed. 40 | bool update_rtc_time(); 41 | 42 | /// \brief get_run_time 43 | /// - This method is used to get run time from start. 44 | /// \return The time from the start. 45 | int get_run_time(); 46 | 47 | /// \brief get_timer_str 48 | /// - This method is used to get timer string. 49 | /// \return The time string convert. 50 | std::string &get_timer_str(); 51 | 52 | private: 53 | /// \brief rtc_time_ 54 | /// - rtc time struct data. 55 | struct rtc_time rtc_time_{0}; 56 | 57 | /// \brief start_time_ 58 | /// - the time when init, used to calculate seconds. 59 | uint64_t start_time_{0}; 60 | 61 | /// \brief time_str_ 62 | /// - timer string. 63 | std::string time_str_{""}; 64 | }; 65 | -------------------------------------------------------------------------------- /embed/local_device/driver/spi_icm.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // spi_icm.cpp 7 | // 8 | // Purpose: 9 | // ICM模块对应的SPI接口,通过继承支持直接读取模块信息 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | #include "spi_icm.hpp" 20 | #include 21 | 22 | #define ANGLE_LIST_SIZE 3 23 | 24 | uint8_t AngleIndex = 0; 25 | double AngleList[ANGLE_LIST_SIZE]; 26 | 27 | void icm_device::calculate_angle(void) 28 | { 29 | double min, max, sumx; 30 | 31 | icm_info_.gyro_x_act = (float)(data.info.gyro_x_adc)/16.4; 32 | icm_info_.gyro_y_act = (float)(data.info.gyro_y_adc)/16.4; 33 | icm_info_.gyro_z_act = (float)(data.info.gyro_z_adc)/16.4; 34 | icm_info_.accel_x_act = (float)(data.info.accel_x_adc); 35 | icm_info_.accel_y_act = (float)(data.info.accel_y_adc); 36 | icm_info_.accel_z_act = (float)(data.info.accel_z_adc); 37 | icm_info_.temp_act = ((float)(data.info.temp_adc) - 25 ) / 326.8 + 25; 38 | 39 | AngleList[AngleIndex] = -atan2((double)icm_info_.accel_x_act, (double)icm_info_.accel_z_act)*18000/3.141592653; 40 | if (AngleList[AngleIndex] > 18000) 41 | AngleList[AngleIndex] -= 36000; 42 | if (AngleList[AngleIndex] < -18000) 43 | AngleList[AngleIndex] += 36000; 44 | 45 | AngleIndex++; 46 | if (AngleIndex == ANGLE_LIST_SIZE) 47 | AngleIndex = 0; 48 | 49 | sumx = 0; 50 | min = 0x3fff; 51 | max = -0x3fff; 52 | 53 | for (int i=0; i= max) 57 | max = AngleList[i]; 58 | 59 | if (AngleList[i] <= min) 60 | min = AngleList[i]; 61 | } 62 | sumx = sumx - max - min; 63 | angle_ = ((int32_t)round(sumx/(ANGLE_LIST_SIZE-2)))/100; 64 | } -------------------------------------------------------------------------------- /embed/local_device/driver/spi_icm.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // spi_icm.hpp 7 | // 8 | // Purpose: 9 | // ICM模块对应的SPI接口,通过继承支持直接读取模块信息 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "device_base.hpp" 22 | 23 | class icm_device : public info_base 24 | { 25 | public: 26 | /// \brief constructor 27 | using info_base::info_base; 28 | 29 | /// \brief calculate_angle 30 | /// - This method is used to calculate the angle. 31 | void calculate_angle(void); 32 | 33 | /// \brief get_icm_info 34 | /// - This method is used to get icm info. 35 | /// return current icm info. 36 | const icm_info& get_icm_info() { return icm_info_; } 37 | 38 | /// \brief get_icm_info 39 | /// - This method is used to get icm info. 40 | int32_t get_angle() { return angle_; } 41 | 42 | private: 43 | /// \brief icm_info_ 44 | /// - icm device read information. 45 | icm_info icm_info_; 46 | 47 | /// \brief angle_ 48 | /// - angle data calculate from icm info. 49 | int32_t angle_{0}; 50 | }; 51 | 52 | -------------------------------------------------------------------------------- /embed/local_device/include/productConfig.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // ProductConfig.hpp 7 | // 8 | // Purpose: 9 | // 包含应用配置信息的文件 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "global_def.hpp" 22 | 23 | #define PROCESS_RUN PROCESS_LOCAL_DEVICE 24 | #define TOOLS_NAME "local_device" 25 | #define PRINT_NOW_HEAD_STR "[0000 00:00:00][local_device][5]" 26 | -------------------------------------------------------------------------------- /embed/logger_tool/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # THIS FILE IS BASIC MAKE FILE FOR 4 | # Copyright (c) 2020-2021 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | 9 | # This is object should be build and will link to generate 10 | # the executables 11 | BUILD=e 12 | 13 | CCFLAGS := -O3 -std=c++17 -fno-strict-aliasing -lrt 14 | 15 | cpp_objects = main.o \ 16 | log_server.o \ 17 | log_process.o 18 | 19 | 20 | INCLUDES = -I include/ \ 21 | -I module/ 22 | 23 | INCLUDES += -I $(ENV_PATH_ROOT)/thirdparts/asio/include/ \ 24 | -I $(ENV_PATH_ROOT)/thirdparts/jsoncpp/include/ 25 | 26 | library = $(SUPPORT_ENV_INSTALL)/lib/libjsoncpp.a 27 | 28 | # This is the file name of the executables and path where 29 | # place the executables 30 | buildout = logger_tool 31 | 32 | # Including this file allows access to the Build System. 33 | include $(ENV_PATH_ROOT)/embed/common/common.mk 34 | include $(ENV_PATH_ROOT)/build/buildrules.mk 35 | -------------------------------------------------------------------------------- /embed/logger_tool/README.md: -------------------------------------------------------------------------------- 1 | # logger_tool 2 | 3 | logger是管理系统调试的功能模块,主要包含功能调试信息打印和命令行管理两部分工作内容。 4 | 5 | 1. 调试信息打印,主要接收其它设备的调试信息,然后输出到打印窗口。打印窗口主要有界面窗口和远程的socket客户端窗口。 6 | 2. 命令行管理,用于接收命令行的数据,转发给对应的模块处理。 7 | 8 | ## logger_printf 9 | 10 | logger打印模式主要流程为: 11 | 12 | 设备产生调试信息 => 写入发送logger发送fifo(LOGGER_RX_FIFO) => logger工具读取fifo中数据 => 将数据根据当前连接接口发送(本地/远端socket客户端) 13 | 14 | ```shell 15 | 16 | [day hour:minute:second][deivce][logger_level]:information data 17 | example: 18 | [0000 00:00:34][main_process][2]:global new information. 19 | 20 | ``` 21 | 22 | 注意: **发送logger信息长度要小于PIPE stack, 默认为512字节,保证fifo的原子性,避免数据冲突**。 23 | 24 | ## logger_command 25 | 26 | logger命令行模式,主要用于指令管理,对于每个模块使用不同的接口。 27 | 28 | ```shell 29 | #提交到GUI的命令 30 | !gui [command] 31 | 32 | #提交到local_device的命令 33 | !loc_dev [command] 34 | 35 | #提交到lower_device的命令 36 | !low_dev [command] 37 | 38 | #提交到main_process的命令 39 | !mp [command] 40 | ``` 41 | 42 | 对于每个设备的支持的命令格式如下。 43 | 44 | -------------------------------------------------------------------------------- /embed/logger_tool/include/productConfig.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // ProductConfig.hpp 7 | // 8 | // Purpose: 9 | // 包含应用配置信息的文件 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "global_def.hpp" 22 | 23 | #define LOGS_DIR "/home/sys/logger/test.txt" 24 | #define PROCESS_RUN PROCESS_LOGGER_TOOL 25 | #define TOOLS_NAME "logger_tool" 26 | #define PRINT_NOW_HEAD_STR "[0000 00:00:00][logger_tool][5]" 27 | -------------------------------------------------------------------------------- /embed/lower_device/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # THIS FILE IS BASIC MAKE FILE FOR 4 | # Copyright (c) 2020-2021 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | 9 | # This is object should be build and will link to generate 10 | # the executables 11 | BUILD=e 12 | 13 | CCFLAGS := -O3 -std=c++17 -fno-strict-aliasing -lrt 14 | 15 | cpp_objects = main.o \ 16 | serial.o \ 17 | asio_client.o \ 18 | module/cmd_process.o \ 19 | 20 | 21 | INCLUDES = -I include/ \ 22 | -I module/ 23 | 24 | INCLUDES += -I $(ENV_PATH_ROOT)/thirdparts/asio/include/ \ 25 | -I $(ENV_PATH_ROOT)/thirdparts/jsoncpp/include/ 26 | 27 | library = $(SUPPORT_ENV_INSTALL)/lib/libjsoncpp.a 28 | 29 | # This is the file name of the executables and path where 30 | # place the executables 31 | buildout = lower_device 32 | 33 | # Including this file allows access to the Build System. 34 | include $(ENV_PATH_ROOT)/embed/common/common.mk 35 | include $(ENV_PATH_ROOT)/build/buildrules.mk 36 | -------------------------------------------------------------------------------- /embed/lower_device/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/embed/lower_device/README.md -------------------------------------------------------------------------------- /embed/lower_device/include/productConfig.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // ProductConfig.hpp 7 | // 8 | // Purpose: 9 | // 包含应用配置信息的文件 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "global_def.hpp" 22 | 23 | #define PROCESS_RUN PROCESS_LOWER_DEVICE 24 | 25 | //------------------------- FIFO List ------------------------------ 26 | #define LOGGER_FIFO_PATH "/tmp/ld_logger.fifo" //logger服务模块 27 | 28 | //uart fifo 29 | #define SERVER_UART_RX_FIFO "/tmp/uart_rx.fifo" 30 | #define SERVER_UART_TX_FIFO "/tmp/uart_tx.fifo" 31 | 32 | #define ASIO_CLENET_FIFO "/tmp/ld_client_tx.fifo" 33 | 34 | //默认设备ID 35 | #define DEVICE_ID 0x01 36 | 37 | 38 | -------------------------------------------------------------------------------- /embed/lower_device/module/cmd_process.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // cmd_process.hpp 7 | // 8 | // Purpose: 9 | // 用于支持命令行处理的接口, 包含字符串处理和事件触发 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "common_unit.hpp" 22 | 23 | #define COMMAND_MAX_SIZE 4 24 | typedef enum 25 | { 26 | CmdGetOS, 27 | cmdGetHelp, 28 | }cmd_format_t; 29 | 30 | class cmd_process 31 | { 32 | public: 33 | /// \brief constructor 34 | cmd_process() = default; 35 | 36 | /// \brief init 37 | /// - This method is used to init the object. 38 | /// \return Wheather initialization is success or failed. 39 | bool init(); 40 | 41 | /// \brief parse_data 42 | /// - This method is used to parse the receive data and save format. 43 | /// \param ptr -- start of the point received for parse. 44 | /// \param size -- size of the point received for parse. 45 | /// \return Wheather parse is success or failed. 46 | bool parse_data(char *ptr, int size); 47 | 48 | /// \brief process_data 49 | /// - This method is used to process the data already parse. 50 | /// \return Wheather process is success or failed. 51 | bool process_data(); 52 | 53 | /// \brief get_format 54 | /// - This method is used to process the data already parse. 55 | /// \return Wheather process is success or failed. 56 | cmd_format_t get_format() { return cmd_format_; } 57 | 58 | private: 59 | /// \brief cmd_data_pointer_ 60 | /// - memory point the start to data area for received. 61 | char *cmd_data_pointer_; 62 | 63 | /// \brief cmd_format_ 64 | /// - command alread parse from the data receive. 65 | cmd_format_t cmd_format_; 66 | }; 67 | 68 | -------------------------------------------------------------------------------- /embed/main_process/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${workspaceFolder}/**" 7 | ], 8 | "defines": [ 9 | "_DEBUG", 10 | "UNICODE", 11 | "_UNICODE", 12 | "__ARM_PCS_VFP" 13 | ], 14 | "windowsSdkVersion": "8.1", 15 | "compilerPath": "/bin/gcc", 16 | "cStandard": "c11", 17 | "cppStandard": "c++17", 18 | "intelliSenseMode": "msvc-x64" 19 | } 20 | ], 21 | "version": 4 22 | } -------------------------------------------------------------------------------- /embed/main_process/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "cstddef": "cpp", 4 | "istream": "cpp", 5 | "ostream": "cpp", 6 | "ios": "cpp", 7 | "vector": "cpp", 8 | "xstring": "cpp", 9 | "thread": "cpp", 10 | "mutex": "cpp", 11 | "algorithm": "cpp", 12 | "array": "cpp", 13 | "atomic": "cpp", 14 | "cctype": "cpp", 15 | "chrono": "cpp", 16 | "clocale": "cpp", 17 | "cmath": "cpp", 18 | "condition_variable": "cpp", 19 | "cstdint": "cpp", 20 | "cstdio": "cpp", 21 | "cstdlib": "cpp", 22 | "cstring": "cpp", 23 | "ctime": "cpp", 24 | "cwchar": "cpp", 25 | "deque": "cpp", 26 | "exception": "cpp", 27 | "fstream": "cpp", 28 | "functional": "cpp", 29 | "initializer_list": "cpp", 30 | "iomanip": "cpp", 31 | "iosfwd": "cpp", 32 | "iostream": "cpp", 33 | "iterator": "cpp", 34 | "limits": "cpp", 35 | "map": "cpp", 36 | "memory": "cpp", 37 | "new": "cpp", 38 | "ratio": "cpp", 39 | "set": "cpp", 40 | "sstream": "cpp", 41 | "stack": "cpp", 42 | "stdexcept": "cpp", 43 | "streambuf": "cpp", 44 | "string": "cpp", 45 | "system_error": "cpp", 46 | "xthread": "cpp", 47 | "tuple": "cpp", 48 | "type_traits": "cpp", 49 | "typeinfo": "cpp", 50 | "utility": "cpp", 51 | "xfacet": "cpp", 52 | "xfunctional": "cpp", 53 | "xiosbase": "cpp", 54 | "xlocale": "cpp", 55 | "xlocinfo": "cpp", 56 | "xlocmon": "cpp", 57 | "xlocnum": "cpp", 58 | "xloctime": "cpp", 59 | "xmemory": "cpp", 60 | "xmemory0": "cpp", 61 | "xstddef": "cpp", 62 | "xtr1common": "cpp", 63 | "xtree": "cpp", 64 | "xutility": "cpp" 65 | } 66 | } -------------------------------------------------------------------------------- /embed/main_process/README.md: -------------------------------------------------------------------------------- 1 | # remote_manage 2 | 版本更新内容和计划详细见document/系统文件说明.xlsx中的Schedular目录. 3 | 4 | ## bug issue 5 | 1. 使用posix mq需要内核支持消息队列,错误处理Function no
6 | 让内核支持posix消息队列
7 | ```bash 8 | make menuconfig 9 | General setup
---> 10 |


[ ] POSIX Message Queues
-> [*] POSIX Message Queues 11 | ``` 12 | 2. insmod:disagrees about version of symbol module_layout
13 | 内核版本和模块版本不一致
14 | 重新编译内核后,需要重新编译模块
15 | 下位机的具体实现,目前功能:
16 | 1.LED,BEEP,复位的远程控制
17 | 2.UART的远程协议控制,支持不同硬件的扩展(参考Uart实现)
18 | 3.Socket(TCP)的远程协议控制
19 | 4.基于json格式的初始化配置
20 | 21 | 代码结构:
22 | driver/

硬件驱动的实现
23 | include/

头文件路径
24 | lib/



应用编写需要的外部支持库
25 | source/

应用代码实现
26 | template/
代码结构基础模板
-------------------------------------------------------------------------------- /embed/main_process/include/productConfig.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // ProductConfig.hpp 7 | // 8 | // Purpose: 9 | // 包含应用配置信息的文件 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "global_def.hpp" 22 | 23 | #define PROCESS_RUN PROCESS_MAIN_PROCESS 24 | #define TOOLS_NAME "main_process" 25 | #define PRINT_NOW_HEAD_STR "[0000 00:00:00][main_process][5]" 26 | 27 | //------------------------- FIFO List ------------------------------ 28 | #define DEVICE_MESSAGE_FIFO "/tmp/device_manage.fifo" //设备管理模块 29 | #define CENTER_UNIT_FIFO "/tmp/center_manage.fifo" 30 | 31 | //socket fifo 32 | #define SOCKET_TCP_RX_FIFO "/tmp/socket_rx.fifo" 33 | #define SOCKET_TCP_TX_FIFO "/tmp/socket_tx.fifo" 34 | 35 | //uart fifo 36 | #define SERVER_UART_RX_FIFO "/tmp/uart_rx.fifo" 37 | #define SERVER_UART_TX_FIFO "/tmp/uart_tx.fifo" 38 | 39 | //默认设备ID 40 | #define DEVICE_ID 0x01 41 | -------------------------------------------------------------------------------- /embed/main_process/lower_app.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "settings": { 8 | "files.associations": { 9 | "iostream": "cpp", 10 | "iosfwd": "cpp", 11 | "fstream": "cpp", 12 | "xstring": "cpp", 13 | "algorithm": "cpp", 14 | "array": "cpp", 15 | "cctype": "cpp", 16 | "clocale": "cpp", 17 | "cmath": "cpp", 18 | "cstddef": "cpp", 19 | "cstdint": "cpp", 20 | "cstdio": "cpp", 21 | "cstdlib": "cpp", 22 | "cstring": "cpp", 23 | "ctime": "cpp", 24 | "cwchar": "cpp", 25 | "deque": "cpp", 26 | "exception": "cpp", 27 | "initializer_list": "cpp", 28 | "iomanip": "cpp", 29 | "ios": "cpp", 30 | "istream": "cpp", 31 | "iterator": "cpp", 32 | "limits": "cpp", 33 | "map": "cpp", 34 | "memory": "cpp", 35 | "new": "cpp", 36 | "ostream": "cpp", 37 | "set": "cpp", 38 | "sstream": "cpp", 39 | "stack": "cpp", 40 | "stdexcept": "cpp", 41 | "streambuf": "cpp", 42 | "string": "cpp", 43 | "system_error": "cpp", 44 | "tuple": "cpp", 45 | "type_traits": "cpp", 46 | "typeinfo": "cpp", 47 | "utility": "cpp", 48 | "vector": "cpp", 49 | "xfacet": "cpp", 50 | "xiosbase": "cpp", 51 | "xlocale": "cpp", 52 | "xlocinfo": "cpp", 53 | "xlocmon": "cpp", 54 | "xlocnum": "cpp", 55 | "xloctime": "cpp", 56 | "xmemory": "cpp", 57 | "xmemory0": "cpp", 58 | "xstddef": "cpp", 59 | "xtr1common": "cpp", 60 | "xtree": "cpp", 61 | "xutility": "cpp" 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /embed/main_process/mb/functions/mbfuncdiag.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. 3 | * Copyright (c) 2006-2018 Christian Walter 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | -------------------------------------------------------------------------------- /embed/main_process/mb/mb_app.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2023-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // mb_app.h 7 | // 8 | // Purpose: 9 | // interface for process modbus protocol task. 10 | // 11 | // Author: 12 | // @zc 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "common.hpp" 22 | 23 | class mb_app_manage 24 | { 25 | public: 26 | /// \brief constructor 27 | mb_app_manage() = default; 28 | 29 | /// \brief destructor, delete not allow for singleton pattern. 30 | ~mb_app_manage() = delete; 31 | 32 | /// \brief get_instance 33 | /// - This method is used to get the pattern of the class. 34 | /// \return the singleton pattern point of the object. 35 | static mb_app_manage* get_instance(); 36 | 37 | /// \brief init 38 | /// - This method is used to init the object. 39 | /// \return Wheather initialization is success or failed. 40 | bool init(); 41 | 42 | private: 43 | /// \brief mb_workflow_run 44 | /// - server thread to process tcp received, tranform to rx fifo. 45 | void mb_workflow_run(); 46 | 47 | private: 48 | /// \brief instance_pointer_ 49 | /// - object used to implement the singleton pattern. 50 | static mb_app_manage* instance_pointer_; 51 | 52 | /// \brief tcp_server_thread_ 53 | /// - tcp server thread object. 54 | std::thread mb_workflow_thread_; 55 | }; -------------------------------------------------------------------------------- /embed/main_process/mb/port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: BARE Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id$ 20 | */ 21 | 22 | #ifndef _PORT_H 23 | #define _PORT_H 24 | 25 | #include 26 | #include 27 | 28 | #define INLINE 29 | #define PR_BEGIN_EXTERN_C extern "C" { 30 | #define PR_END_EXTERN_C } 31 | 32 | #define ENTER_CRITICAL_SECTION( ) EnterCriticalSection( ) 33 | #define EXIT_CRITICAL_SECTION( ) ExitCriticalSection( ) 34 | 35 | #define CCLK 60000000L 36 | #define PCLK CCLK/4 37 | 38 | #ifdef __cplusplus 39 | PR_BEGIN_EXTERN_C 40 | #endif 41 | 42 | void EnterCriticalSection( void ); 43 | void ExitCriticalSection( void ); 44 | 45 | #ifdef __cplusplus 46 | PR_END_EXTERN_C 47 | #endif 48 | 49 | typedef uint8_t BOOL; 50 | 51 | typedef unsigned char UCHAR; 52 | typedef char CHAR; 53 | 54 | typedef uint16_t USHORT; 55 | typedef int16_t SHORT; 56 | 57 | typedef uint32_t ULONG; 58 | typedef int32_t LONG; 59 | 60 | #ifndef TRUE 61 | #define TRUE 1 62 | #endif 63 | 64 | #ifndef FALSE 65 | #define FALSE 0 66 | #endif 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /embed/main_process/mb/rtu/mbcrc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. 3 | * Copyright (c) 2006-2018 Christian Walter 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef _MB_CRC_H 31 | #define _MB_CRC_H 32 | 33 | USHORT usMBCRC16( UCHAR * pucFrame, USHORT usLen ); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /embed/main_process/mqtt/mqtt_protocol.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // mqtt_protocol.hpp 7 | // 8 | // Purpose: 9 | // mqtt receive decode 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/19/2022 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | _Pragma("once") 20 | 21 | #include "mqtt_process.hpp" 22 | #include "cmd_process.hpp" 23 | 24 | class mqtt_protocol 25 | { 26 | public: 27 | /// \brief constructor 28 | mqtt_protocol() = default; 29 | mqtt_protocol(const mqtt_protocol&)=delete; 30 | 31 | /// - destructor, delete not allow for singleton pattern. 32 | virtual ~mqtt_protocol() = delete; 33 | 34 | /// \brief get_instance 35 | /// - This method is used to get the pattern of the class. 36 | /// \return the singleton pattern point of the object. 37 | static mqtt_protocol* get_instance(); 38 | 39 | /// \brief parse_data 40 | /// - This method is used to decode command received. 41 | /// \return Wheather parse is success or failed. 42 | bool decode_json_command(char *ptr, int size); 43 | 44 | /// \brief parse_data 45 | /// - This method is used to send message. 46 | void send_message(int source, const std::string& str); 47 | 48 | private: 49 | const std::string& get_topic(int source); 50 | 51 | const int get_qos(int source); 52 | 53 | private: 54 | /// \brief instance_pointer_ 55 | /// - object used to implement the singleton pattern. 56 | static mqtt_protocol* instance_pointer_; 57 | }; -------------------------------------------------------------------------------- /embed/main_process/shutdown: -------------------------------------------------------------------------------- 1 | kill -9 $(pidof app_demo) -------------------------------------------------------------------------------- /embed/node_server/README.md: -------------------------------------------------------------------------------- 1 | # remote_manage 2 | 3 | ## web服务应用的实现 4 | ### 安装node到嵌入式平台 5 | web应用服务主要包含后端应用和前端界面实现.
6 | 后端应用基于node.js的服务器应用,由两部分组成.
7 | 1.作为客户端维持和设备管理模块的可靠连接(TCP+心跳包).
8 | 2.支持服务端允许前端界面获取信息刷新(短连接,请求刷新).
9 | 前端主要是包含控制和显示的管理界面,计划采用vue实现.
10 | 支持嵌入式平台运行的node可通过在嵌入式平台执行如下命令下载,如我使用的是13.14版本,命令如下.
11 | ```bash 12 | wget https://nodejs.org/dist/latest-v13.x/node-v13.14.0-linux-armv7l.tar.gz 13 | tar -xvf node-v13.14.0-linux-armv7l.tar.gz 14 | ln -sf [install]/bin/node /usr/bin/node 15 | node -v 16 | ``` 17 | 如果能够正常显示版本信息,表示node安装成功.
18 | 19 | ### 启动服务器 20 | 如果在PC平台测试,直接在lower_app/server目录下,执行.
21 | ```bash 22 | node server.js 23 | ``` 24 | 如果显示如下.
25 | ``` 26 | node server start! 27 | server listen ip:127.0.0.1, port 15,060 28 | ``` 29 | 则表示启动成功,此时通过在浏览器输入127.0.0.1:15060访问页面.
30 | 在嵌入式linux平台,需要将config.json中的ip地址修改为嵌入式平台ip地址,在通过上诉命令测试.
-------------------------------------------------------------------------------- /embed/node_server/config_json.js: -------------------------------------------------------------------------------- 1 | /* 2 | 配置文件解析,提前信息包含 3 | 1.本地服务器地址 4 | */ 5 | //global require 6 | const fs = require('fs') 7 | const os = require('os') 8 | 9 | let config_info = { 10 | //文件版本信息 11 | version: "0.0.0.0", 12 | 13 | //ip地址 14 | ipaddress: "0.0.0.0", 15 | 16 | //web端口地址 17 | web_port:0, 18 | 19 | //mqtt信息 20 | mqtt_device: { 21 | id : "", 22 | port : 0, 23 | sub_topic : "", 24 | pub_topic : "", 25 | keepalive : 0, 26 | qos: 0 27 | } 28 | }; 29 | 30 | function load_config_file(filePath) 31 | { 32 | try 33 | { 34 | let resdata = fs.readFileSync(filePath).toString(); 35 | let jsonValue = JSON.parse(resdata); 36 | 37 | config_info.version = jsonValue.version; 38 | config_info.ipaddress = jsonValue.ipaddress; 39 | config_info.web_port = jsonValue.node_server.web_port; 40 | 41 | for (let key in config_info.mqtt_device) { 42 | if (key in jsonValue.node_server.mqtt_device){ 43 | config_info.mqtt_device[key] = jsonValue.node_server.mqtt_device[key]; 44 | } 45 | } 46 | } 47 | catch(err) 48 | { 49 | console.log(err); 50 | return false; 51 | } 52 | 53 | console.log(config_info); 54 | return true; 55 | } 56 | 57 | module.exports.load_config_file = load_config_file; 58 | module.exports.config_info = config_info; -------------------------------------------------------------------------------- /embed/node_server/dynamic_engine.js: -------------------------------------------------------------------------------- 1 | /* 2 | 动态引擎处理 3 | 对于界面提交的命令, 进行解析并处理 4 | 5 | */ 6 | const url = require('url'); 7 | const { stat } = require('fs'); 8 | const mqtt_run = require('./mqtt_run') 9 | 10 | function device_set_process(query) 11 | { 12 | let group = query.split('&'); 13 | let dev = group[0].split('=')[1]; 14 | let status = group[1].split('=')[1]; 15 | let dev_num = 0; 16 | let dev_status = 0; 17 | 18 | if (dev.toLowerCase() === 'led') 19 | { 20 | dev_num = 0; 21 | if (status.toLowerCase() == 'off') 22 | dev_status = 0; 23 | else if (status.toLowerCase() == 'on') 24 | dev_status = 1; 25 | else 26 | return false; 27 | } 28 | else if (dev.toLowerCase() === 'beep') 29 | { 30 | dev_num = 1; 31 | if (status.toLowerCase() == 'off') 32 | dev_status = 0; 33 | else if (status.toLowerCase() == 'on') 34 | dev_status = 1; 35 | else 36 | return false; 37 | } 38 | else 39 | return false; 40 | 41 | let outStr = `!setdev ${dev_num},${dev_status}\n`; 42 | 43 | return false; 44 | } 45 | 46 | function dynamic_engine_process(request, response) 47 | { 48 | let Query = url.parse(request.url); 49 | let is_process_ok = false; 50 | 51 | if (Query.pathname) 52 | { 53 | let action = Query.pathname.slice(1); 54 | //console.log(action + " " + Query.query); 55 | response.setHeader('Content-Type', 'application/json;charset=utf-8'); 56 | switch (action) 57 | { 58 | case 'axiosDeviceSet': 59 | is_process_ok = device_set_process(Query.query); 60 | response.end("ack " + (is_process_ok?"ok":"false")); 61 | break; 62 | case 'axiosDeviceGet': 63 | let devInfo = mqtt_run.subscribe_info 64 | console.log(devInfo) 65 | response.end(JSON.stringify(devInfo)) 66 | break; 67 | default: 68 | break; 69 | } 70 | } 71 | 72 | 73 | } 74 | 75 | module.exports.dynamic_engine_process = dynamic_engine_process; -------------------------------------------------------------------------------- /embed/node_server/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | 基于node实现的web服务器,具体功能 3 | 1.解析json配置文件,用于ip地址和端口定义 4 | 2.web服务器,支持静态文件读取和动态处理 5 | 3.基于TCP的socket,和C++的axios服务器通讯 6 | */ 7 | //node module 8 | const http = require('http'); 9 | const fs = require('fs') 10 | 11 | //user module 12 | const config_json = require('./config_json.js') 13 | const mqtt_run = require('./mqtt_run.js'); 14 | const static_engine = require('./static_engine.js'); 15 | const dynamic_engine = require('./dynamic_engine.js'); 16 | 17 | //global parameter 18 | const filepath = "/home/sys/configs/config.json"; 19 | let server = http.createServer(); 20 | 21 | function server_process() 22 | { 23 | server.on('request', function (request, response) { 24 | if (static_engine.engine_process(request, response)){ 25 | //console.log("static engine process success!"); 26 | } 27 | else{ 28 | dynamic_engine.dynamic_engine_process(request, response); 29 | } 30 | }); 31 | 32 | //建立web服务器, 支持动态和静态处理 33 | //访问的界面文件在webpage/目录下 34 | server.listen(config_json.config_info.web_port, config_json.config_info.ipaddress, function (err) { 35 | if (err) throw err; 36 | console.log(`server start ok, server ip: ${config_json.config_info.ipaddress}:${config_json.config_info.web_port}`); 37 | }); 38 | 39 | mqtt_run.init(); 40 | } 41 | 42 | function start_server() 43 | { 44 | if (config_json.load_config_file(filepath)) 45 | { 46 | console.log("config load success, server start!") 47 | server_process(); 48 | } 49 | else 50 | { 51 | console.log("config load file, please check!") 52 | } 53 | } 54 | 55 | start_server(); 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /embed/node_server/mqtt_run.js: -------------------------------------------------------------------------------- 1 | 2 | //node module 3 | const mqtt = require('mqtt') 4 | 5 | //user module 6 | const { config_info } = require('./config_json.js') 7 | 8 | let subscribe_info = { 9 | command: 1, 10 | data: { 11 | angle: 0, 12 | ap: { als: 0, ir: 0, ps: 0 }, 13 | beep: 0, 14 | hx711: 0, 15 | icm: { 16 | accel_x: 0, 17 | accel_y: 0, 18 | accel_z: 0, 19 | gyro_x: 0, 20 | gyro_y: 0, 21 | gyro_z: 0, 22 | temp_act: 0 23 | }, 24 | led: 0, 25 | sysinfo: { 26 | cpu_info: '', 27 | disk_total: 0, 28 | disk_used: 0, 29 | kernel_info: '', 30 | ram_total: 0, 31 | ram_used: 0 32 | }, 33 | vf610_adc: 0 34 | } 35 | }; 36 | 37 | function init() 38 | { 39 | try 40 | { 41 | let mqtt_addr = `mqtt://${config_info.ipaddress}:${config_info.mqtt_device.port}`; 42 | console.log(mqtt_addr) 43 | 44 | let client = mqtt.connect(mqtt_addr, { 45 | clientId: config_info.mqtt_device.id 46 | }); 47 | 48 | client.on('connect', function(){ 49 | console.log('Connected to MQTT broker') 50 | client.subscribe(config_info.mqtt_device.sub_topic, {qos: 1}); 51 | }); 52 | 53 | client.on('message', function (topic, message) { 54 | const json_obj = JSON.parse(message.toString()) 55 | console.log(json_obj) 56 | for (let key in json_obj){ 57 | if (subscribe_info.hasOwnProperty(key)){ 58 | subscribe_info[key] = json_obj[key] 59 | } 60 | } 61 | }) 62 | } 63 | catch(e) 64 | { 65 | console.log(e); 66 | } 67 | } 68 | 69 | //export var and function 70 | module.exports.init = init 71 | module.exports.subscribe_info = subscribe_info -------------------------------------------------------------------------------- /embed/node_server/static_engine.js: -------------------------------------------------------------------------------- 1 | 2 | //modules 3 | const fs = require('fs'); 4 | const _a = require('path'), extname = _a.extname, join = _a.join; 5 | 6 | //user modules 7 | const _tools = require('./tool.js'); 8 | 9 | var contentTypeStatic = { 10 | "html": "text/html", 11 | "xml": "text/xml", 12 | "asp": "text/asp", 13 | "css": "text/css", 14 | "jpg": "image/jpeg", 15 | "png": "image/png", 16 | "ico": "image/icon", 17 | "js": "application/x-javascript", 18 | "map": "text/map" 19 | }; 20 | 21 | function engine_process(request, response) 22 | { 23 | var pathname = request.url; 24 | if (pathname === '/'){ 25 | pathname = 'index.html' 26 | } 27 | 28 | var localpath = "".concat(__dirname, "/webpage/"); 29 | var filepath = join(localpath, pathname); 30 | var ext = extname(filepath).slice(1); 31 | 32 | //static document process 33 | if (_tools.hasOwnKey(contentTypeStatic, ext)) 34 | { 35 | //static data struct 36 | response.setHeader('content-type', contentTypeStatic[ext]); 37 | response.setHeader('server', 'node'); 38 | if (fs.existsSync(filepath)) 39 | { 40 | var FileData = fs.readFileSync(filepath); 41 | response.end(FileData); 42 | } 43 | else 44 | { 45 | console.log(`invalid pathname:${pathname}`); 46 | response.statusCode = 404; 47 | response.end("404 not found"); 48 | } 49 | return true; 50 | } 51 | else 52 | { 53 | //console.log("Not Static Request"); 54 | } 55 | 56 | return false; 57 | } 58 | 59 | module.exports.engine_process = engine_process; 60 | -------------------------------------------------------------------------------- /embed/node_server/tool.js: -------------------------------------------------------------------------------- 1 | 2 | function hasOwnKey(obj, key) { 3 | return (key in obj); 4 | } 5 | 6 | module.exports.hasOwnKey = hasOwnKey; -------------------------------------------------------------------------------- /embed/node_server/webpage/css/global.css: -------------------------------------------------------------------------------- 1 | html body{ 2 | position: relative; 3 | background-color:rgb(255, 255, 255); 4 | color:black; 5 | margin:0px; 6 | padding: 0px; 7 | height: 100%; 8 | min-width: 1000px; 9 | } 10 | 11 | .segregate{ 12 | margin-top:20px; 13 | padding-left:40px; 14 | width:600px; 15 | height: 250px; 16 | font-size: 14px; 17 | } 18 | 19 | .btnCss{ 20 | justify-content: center; 21 | align-items: center; 22 | 23 | box-sizing: border-box; 24 | width: 85px; 25 | height: 20px; 26 | 27 | text-decoration: none; 28 | border: solid 1px #000; 29 | border-radius: 6px; 30 | background: #d8da7d; 31 | } 32 | 33 | .menu{ 34 | border-top-right-radius: 15px; 35 | border-top-left-radius:15px; 36 | float: left; 37 | background: transparent none repeat scroll 0% 0%; 38 | color: #000; 39 | font-family: verdana,arial,sans-serif; 40 | font-size: 13px; 41 | margin-top: 20px; 42 | height: 20px; 43 | padding-top: 5px; 44 | margin-left:2px; 45 | display: inline; 46 | width:80px; 47 | text-align: center; 48 | background-color: #DFDFDF; 49 | } 50 | 51 | [v-cloak]{ 52 | display:none; 53 | } 54 | 55 | .tableList{ 56 | border-width: 1px; 57 | padding: 0px; 58 | margin: 0px; 59 | border-spacing: 4px; 60 | } 61 | 62 | #menu_block{ 63 | height:45px; 64 | border-style: none; 65 | border-bottom: 3px solid #28aaa4; 66 | } 67 | 68 | #info_block{ 69 | position: absolute; 70 | top:50px; 71 | bottom:0px; 72 | width:75%; 73 | } -------------------------------------------------------------------------------- /embed/node_server/webpage/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/embed/node_server/webpage/favicon.ico -------------------------------------------------------------------------------- /embed/test/test.c: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2022-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // device_info.c 7 | // 8 | // Purpose: 9 | // get the linux device information. 10 | // 11 | // Author: 12 | // @听心跳的声音 13 | // 14 | // Assumptions: 15 | // 16 | // Revision History: 17 | // 12/21/2023 Create New Version 18 | ///////////////////////////////////////////////////////////////////////////// 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | void data_test(void); 34 | 35 | #define PATH "test_file" 36 | int main(int argc, char **argv) 37 | { 38 | FILE *file; 39 | int len; 40 | char buffer[32]; 41 | 42 | data_test(); 43 | 44 | file = fopen(PATH, "r"); 45 | if (!file){ 46 | return -1; 47 | } 48 | 49 | len = fread(buffer, 1, sizeof(buffer), file); 50 | if (len > 0) 51 | { 52 | buffer[len] = '\0'; 53 | printf("read file:%s, size:%d\n", buffer, len); 54 | } 55 | 56 | fclose(file); 57 | return 0; 58 | } 59 | 60 | typedef union 61 | { 62 | int i_val; 63 | 64 | float f_val; 65 | 66 | uint8_t buffer[4]; 67 | }UNION_VAL; 68 | 69 | void data_test(void) 70 | { 71 | UNION_VAL v1[4], v2[4]; 72 | char buf[40]; 73 | size_t size = 0; 74 | 75 | v1[0].f_val = 2.5; 76 | v1[1].f_val = 1.4; 77 | v1[2].f_val = 1.8; 78 | v1[3].f_val = 4.6; 79 | 80 | for (int i=0; i<4; i++) 81 | { 82 | memcpy(&buf[size], v1[i].buffer, 4); 83 | size += 4; 84 | } 85 | 86 | size = 0; 87 | for (int i=0; i<4; i++) 88 | { 89 | memcpy(v2[i].buffer, &buf[size], 4); 90 | size += 4; 91 | } 92 | 93 | printf("v2:%f,%f\n", v2[0].f_val, v2[1].f_val); 94 | } -------------------------------------------------------------------------------- /env/EnvConfig.mk: -------------------------------------------------------------------------------- 1 | ARM 2 | 1.0.0.8 3 | buildroot 4 | -------------------------------------------------------------------------------- /mod/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${env.includePath}", 7 | "${workspaceFolder}/**" 8 | ], 9 | "defines": [ 10 | "_DEBUG", 11 | "_UNICODE", 12 | "__ARM_PCS_VFP", 13 | "CONFIG_SPARSE_IRQ", 14 | "CONFIG_GPIOLIB", 15 | "CONFIG_OF=1", 16 | "_GNU_SOURCE", 17 | "__GNUC__", 18 | "_SIGNAL_H", 19 | "MODULE", 20 | "CONFIG_I2C", 21 | "__KERNEL__" 22 | ], 23 | "compilerPath": "C:\\Keil_v5\\ARM\\ARMCC\\bin\\armcc.exe", 24 | "cStandard": "c11", 25 | "cppStandard": "c++20", 26 | "intelliSenseMode": "gcc-x86", 27 | "compilerArgs": [ 28 | "-m32" 29 | ] 30 | } 31 | ], 32 | "version": 4 33 | } -------------------------------------------------------------------------------- /mod/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "optional": "c", 4 | "istream": "c", 5 | "ostream": "c", 6 | "system_error": "c", 7 | "array": "c", 8 | "functional": "c", 9 | "tuple": "c", 10 | "type_traits": "c", 11 | "utility": "c", 12 | "*.tcc": "c" 13 | }, 14 | "C_Cpp.dimInactiveRegions": true 15 | } -------------------------------------------------------------------------------- /mod/01.led/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_led.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/01.led/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = led_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = led_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/01.led/test/led_test.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2024-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // led_test.c 7 | // 8 | // Purpose: 9 | // LED应用层控制。 10 | // 设备文件: /dev/led 11 | // 配置pinctrl文件: /sys/devices/platform/20c406c.usr_led/pinctrl-led 12 | // 类管理文件: /sys/class/leds/led0/brightness 13 | // 14 | // Author: 15 | // @听心跳的声音 16 | // 17 | // Assumptions: 18 | // 19 | // Revision History: 20 | // 12/19/2022 Create New Version. 21 | // 23/08/202 Format update. 22 | ///////////////////////////////////////////////////////////////////////////// 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #define LED_DEVICE "/dev/led" 29 | 30 | int main(int argc, const char *argv[]) 31 | { 32 | unsigned char val = 1; 33 | int fd; 34 | 35 | fd = open(LED_DEVICE, O_RDWR | O_NDELAY); 36 | if (fd == -1) { 37 | printf("%s open error!\n", LED_DEVICE); 38 | exit(1); 39 | } 40 | 41 | if (argc > 1) { 42 | val = atoi(argv[1]); 43 | } 44 | 45 | write(fd, &val, 1); 46 | 47 | close(fd); 48 | 49 | exit(0); 50 | } 51 | -------------------------------------------------------------------------------- /mod/02.loopled/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_loopled.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/02.loopled/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = loopled_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = loopled_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/02.loopled/test/loopled_test.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2024-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // loopled_test.c 7 | // 8 | // Purpose: 9 | // LED红绿灯带应用层控制。 10 | // 设备文件: /dev/loopled 11 | // 12 | // Author: 13 | // @听心跳的声音 14 | // 15 | // Assumptions: 16 | // 17 | // Revision History: 18 | // 12/19/2022 Create New Version. 19 | // 23/08/202 Format update. 20 | ///////////////////////////////////////////////////////////////////////////// 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #define LOOP_LED_DEVICE "/dev/loopled" 27 | #define LOOP_LED_NUM 3 28 | 29 | /** 30 | * 测试LED工作 31 | * 32 | * @param NULL 33 | * 34 | * @return NULL 35 | */ 36 | int main(int argc, const char *argv[]) 37 | { 38 | unsigned char val[2]; 39 | unsigned char index, on_num = 0; 40 | int fd; 41 | int time_loop = 2; 42 | 43 | fd = open(LOOP_LED_DEVICE, O_RDWR | O_NDELAY); 44 | if (fd == -1) { 45 | printf("%s open failed!\n", LOOP_LED_DEVICE); 46 | return -1; 47 | } 48 | 49 | if (argc > 1) { 50 | time_loop = atoi(argv[1]); 51 | } 52 | 53 | while (1) { 54 | for (index=0; index 11 | #include 12 | #include 13 | #include 14 | 15 | #define DEVICE_BEEP "/dev/miscbeep" 16 | /** 17 | * 测试LED工作 18 | * 19 | * @param NULL 20 | * 21 | * @return NULL 22 | */ 23 | int main(int argc, const char *argv[]) 24 | { 25 | unsigned char val = 1; 26 | int fd; 27 | 28 | fd = open(DEVICE_BEEP, O_RDWR | O_NDELAY); 29 | if (fd == -1) { 30 | printf("open %s error\r\n", DEVICE_BEEP); 31 | return -1; 32 | } 33 | 34 | if (argc > 1) { 35 | val = atoi(argv[1]); 36 | } 37 | 38 | write(fd, &val, 1); 39 | 40 | close(fd); 41 | 42 | exit(0); 43 | } 44 | -------------------------------------------------------------------------------- /mod/04.i2c_ap/bus_i2c/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_bus_i2c.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/04.i2c_ap/regmap_i2c/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_regmap_i2c.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/04.i2c_ap/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = ap_i2c_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = ap_i2c_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/04.i2c_ap/test/ap_i2c_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File : ap_i2c_test.c 3 | * test for ap i2c driver. 4 | * COPYRIGHT (C) 2023, zc 5 | * 6 | * Change Logs: 7 | * Date Author Notes 8 | * 2023-11-22 zc the first version 9 | */ 10 | #include 11 | #include 12 | #include 13 | 14 | #define I2C_DRIVER_NAME "/dev/ap3216" 15 | 16 | int main(int argc, char *argv[]) 17 | { 18 | int fd; 19 | unsigned short databuf[3]; 20 | unsigned short ir, als, ps; 21 | int nSize = 0; 22 | 23 | fd = open(I2C_DRIVER_NAME, O_RDWR); 24 | if (fd < 0) 25 | { 26 | printf("can't open file %s\r\n", I2C_DRIVER_NAME); 27 | return -1; 28 | } 29 | 30 | while (1) 31 | { 32 | nSize = read(fd, databuf, sizeof(databuf)); 33 | if (nSize >= 0) 34 | { 35 | ir = databuf[0]; /* ir传感器数据 */ 36 | als = databuf[1]; /* als传感器数据 */ 37 | ps = databuf[2]; /* ps传感器数据 */ 38 | printf("read size:%d\r\n", nSize); 39 | printf("ir = %d, als = %d, ps = %d\r\n", ir, als, ps); 40 | } 41 | usleep(200000); /*100ms */ 42 | } 43 | 44 | close(fd); 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /mod/05.spi_icm/README.md: -------------------------------------------------------------------------------- 1 | # remote_manage 2 | 3 | SPI驱动的实现包含三部分 4 | 1.设备树的添加,修改 5 | 注:设备树文件为kernal/dts/imx6ull-14x14-evk.dts 6 | 添加设备树与SPI3相关的引脚说明到iomuxc/imx6ul-evk下 7 | pinctrl_ecspi3: ecspi3grp { 8 | fsl,pins = < 9 | MX6UL_PAD_UART2_RTS_B__ECSPI3_MISO 0x100b1 /* MISO*/ 10 | MX6UL_PAD_UART2_CTS_B__ECSPI3_MOSI 0x100b1 /* MOSI*/ 11 | MX6UL_PAD_UART2_RX_DATA__ECSPI3_SCLK 0x100b1 /* CLK*/ 12 | MX6UL_PAD_UART2_TX_DATA__GPIO1_IO20 0x100b0 /* CS*/ 13 | >; 14 | }; 15 | 在最外面添加或者完善节点ecspi3 16 | &ecspi3 { 17 | fsl,spi-num-chipselects = <1>; 18 | cs-gpio = <&gpio1 20 GPIO_ACTIVE_LOW>; 19 | pinctrl-names = "default"; 20 | pinctrl-0 = <&pinctrl_ecspi3>; 21 | status = "okay"; 22 | 23 | spidev: icm20608@0 { 24 | compatible = "alientek,icm20608"; 25 | spi-max-frequency = <8000000>; 26 | reg = <0>; 27 | }; 28 | }; 29 | 重新编译设备树,即完成了设备树的修改。 30 | 执行make dtbs,获得修改后的设备树 31 | 32 | 2. 在kernal_mod/spi_icm/路径下执行make指令,获取模块kernal_spi_icm.ko(firmware下有已经编译完成的固件) 33 | 34 | 3. 将模块传输到嵌入式Linux平台,执行insmod kernal_spi_icm.ko指令,此时在/dev/路径下就添加了icm20608设备,后续即可实现传感器应用 35 | 36 | -------------------------------------------------------------------------------- /mod/05.spi_icm/bus_spi/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_bus_spi.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/05.spi_icm/regmap_spi/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_regmap_spi.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/05.spi_icm/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = icm_spi_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = icm_spi_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/06.key/key_async/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_key_async.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/06.key/key_async/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = key_async_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = key_async_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/06.key/key_async/test/key_async_test.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2024-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // key_async_test.cpp 7 | // GPIO1_18 8 | // 9 | // Purpose: 10 | // 测试按键输入 11 | // 12 | // Author: 13 | // @听心跳的声音 14 | // 15 | // Assumptions: 16 | // 17 | // Revision History: 18 | // 4/3/2022 Create New Version 19 | ///////////////////////////////////////////////////////////////////////////// 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | static int fd; 30 | 31 | #define KEY_DEV_NAME "/dev/key" 32 | 33 | static void sigio_signal_func(int signum) 34 | { 35 | unsigned int key_val = 0; 36 | 37 | read(fd, &key_val, sizeof(unsigned int)); 38 | if (0 == key_val) 39 | printf("Key Press\n"); 40 | else if (1 == key_val) 41 | printf("Key Release\n"); 42 | } 43 | 44 | int main(int argc, char *argv[]) 45 | { 46 | int flags = 0; 47 | 48 | fd = open(KEY_DEV_NAME, O_RDONLY | O_NONBLOCK); 49 | if (0 > fd) { 50 | printf("ERROR: %s file open failed!\n", KEY_DEV_NAME); 51 | return -1; 52 | } 53 | 54 | signal(SIGIO, sigio_signal_func); 55 | fcntl(fd, F_SETOWN, getpid()); 56 | flags = fcntl(fd, F_GETFD); 57 | fcntl(fd, F_SETFL, flags | FASYNC); 58 | 59 | for (;;) { 60 | sleep(2); 61 | } 62 | 63 | close(fd); 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /mod/06.key/key_input/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_input.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/06.key/key_input/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = key_input_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = key_input_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/06.key/key_rwio/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_key_rwio.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/06.key/key_rwio/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = key_rwio_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = key_rwio_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/07.adc/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_iio_adc.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/07.adc/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = iio_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = iio_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/07.adc/test/iio_test.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2024-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // iio_test.c 7 | // 8 | // Purpose: 9 | // 读取iio设备目录下的文件,对应文件 10 | // /sys/bus/iio/devices/iio:device0/in_voltage%d_raw 11 | // GPIO_1_2 - CSI_RESET 12 | // GPIO_1_4 - CSI_PWDN 13 | // 14 | // Author: 15 | // @听心跳的声音 16 | // 17 | // Assumptions: 18 | // 19 | // Revision History: 20 | // 12/19/2022 Create New Version. 21 | // 14/02/2025 Format update. 22 | ///////////////////////////////////////////////////////////////////////////// 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #define DEFAILT_RAW_NUM 2 30 | #define IIO_CHANNEL_FILE "/sys/bus/iio/devices/iio:device0/in_voltage%d_raw" 31 | 32 | int file_data_read(char *filename, char *str, size_t size) 33 | { 34 | int ret = 0; 35 | FILE *file; 36 | 37 | file = fopen(filename, "r"); /* 只读打开 */ 38 | if (file == NULL) { 39 | printf("can't open file %s\r\n", filename); 40 | return -1; 41 | } 42 | 43 | ret = fread(str, 1, size, file); 44 | if (ret < 0) { 45 | return ret; 46 | } 47 | 48 | fseek(file, 0, SEEK_SET); 49 | fclose(file); 50 | 51 | return 0; 52 | } 53 | 54 | int main(int argc, const char *argv[]) 55 | { 56 | int ret; 57 | int value; 58 | char str[50], filepath[50]; 59 | int val = DEFAILT_RAW_NUM; 60 | 61 | if (argc > 1) { 62 | val = atoi(argv[1]); 63 | } 64 | 65 | sprintf(filepath, IIO_CHANNEL_FILE, val); 66 | 67 | while (1) { 68 | 69 | ret = file_data_read(filepath, str, sizeof(str)); 70 | if (ret == 0) { 71 | value = atoi(str); 72 | printf("read_adc vol:%d, voltage:%3f\n", value, (float)value/4096*3.3); 73 | } else { 74 | printf("read failed, error flag:%d", ret); 75 | } 76 | 77 | sleep(1); 78 | } 79 | 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /mod/08.wire/dev_hx711/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_dev_hx711.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/08.wire/dev_hx711/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = hx711_dev_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = hx711_dev_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/08.wire/dev_hx711/test/hx711_dev_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File : hx711_test.c 3 | * test for key driver. 4 | * COPYRIGHT (C) 2023, zc 5 | * 6 | * Change Logs: 7 | * Date Author Notes 8 | * 2023-11-22 zc the first version 9 | */ 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define HX711_DEVICE_NAME "/dev/hx711" 16 | 17 | int main(int argc, const char *argv[]) 18 | { 19 | unsigned int val; 20 | int fd; 21 | int size = 0; 22 | 23 | fd = open(HX711_DEVICE_NAME, O_RDWR | O_NDELAY); 24 | if (fd == -1) { 25 | printf("open %s error", HX711_DEVICE_NAME); 26 | return -1; 27 | } 28 | 29 | while (1) { 30 | size = read(fd, (char *)&val, sizeof(val)); 31 | if (size >= 0) { 32 | printf("read size:%d\n", size); 33 | printf("value:%d, 0x%x\n", val, val); 34 | } 35 | } 36 | 37 | close(fd); 38 | 39 | return 0; 40 | } -------------------------------------------------------------------------------- /mod/08.wire/iio_hx711/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_iio_hx711.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/08.wire/iio_hx711/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = hx711_iio_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = hx711_iio_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/08.wire/iio_hx711/test/hx711_iio_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File : hx711_test.c 3 | * test for key driver. 4 | * COPYRIGHT (C) 2023, zc 5 | * 6 | * Change Logs: 7 | * Date Author Notes 8 | * 2023-11-22 zc the first version 9 | */ 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define h711_path "/sys/bus/iio/devices/iio:device0/in_voltage1_raw" 16 | 17 | int file_data_read(char *filename, char *str) 18 | { 19 | int ret = 0; 20 | FILE *data_stream; 21 | 22 | data_stream = fopen(filename, "r"); 23 | if (data_stream == NULL) { 24 | printf("can't open file %s\r\n", filename); 25 | return -1; 26 | } 27 | 28 | ret = fscanf(data_stream, "%s", str); 29 | if (!ret) { 30 | printf("file read error!\r\n"); 31 | } else if (ret == EOF) { 32 | fseek(data_stream, 0, SEEK_SET); /* 读到文件末尾的话将文件指针重新调整到文件头 */ 33 | } 34 | fclose(data_stream); 35 | return 0; 36 | } 37 | 38 | int main(int argc, const char *argv[]) 39 | { 40 | int ret; 41 | char str[50]; 42 | 43 | ret = file_data_read(h711_path, str); 44 | if (ret == 0) { 45 | printf("read_gx711:、%s\n", str); 46 | } 47 | 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /mod/09.rtc/bus_rtc/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_bus_rtc.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/09.rtc/bus_rtc/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = rtc_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = rtc_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/09.rtc/bus_rtc/test/rtc_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File : key_test.c 3 | * test for key driver. 4 | * COPYRIGHT (C) 2023, zc 5 | * 6 | * Change Logs: 7 | * Date Author Notes 8 | * 2023-11-22 zc the first version 9 | */ 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | struct rtc_time rtc_time = {0}; 21 | struct rtc_wkalrm alarm_time = {0}; 22 | static unsigned int flag = 0; 23 | 24 | #define RTC_DEVICE "/dev/rtc1" 25 | 26 | static void alarm_signal_func(int signum) 27 | { 28 | flag = 1; 29 | printf("alarm signal!\r\n"); 30 | } 31 | 32 | int main(int argc, char *argv[]) 33 | { 34 | int device_fd; 35 | int retval, flags; 36 | 37 | device_fd = open(RTC_DEVICE, O_RDWR | O_NONBLOCK); 38 | 39 | if (device_fd>=0) { 40 | retval = ioctl(device_fd, RTC_RD_TIME, &rtc_time); 41 | if (retval >= 0) { 42 | printf("timer:%d:%d:%d\n", rtc_time.tm_hour, rtc_time.tm_min, rtc_time.tm_sec); 43 | } 44 | printf("retval:%d\n", retval); 45 | 46 | signal(SIGIO, alarm_signal_func); 47 | 48 | fcntl(device_fd, F_SETOWN, getpid()); 49 | flags = fcntl(device_fd, F_GETFD); 50 | fcntl(device_fd, F_SETFL, flags | FASYNC); 51 | 52 | rtc_time.tm_min += 1; 53 | if (rtc_time.tm_min == 60) { 54 | rtc_time.tm_min = 0; 55 | rtc_time.tm_hour += 1; 56 | } 57 | alarm_time.enabled = 1; 58 | alarm_time.pending = 1; 59 | alarm_time.time = rtc_time; 60 | retval = ioctl(device_fd, RTC_WKALM_SET, &alarm_time); 61 | if (retval >= 0) { 62 | printf("set alarm success!\n"); 63 | } 64 | printf("retval:%d\n", retval); 65 | } 66 | 67 | while (!flag) { 68 | sleep(1); 69 | } 70 | 71 | close(device_fd); 72 | return 0; 73 | } -------------------------------------------------------------------------------- /mod/09.rtc/regmap_rtc/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_regmap_rtc.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/09.rtc/regmap_rtc/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = rtc_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = rtc_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/09.rtc/regmap_rtc/test/rtc_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File : key_test.c 3 | * test for key driver. 4 | * COPYRIGHT (C) 2023, zc 5 | * 6 | * Change Logs: 7 | * Date Author Notes 8 | * 2023-11-22 zc the first version 9 | */ 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | struct rtc_time rtc_time = {0}; 21 | struct rtc_wkalrm alarm_time = {0}; 22 | static unsigned int flag = 0; 23 | 24 | #define RTC_DEVICE "/dev/rtc1" 25 | 26 | static void alarm_signal_func(int signum) 27 | { 28 | flag = 1; 29 | printf("alarm signal!\r\n"); 30 | } 31 | 32 | int main(int argc, char *argv[]) 33 | { 34 | int device_fd; 35 | int retval, flags; 36 | 37 | device_fd = open(RTC_DEVICE, O_RDWR | O_NONBLOCK); 38 | 39 | if (device_fd>=0) { 40 | retval = ioctl(device_fd, RTC_RD_TIME, &rtc_time); 41 | if (retval >= 0) { 42 | printf("timer:%d:%d:%d\n", rtc_time.tm_hour, rtc_time.tm_min, rtc_time.tm_sec); 43 | } 44 | printf("retval:%d\n", retval); 45 | 46 | signal(SIGIO, alarm_signal_func); 47 | 48 | fcntl(device_fd, F_SETOWN, getpid()); 49 | flags = fcntl(device_fd, F_GETFD); 50 | fcntl(device_fd, F_SETFL, flags | FASYNC); 51 | 52 | rtc_time.tm_min += 1; 53 | if (rtc_time.tm_min == 60) { 54 | rtc_time.tm_min = 0; 55 | rtc_time.tm_hour += 1; 56 | } 57 | alarm_time.enabled = 1; 58 | alarm_time.pending = 1; 59 | alarm_time.time = rtc_time; 60 | retval = ioctl(device_fd, RTC_WKALM_SET, &alarm_time); 61 | if (retval >= 0) { 62 | printf("set alarm success!\n"); 63 | } 64 | printf("retval:%d\n", retval); 65 | } 66 | 67 | while (!flag) { 68 | sleep(1); 69 | } 70 | 71 | close(device_fd); 72 | return 0; 73 | } -------------------------------------------------------------------------------- /mod/10.rng/hw_rngc/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := imx-rng.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/10.rng/sf_rngc/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := sf-rng.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/10.rng/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = rngc_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = rngc_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/10.rng/test/rngc_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File : rngc_test.c 3 | * test for key driver. 4 | * COPYRIGHT (C) 2023, zc 5 | * 6 | * Change Logs: 7 | * Date Author Notes 8 | * 2023-11-22 zc the first version 9 | */ 10 | #include 11 | #include 12 | #include 13 | 14 | #define RNGC_DEVICE "/dev/hwrng" 15 | 16 | int main(int argc, const char *argv[]) 17 | { 18 | char buffer[64]; 19 | int fd; 20 | int size = 0; 21 | 22 | fd = open(RNGC_DEVICE, O_RDONLY); 23 | if (fd == -1) { 24 | printf("open %s error\n", RNGC_DEVICE); 25 | return -1; 26 | } 27 | 28 | size = read(fd, buffer, sizeof(buffer)); 29 | if (size >= 0) { 30 | printf("read size:%d\n", size); 31 | for (int i = 0; i < size; i++) { 32 | printf("%02x ", buffer[i]); 33 | } 34 | } else { 35 | printf("read failed:%d\n", size); 36 | } 37 | 38 | close(fd); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /mod/11.nvmem/nvmem_drv/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_nvmem.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/11.nvmem/nvmem_ref/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_nvmem_ref.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/11.nvmem/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = nvmem_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = nvmem_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/11.nvmem/test/nvmem_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File : nvmem_test.c 3 | * test for key driver. 4 | * COPYRIGHT (C) 2023, zc 5 | * 6 | * Change Logs: 7 | * Date Author Notes 8 | * 2023-11-22 zc the first version 9 | */ 10 | #include 11 | #include 12 | #include 13 | 14 | #define NVMEM_DEVICE_FILE "/sys/devices/platform/usr_nvmem/eeprom" 15 | 16 | int main(int argc, const char *argv[]) 17 | { 18 | char buffer[64]; 19 | int fd; 20 | int size = 0; 21 | 22 | fd = open(NVMEM_DEVICE_FILE, O_RDWR | O_NDELAY); 23 | if (fd == -1) { 24 | printf("open %s error", NVMEM_DEVICE_FILE); 25 | return -1; 26 | } 27 | 28 | // 移动指针位置 29 | lseek(fd, 100, SEEK_SET); 30 | 31 | size = read(fd, buffer, sizeof(buffer)); 32 | if (size >= 0) { 33 | printf("read size:%d\n", size); 34 | } else { 35 | printf("read failed:%d\n", size); 36 | } 37 | 38 | close(fd); 39 | 40 | return 0; 41 | } -------------------------------------------------------------------------------- /mod/12.serial/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = rs232_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = rs232_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/13.block_dev/no_queue/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := ram_disk.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/13.block_dev/queue/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := ram_disk_queue.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/14.touch_key/goodix_ts_i2c/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := goodix_ts_i2c.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/14.touch_key/goodix_ts_regmap/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_ts_regmap.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/15.can_net/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/mod/15.can_net/README.md -------------------------------------------------------------------------------- /mod/15.can_net/flexcan/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0 2 | 3 | obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o 4 | 5 | flexcan-objs := 6 | flexcan-objs += flexcan-core.o 7 | flexcan-objs += flexcan-ethtool.o 8 | -------------------------------------------------------------------------------- /mod/16.thermal/kernel/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := pwm-fan.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/16.thermal/thermal_cooling/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := thermal_fan.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/16.thermal/thermal_zone/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := thermal_sensor.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/17.pwm/kernel/README.md: -------------------------------------------------------------------------------- 1 | # pwm 2 | 3 | ## pwm_interface 4 | 5 | kernel中pwm的目录: "/drivers/pwm/pwm-imx27.c" 6 | 7 | pwm寄存器说明目录: Chapter 40: Pluse Width Modulation 8 | 9 | - PWMCR寄存器 10 | 11 | ```c 12 | /* 13 | * PWMCR: pwm控制寄存器 14 | * 地址: 0x020f8000 15 | * 位功能 16 | * bit[27:26] 设置FIFO置空标志位置位的条件 17 | * bit[25] 停止模式下PWM是否工作,1表示工作 18 | * bit[24] 休眠模式下PWM是否工作,1表示工作 19 | * bit[23] 等待模式下PWM是否工作,1表示工作 20 | * bit[22] 调试模式下PWM是否工作,1表示工作 21 | * bit[21] 从FIFO到寄存器写入时,字节是否交换,0表示不交换(16-bit数据时) 22 | * bit[20] 从FIFO到寄存器写入时,半字是否交换,0表示不交换(32-bit数据时) 23 | * bit[19:18] PWM输出极性,00:重载计数时高电平,到达计数后低电平 01:重载计数时低电平,到达计数后高电平 24 | * bit[17:16] PWM时钟源,00:无时钟 01:ipg时钟 02:ipg_highfreq 03:ipg_32k, 01 ipg=66M 25 | * bit[15:4] 时钟分频,clock/(data+1) prescaler 26 | * bit[3] 软件复位,设置1复位,复位完成后自动清零 27 | * bit[2:1] FIFO中每个样本使用的次数, 00:1 times 01:2 times, 02: 4 times 03: 8 times 28 | * bit[0] pwm使能位,未使能状态下,prescale和count在复位状态 29 | */ 30 | ``` 31 | 32 | - PWMSR寄存器 33 | 34 | ```c 35 | /* 36 | * PWMSR: pwm状态寄存器 37 | * 地址: 0x020f8004 38 | * 位功能 39 | * bit[6] FIFO写入错误状态标志位 40 | * bit[5] 比较事件触发标志位 41 | * bit[4] 翻转事件触发标志位 42 | * bit[3] FIFO是否为空标志位 43 | * bit[2:0] FIFO内数据状态,只读数据,写入无效 44 | */ 45 | ``` 46 | 47 | - PWMIR寄存器 48 | 49 | ```c 50 | /* 51 | * PWMIR: pwm中断控制寄存器 52 | * 地址: 0x020f8008 53 | * 位功能 54 | * bit[2] 比较中断使能 55 | * bit[1] 翻转中断使能 56 | * bit[0] FIFO空中断使能 57 | */ 58 | ``` 59 | 60 | - PWMSAR寄存器 61 | 62 | ```c 63 | /* 64 | * PWMSAR: pwm sample fifo写入寄存器 65 | * 地址: 0x020f800c 66 | * 位功能 67 | * bit[15:0] sample value 68 | */ 69 | 70 | state->dutycycle = (sample/(pwm_clk/prescaler))*NSEC_PER_SEC 71 | = (NSEC_PER_SEC*(u64)sample*prescaler)/pwm_clk 72 | ``` 73 | 74 | - PWMPR寄存器 75 | 76 | ```c 77 | /* 78 | * PWMPR: pwm周期寄存器 79 | * 地址: 0x020f8010 80 | * 位功能 81 | * bit[15:0] peroid value 82 | */ 83 | 84 | PWMO (Hz) = PCLK(Hz) / (period +2) 85 | state->period = (((u64)period + 2)/(pwm_clk/prescaler))*NSEC_PER_SEC 86 | = (NSEC_PER_SEC*((u64)period+2)*prescaler)/pwm_clk 87 | ``` -------------------------------------------------------------------------------- /mod/17.pwm/pwm_consumer/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_pwm_consumer.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/17.pwm/pwm_provider/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_pwm.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/17.pwm/pwm_provider/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = pwm_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = pwm_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/18.wdt/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_wdt.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/18.wdt/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = wdt_test.o 11 | CFLAGS = -lm 12 | run_dist =$(BUILD_NFS_PATH)/home/sys/modules 13 | 14 | # This is the file name of the executables and path where 15 | # place the executables 16 | buildout = wdt_test 17 | 18 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/18.wdt/test/wdt_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File : key_test.c 3 | * test for key driver. 4 | * COPYRIGHT (C) 2023, zc 5 | * 6 | * Change Logs: 7 | * Date Author Notes 8 | * 2023-11-22 zc the first version 9 | */ 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | static unsigned int flag = 0; 20 | 21 | #define WATCHDOG_DEVICE "/dev/watchdog1" 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | int wdt_fd; 26 | int retval, flags; 27 | int timeout = 5; 28 | int ioctl_alive = 0; 29 | int errno; 30 | 31 | if (argc > 1) { 32 | ioctl_alive = atoi(argv[1]); 33 | } 34 | printf("ioctl_alive:%d\n", ioctl_alive); 35 | 36 | // open会直接开启对应的watchdog 37 | wdt_fd = open(WATCHDOG_DEVICE, O_RDWR | O_NONBLOCK); 38 | 39 | if (wdt_fd>=0) 40 | { 41 | ioctl(wdt_fd, WDIOC_SETTIMEOUT, &timeout); 42 | 43 | while (!flag) 44 | { 45 | if (ioctl_alive == 0) { 46 | ioctl(wdt_fd, WDIOC_KEEPALIVE, NULL); 47 | } 48 | 49 | sleep(1); 50 | } 51 | 52 | ioctl(wdt_fd, WDIOC_SETOPTIONS, WDIOS_DISABLECARD); 53 | close(wdt_fd); 54 | } 55 | 56 | return 0; 57 | } -------------------------------------------------------------------------------- /mod/19.drm/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/mod/19.drm/README.md -------------------------------------------------------------------------------- /mod/19.drm/kernel_fb.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/mod/19.drm/kernel_fb.c -------------------------------------------------------------------------------- /mod/19.drm/spi_oled/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_spi_oled.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/19.drm/spi_oled/kernel_spi_oled.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/mod/19.drm/spi_oled/kernel_spi_oled.c -------------------------------------------------------------------------------- /mod/21.joystick/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := adc-joystick.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/21.joystick/test/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = joystick_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = joystick_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/22.brightness/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_pwm_bl.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/23.usb/usb_host_serial/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | BUILD =e 9 | 10 | c_objects = usb_serial_test.o 11 | 12 | # This is the file name of the executables and path where 13 | # place the executables 14 | buildout = usb_serial_test 15 | 16 | include $(ENV_PATH_ROOT)/build/buildrules.mk -------------------------------------------------------------------------------- /mod/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for multi files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | dir := ${ENV_PATH_ROOT}/mod 9 | 10 | subdirs := ${dir}/01.led \ 11 | ${dir}/02.loopled \ 12 | ${dir}/03.beep \ 13 | ${dir}/04.i2c_ap/bus_i2c \ 14 | ${dir}/04.i2c_ap/regmap_i2c \ 15 | ${dir}/05.spi_icm/bus_spi \ 16 | ${dir}/05.spi_icm/regmap_spi \ 17 | ${dir}/06.key/key_async \ 18 | ${dir}/06.key/key_input \ 19 | ${dir}/06.key/key_rwio \ 20 | ${dir}/07.adc \ 21 | ${dir}/08.wire/dev_hx711 \ 22 | ${dir}/08.wire/iio_hx711 \ 23 | ${dir}/09.rtc/bus_rtc \ 24 | ${dir}/09.rtc/regmap_rtc \ 25 | ${dir}/10.rng/hw-rngc \ 26 | ${dir}/11.nvmem \ 27 | ${dir}/14.touch_key/goodix_ts_i2c \ 28 | ${dir}/17.pwm/pwm_consumer \ 29 | ${dir}/18.pwm/pwm_provider 30 | 31 | 32 | with_kernel :=0 33 | include $(ENV_PATH_ROOT)/build/buildmulti.mk 34 | -------------------------------------------------------------------------------- /mod/kernal_mod.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "settings": { 8 | "files.associations": { 9 | "types.h": "c", 10 | "*.tcc": "c", 11 | "of.h": "c" 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /mod/x1.relay/export/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := export.o 9 | 10 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/x1.relay/export/export.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2024-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // export.c 7 | // 8 | // Purpose: 9 | // 10 | // Author: 11 | // @听心跳的声音 12 | // 13 | // Assumptions: 14 | // 15 | // Revision History: 16 | // 12/19/2022 Create New Version 17 | ///////////////////////////////////////////////////////////////////////////// 18 | #include 19 | #include 20 | 21 | static int num = 10; 22 | void show(void) 23 | { 24 | printk(KERN_ALERT "show(),num=%d\r\n", num); 25 | } 26 | EXPORT_SYMBOL(show); 27 | 28 | static int export_init(void) 29 | { 30 | printk(KERN_ALERT "export init!\r\n"); 31 | return 0; 32 | } 33 | static void export_exit(void) 34 | { 35 | printk(KERN_ALERT "export exit!\r\n"); 36 | } 37 | 38 | module_init(export_init); 39 | module_exit(export_exit); 40 | MODULE_AUTHOR("wzdxf"); 41 | MODULE_LICENSE("GPL v2"); 42 | MODULE_DESCRIPTION("platform driver for led"); 43 | MODULE_ALIAS("led_data"); 44 | -------------------------------------------------------------------------------- /mod/x1.relay/multi/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | 9 | MODULE_NAME := kernalout 10 | obj-m := ${MODULE_NAME}.o 11 | ${MODULE_NAME}-objs := kernel_main.o kernel_base.o 12 | FIRMWARE_CLEAN := 1 13 | 14 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/x1.relay/multi/kernel_base.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2024-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // relay.c 7 | // 8 | // Purpose: 9 | // 10 | // Author: 11 | // @听心跳的声音 12 | // 13 | // Assumptions: 14 | // 15 | // Revision History: 16 | // 12/19/2022 Create New Version 17 | ///////////////////////////////////////////////////////////////////////////// 18 | #include 19 | #include 20 | 21 | void show(void) 22 | { 23 | printk(KERN_ALERT "kernel show run!\r\n"); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /mod/x1.relay/multi/kernel_main.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2024-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // relay.c 7 | // 8 | // Purpose: 9 | // 10 | // Author: 11 | // @听心跳的声音 12 | // 13 | // Assumptions: 14 | // 15 | // Revision History: 16 | // 12/19/2022 Create New Version 17 | ///////////////////////////////////////////////////////////////////////////// 18 | #include 19 | #include 20 | 21 | extern void show(void); 22 | 23 | static int kernel_main_init(void) 24 | { 25 | printk(KERN_ALERT "kernel main init!\r\n"); 26 | 27 | show(); 28 | 29 | return 0; 30 | } 31 | 32 | static void kernel_main_exit(void) 33 | { 34 | printk(KERN_ALERT "kernel main exit!\r\n"); 35 | } 36 | 37 | module_init(kernel_main_init); 38 | module_exit(kernel_main_exit); 39 | MODULE_AUTHOR("wzdxf"); 40 | MODULE_LICENSE("GPL v2"); 41 | MODULE_DESCRIPTION("platform driver for led"); 42 | MODULE_ALIAS("led_data"); 43 | -------------------------------------------------------------------------------- /mod/x1.relay/relay/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := relay.o 9 | FIRMWARE_CLEAN := 1 10 | KBUILD_EXTRA_SYMBOLS = $(ENV_PATH_ROOT)/mod/x1.relay/export/Module.symvers 11 | 12 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/x1.relay/relay/relay.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2024-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // relay.c 7 | // 8 | // Purpose: 9 | // 10 | // Author: 11 | // @听心跳的声音 12 | // 13 | // Assumptions: 14 | // 15 | // Revision History: 16 | // 12/19/2022 Create New Version 17 | ///////////////////////////////////////////////////////////////////////////// 18 | #include 19 | #include 20 | 21 | extern void show(void); 22 | 23 | static int relay_init(void) 24 | { 25 | printk(KERN_ALERT "relay init!\r\n"); 26 | 27 | show(); 28 | 29 | return 0; 30 | } 31 | static void relay_exit(void) 32 | { 33 | printk(KERN_ALERT "relay exit!\r\n"); 34 | } 35 | 36 | module_init(relay_init); 37 | module_exit(relay_exit); 38 | MODULE_AUTHOR("wzdxf"); 39 | MODULE_LICENSE("GPL v2"); 40 | MODULE_DESCRIPTION("platform driver for led"); 41 | MODULE_ALIAS("led_data"); 42 | -------------------------------------------------------------------------------- /mod/x2.param/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_param.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /mod/x2.param/kernel_param.c: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // (c) copyright 2024-by Persional Inc. 3 | // All Rights Reserved 4 | // 5 | // Name: 6 | // kernel_param.c 7 | // 8 | // Purpose: 9 | // 10 | // Author: 11 | // @听心跳的声音 12 | // 13 | // Assumptions: 14 | // 15 | // Revision History: 16 | // 12/19/2022 Create New Version 17 | ///////////////////////////////////////////////////////////////////////////// 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | static char* test_str="hello world!"; 24 | module_param(test_str, charp, 0644); 25 | static bool bval = true; 26 | module_param(bval, bool, S_IRUGO); 27 | static int array_list[2] = {1, 2}; 28 | module_param_array(array_list, int, NULL, S_IRUGO); 29 | 30 | static int __init kernel_module_init(void) 31 | { 32 | printk(KERN_INFO"test_str:%s\n", test_str); 33 | printk(KERN_INFO"bval:%d\n", bval); 34 | printk(KERN_INFO"array[0]=%d\n", array_list[0]); 35 | return 0; 36 | } 37 | 38 | static void __exit kernel_module_exit(void) 39 | { 40 | 41 | } 42 | 43 | module_init(kernel_module_init); 44 | module_exit(kernel_module_exit); 45 | MODULE_AUTHOR("wzdxf"); 46 | MODULE_LICENSE("GPL v2"); 47 | MODULE_DESCRIPTION("driver for param"); 48 | MODULE_ALIAS("kernel param"); 49 | -------------------------------------------------------------------------------- /mod/x3.example/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Build for module files. 4 | # Copyright (c) 2020-2023 5 | # Original Author: 1107473010@qq.com 6 | # 7 | ################################################################################ 8 | obj-m := kernel_example.o 9 | FIRMWARE_CLEAN := 1 10 | 11 | include $(ENV_PATH_ROOT)/build/buildmod.mk -------------------------------------------------------------------------------- /platform/H618/README.md: -------------------------------------------------------------------------------- 1 | # platform 2 | 3 | ## U-Boot 4 | 5 | U-Boot下载适配方法。 6 | 7 | ```shell 8 | #解压U-Boot 9 | wget https://codeload.github.com/nxp-imx/uboot-imx/zip/refs/heads/lf_v2022.04 10 | unzip lf_v2022.04 11 | cd uboot-imx-lf_v2022.04/ 12 | 13 | #将uboot-imx-lf_v2022.04-patch目录下内容复制到上述目录下 14 | 15 | #执行编译 16 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- mx6ull_14x14_rmk_emmc_defconfig 17 | make -j8 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- 18 | ``` 19 | 20 | ## Linux 21 | 22 | Linux下载适配方法。 23 | 24 | ```shell 25 | #解压U-Boot 26 | wget https://codeload.github.com/nxp-imx/linux-imx/zip/refs/heads/lf-6.1.y 27 | unzip linux-imx-lf-6.1.y.zip 28 | cd linux-imx-lf-6.1.y/ 29 | 30 | #将linux-imx-lf-6.1.y-patch目录下内容复制到上述目录下 31 | 32 | #执行编译 33 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- imx_rmk_v7_defconfig 34 | make -j8 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- 35 | ``` 36 | -------------------------------------------------------------------------------- /platform/H618/uboot/config.txt: -------------------------------------------------------------------------------- 1 | bootlogo=false 2 | overlay_prefix=sun50i-h616 3 | fdtfile=sun50i-h616-walnutpi-1b 4 | 5 | ## enable the console with screen 6 | console_display=enable 7 | console_uart=uart0 8 | 9 | ## show the bootinfo to the screen 10 | display_bootinfo=enable 11 | 12 | 13 | ## loglevel 14 | printk_level=3 15 | 16 | ## Specify HDMI output resolution (eg. extraargs=video=HDMI-A-1:800x480-24@60) 17 | #extraargs=video=HDMI-A-1:1024x600-24@60 18 | 19 | 20 | #spi : spidev0_0 spidev1_0 spidev1_1 spidev1_2 21 | #i2c : i2c1 i2c2 i2c4 22 | #uart : uart2 uart4 23 | overlays=spi1 i2c1 i2c2 uart2 24 | 25 | 26 | #------------------------------------------------# 27 | rootfstype=ext4 28 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/README.md: -------------------------------------------------------------------------------- 1 | # platform 2 | 3 | ## U-Boot 4 | 5 | U-Boot下载适配方法。 6 | 7 | ```shell 8 | #解压U-Boot 9 | wget https://codeload.github.com/nxp-imx/uboot-imx/zip/refs/heads/lf_v2022.04 10 | unzip lf_v2022.04 11 | cd uboot-imx-lf_v2022.04/ 12 | 13 | #将uboot-imx-lf_v2022.04-patch目录下内容复制到上述目录下 14 | 15 | #执行编译 16 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- mx6ull_14x14_rmk_emmc_defconfig 17 | make -j8 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- 18 | ``` 19 | 20 | ## Linux 21 | 22 | Linux下载适配方法。 23 | 24 | ```shell 25 | #解压U-Boot 26 | wget https://codeload.github.com/nxp-imx/linux-imx/zip/refs/heads/lf-6.1.y 27 | unzip linux-imx-lf-6.1.y.zip 28 | cd linux-imx-lf-6.1.y/ 29 | 30 | #将linux-imx-lf-6.1.y-patch目录下内容复制到上述目录下 31 | 32 | #执行编译 33 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- imx_rmk_v7_defconfig 34 | make -j8 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- 35 | ``` 36 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/bootcmd-shell/READM.md: -------------------------------------------------------------------------------- 1 | # u-boot扩展脚本 2 | 3 | - u-boot网络启动 4 | 5 | ```shell 6 | setenv boot_mod net; tftp 80800000 boot.scr; source 7 | ``` 8 | 9 | - u-boot mmc启动 10 | 11 | ```shell 12 | setenv boot_mod mmc; fatload mmc 1:1 80800000 boot.scr; source 13 | ``` 14 | 15 | - u-boot uImage启动 16 | 17 | ```shell 18 | setenv boot_mod net; tftp 80800000 uImage; tftp 83000000 imx6ull-14x14-emmc-4.3-800x480-c.dtb; bootm 80800000 - 83000000; 19 | ``` -------------------------------------------------------------------------------- /platform/I.MX6ULL/bootcmd-shell/build_shell.sh: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # This file is used to build u-boot shell 4 | # 5 | # 6 | ################################################################################ 7 | 8 | #build boot.cmd 9 | mkimage -C none -A arm -T script -d boot.cmd boot.scr 10 | mv -fv boot.scr "${BUILD_TFTP_PATH}"/ 11 | cp -fv config.txt "${BUILD_TFTP_PATH}"/ 12 | 13 | #build dtbo 14 | for file in $(find "./" -type f -name "*.dts"); do 15 | # 提取文件名(不包含路径) 16 | filename=$(basename "$file") 17 | filename="${filename%.*}" 18 | dtc -@ -I dts -O dtb -o ${filename}.dtbo ${filename}.dts 19 | done 20 | 21 | mv -fv *.dtbo "${BUILD_TFTP_PATH}"/ 22 | 23 | cp -fv kernel_fit.its "${BUILD_TFTP_PATH}"/ 24 | cd "${BUILD_TFTP_PATH}"/ 25 | mkimage -f kernel_fit.its kernel_fit.itb -------------------------------------------------------------------------------- /platform/I.MX6ULL/bootcmd-shell/config.txt: -------------------------------------------------------------------------------- 1 | ## nfs network 2 | serverip=192.168.2.29 3 | ipaddr=192.168.2.99 4 | gateway=192.168.2.1 5 | netmask=255.255.255.0 6 | nfspath=/home/freedom/Desktop/user_git/sdk/nfs 7 | 8 | ## loglevel 9 | printk_level=7 10 | 11 | ## console set 12 | console_serial=ttymxc0 13 | console_baud=115200 14 | # display_bootinfo=enable 15 | 16 | ## boot manage 17 | ## net/mmc: net or mmc boot mode 18 | boot_mod=net 19 | 20 | ## fdt file manage 21 | fdt_file=imx6ull-14x14-emmc-4.3-800x480-c.dtb 22 | 23 | ## support overlays 24 | overlays=imx6ull-rmk-overlay 25 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/bootcmd-shell/imx6ull-rmk-overlay.dts: -------------------------------------------------------------------------------- 1 | 2 | /dts-v1/; 3 | /plugin/; 4 | 5 | &usr_beep { 6 | rmk,value = <1>; 7 | }; 8 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/bootcmd-shell/kernel_fit.its: -------------------------------------------------------------------------------- 1 | /* 2 | * U-Boot uImage source file containing a single kernel and FDT blob 3 | */ 4 | 5 | /dts-v1/; 6 | 7 | / { 8 | description = "image with Linux kernel and FDT blob"; 9 | #address-cells = <1>; 10 | 11 | images { 12 | kernel { 13 | description = "Linux kernel"; 14 | data = /incbin/("./zImage"); 15 | type = "kernel"; 16 | arch = "arm"; 17 | os = "linux"; 18 | compression = "none"; 19 | load = <0x80800000>; 20 | entry = <0x80800000>; 21 | hash-1 { 22 | algo = "crc32"; 23 | }; 24 | }; 25 | 26 | fdt-1 { 27 | description = "Flattened Device Tree blob 1"; 28 | data = /incbin/("./imx6ull-14x14-emmc-4.3-800x480-c.dtb"); 29 | type = "flat_dt"; 30 | arch = "arm"; 31 | load = <0x83000000>; 32 | compression = "none"; 33 | hash-1 { 34 | algo = "crc32"; 35 | }; 36 | }; 37 | }; 38 | 39 | configurations { 40 | default = "conf-1"; 41 | conf-1 { 42 | description = "Boot Linux kernel with FDT blob"; 43 | kernel = "kernel"; 44 | fdt = "fdt-1"; 45 | }; 46 | }; 47 | }; -------------------------------------------------------------------------------- /platform/I.MX6ULL/buildroot-2023.02.9-patch/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/platform/I.MX6ULL/buildroot-2023.02.9-patch/README.md -------------------------------------------------------------------------------- /platform/I.MX6ULL/buildroot-2023.02.9-patch/imx6ullrmk_defconfig: -------------------------------------------------------------------------------- 1 | # architecture 2 | BR2_arm=y 3 | BR2_cortex_a7=y 4 | BR2_ARM_FPU_NEON_VFPV4=y 5 | 6 | # 7 | # Toolchain 8 | # 9 | BR2_TOOLCHAIN_EXTERNAL=y 10 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y 11 | BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y 12 | #BR2_TOOLCHAIN_EXTERNAL_PATH="/home/freedom/sdk/arm/support/compiler" 13 | BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL="toolchain-external-custom" 14 | BR2_TOOLCHAIN_EXTERNAL_PREFIX="arm-none-linux-gnueabihf" 15 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-none-linux-gnueabihf" 16 | BR2_TOOLCHAIN_EXTERNAL_GCC_11=y 17 | BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_20=y 18 | BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y 19 | BR2_TOOLCHAIN_EXTERNAL_CXX=y 20 | BR2_TOOLCHAIN_EXTERNAL_FORTRAN=y 21 | BR2_TOOLCHAIN_EXTERNAL_OPENMP=y 22 | BR2_TOOLCHAIN_EXTERNAL_INET_RPC=n 23 | BR2_TARGET_ROOTFS_EXT2_SIZE="4G" 24 | BR2_KERNEL_MIRROR="https://mirrors.edge.kernel.org/pub/" 25 | BR2_PACKAGE_CAN_UTILS=y 26 | BR2_PACKAGE_MMC_UTILS=y 27 | BR2_PACKAGE_MMC_UTILS_ENABLE_DANGEROUS_COMMANDS=y 28 | 29 | # system 30 | BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0" 31 | 32 | # filesystem / image 33 | BR2_TARGET_ROOTFS_EXT2=y 34 | BR2_TARGET_ROOTFS_EXT2_4=y 35 | 36 | # System configuration 37 | BR2_TARGET_GENERIC_HOSTNAME="freedom" 38 | BR2_TARGET_GENERIC_ISSUE="Welcome to freedom" 39 | BR2_TARGET_GENERIC_ROOT_PASSWD="root" 40 | 41 | # GDB Support 42 | BR2_PACKAGE_GDB_ARCH_SUPPORTS=y 43 | BR2_PACKAGE_GDB=y 44 | BR2_PACKAGE_GDB_SERVER=y 45 | 46 | # PYTHON3 and Library Support 47 | BR2_PACKAGE_PYTHON3=y 48 | BR2_PACKAGE_PYTHON_SERIAL=y 49 | BR2_PACKAGE_PYTHON_EVDEV=y 50 | BR2_PACKAGE_HOST_PYTHON_GREENLET=y 51 | BR2_PACKAGE_HOST_PYTHON_INIPARSE=y 52 | BR2_PACKAGE_HOST_PYTHON_LXML=y 53 | BR2_PACKAGE_HOST_PYTHON_PYYAML=y 54 | BR2_PACKAGE_HOST_PYTHON_SIX=y 55 | BR2_PACKAGE_HOST_PYTHON_XLRD=y 56 | BR2_PACKAGE_HOST_PYTHON3=y -------------------------------------------------------------------------------- /platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "**/.git": true, 4 | "**/.svn": true, 5 | "**/.hg": true, 6 | "**/CVS": true, 7 | "**/.DS_Store": true, 8 | "**/Thumbs.db": true, 9 | "**/.tmp_versions": true, 10 | "**/scripts":true, 11 | "**/*.cmd":true, 12 | "**/*.tmp":true, 13 | "**/*.dtb":true, 14 | "**/.tmp*":true, 15 | 16 | "arch/arm64":true, 17 | "arch/arc":true, 18 | "arch/alpha":true, 19 | "arch/[b-z]*":true, 20 | "arch/arm/configs/[a-h,j-z]*":true, 21 | "arch/arm/configs/i[!m]*":true, 22 | "arch/arm/boot/dts/[a-h,j-z]*":true, 23 | "arch/arm/boot/dts/i[!m]*":true, 24 | "arch/arm/boot/dts/imx[!6]*":true, 25 | "arch/arm/boot/dts/imx6[!u]*":true, 26 | "arch/arm/boot/dts/imx6ul-[a-o,q-z,9]*":true, 27 | "arch/arm/boot/dts/imx6ul-ph*":true, 28 | "arch/arm/boot/dts/imx6ulz*":true, 29 | "arch/arm/boot/dts/imx6ull-[a-o,r-z,9]*":true, 30 | "arch/arm/boot/dts/imx6ull-ph*":true, 31 | "arch/arm/boot/dts/imx6ul-14x14-evk*":true, 32 | "arch/arm/boot/dts/imx6ull-14x14-evk*":true, 33 | "arch/arm/mach-[!i]*":true, 34 | "arch/arm/mach-i[!m]*":true, 35 | 36 | "block":true, 37 | "certs":true, 38 | "crypto":true, 39 | "debian":true, 40 | "firmware":true, 41 | "fs":true, 42 | "init":true, 43 | "io_uring":true, 44 | "ipc":true, 45 | "LICENSES":true, 46 | "kernel":true, 47 | "lib":true, 48 | "mm":true, 49 | "rust":true, 50 | "samples":true, 51 | "scripts":true, 52 | "security":true, 53 | "sound":true, 54 | "tools":true, 55 | "usr":true, 56 | "virt":true, 57 | }, 58 | 59 | "search.exclude": { 60 | "**/node_modules": true, 61 | "**/bower_components": true, 62 | "**/*.code-search": true, 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/README.md: -------------------------------------------------------------------------------- 1 | # linux-imx-lf-6.1.y-patch 2 | 3 | https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/imx/sdma 4 | 5 | ```shell 6 | wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/imx/sdma/sdma-imx6q.bin 7 | ``` -------------------------------------------------------------------------------- /platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/arch/arm/boot/dts/imx6ull-14x14-nand-4.3-800x480-c.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Freescale Semiconductor, Inc. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 2 as 6 | * published by the Free Software Foundation. 7 | */ 8 | 9 | #include "imx6ull-14x14-emmc-4.3-800x480-c.dts" 10 | 11 | &gpmi { 12 | pinctrl-names = "default"; 13 | pinctrl-0 = <&pinctrl_gpmi_nand_1>; 14 | status = "okay"; 15 | nand-on-flash-bbt; 16 | }; 17 | 18 | &iomuxc { 19 | pinctrl_gpmi_nand_1: gpmi-nand-1 { 20 | fsl,pins = < 21 | MX6UL_PAD_NAND_CLE__RAWNAND_CLE 0xb0b1 22 | MX6UL_PAD_NAND_ALE__RAWNAND_ALE 0xb0b1 23 | MX6UL_PAD_NAND_WP_B__RAWNAND_WP_B 0xb0b1 24 | MX6UL_PAD_NAND_READY_B__RAWNAND_READY_B 0xb000 25 | MX6UL_PAD_NAND_CE0_B__RAWNAND_CE0_B 0xb0b1 26 | MX6UL_PAD_NAND_CE1_B__RAWNAND_CE1_B 0xb0b1 27 | MX6UL_PAD_NAND_RE_B__RAWNAND_RE_B 0xb0b1 28 | MX6UL_PAD_NAND_WE_B__RAWNAND_WE_B 0xb0b1 29 | MX6UL_PAD_NAND_DATA00__RAWNAND_DATA00 0xb0b1 30 | MX6UL_PAD_NAND_DATA01__RAWNAND_DATA01 0xb0b1 31 | MX6UL_PAD_NAND_DATA02__RAWNAND_DATA02 0xb0b1 32 | MX6UL_PAD_NAND_DATA03__RAWNAND_DATA03 0xb0b1 33 | MX6UL_PAD_NAND_DATA04__RAWNAND_DATA04 0xb0b1 34 | MX6UL_PAD_NAND_DATA05__RAWNAND_DATA05 0xb0b1 35 | MX6UL_PAD_NAND_DATA06__RAWNAND_DATA06 0xb0b1 36 | MX6UL_PAD_NAND_DATA07__RAWNAND_DATA07 0xb0b1 37 | >; 38 | }; 39 | }; 40 | 41 | &usdhc2 { 42 | status = "disabled"; 43 | }; 44 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/drivers/video/logo/Kconfig: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Logo configuration 4 | # 5 | 6 | menuconfig LOGO 7 | bool "Bootup logo" 8 | depends on FB || SGI_NEWPORT_CONSOLE 9 | help 10 | Enable and select frame buffer bootup logos. 11 | 12 | if LOGO 13 | 14 | config FB_LOGO_EXTRA 15 | bool 16 | depends on FB=y 17 | default y if SPU_BASE 18 | 19 | config LOGO_LINUX_MONO 20 | bool "Standard black and white Linux logo" 21 | default y 22 | 23 | config LOGO_LINUX_VGA16 24 | bool "Standard 16-color Linux logo" 25 | default y 26 | 27 | config LOGO_LINUX_CLUT224 28 | bool "Standard 224-color Linux logo" 29 | default y 30 | 31 | # system feature-001: add user logo 32 | config LOGO_USER_CLUT224 33 | bool "Standard 224-color user logo" 34 | default y 35 | 36 | config LOGO_DEC_CLUT224 37 | bool "224-color Digital Equipment Corporation Linux logo" 38 | depends on MACH_DECSTATION || ALPHA 39 | default y 40 | 41 | config LOGO_MAC_CLUT224 42 | bool "224-color Macintosh Linux logo" 43 | depends on MAC 44 | default y 45 | 46 | config LOGO_PARISC_CLUT224 47 | bool "224-color PA-RISC Linux logo" 48 | depends on PARISC 49 | default y 50 | 51 | config LOGO_SGI_CLUT224 52 | bool "224-color SGI Linux logo" 53 | depends on SGI_IP22 || SGI_IP27 || SGI_IP32 54 | default y 55 | 56 | config LOGO_SUN_CLUT224 57 | bool "224-color Sun Linux logo" 58 | depends on SPARC 59 | default y 60 | 61 | config LOGO_SUPERH_MONO 62 | bool "Black and white SuperH Linux logo" 63 | depends on SUPERH 64 | default y 65 | 66 | config LOGO_SUPERH_VGA16 67 | bool "16-color SuperH Linux logo" 68 | depends on SUPERH 69 | default y 70 | 71 | config LOGO_SUPERH_CLUT224 72 | bool "224-color SuperH Linux logo" 73 | depends on SUPERH 74 | default y 75 | 76 | endif # LOGO 77 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/drivers/video/logo/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0 2 | # Makefile for the Linux logos 3 | 4 | obj-$(CONFIG_LOGO) += logo.o 5 | obj-$(CONFIG_LOGO_LINUX_MONO) += logo_linux_mono.o 6 | obj-$(CONFIG_LOGO_LINUX_VGA16) += logo_linux_vga16.o 7 | obj-$(CONFIG_LOGO_LINUX_CLUT224) += logo_linux_clut224.o 8 | obj-$(CONFIG_LOGO_DEC_CLUT224) += logo_dec_clut224.o 9 | obj-$(CONFIG_LOGO_MAC_CLUT224) += logo_mac_clut224.o 10 | obj-$(CONFIG_LOGO_PARISC_CLUT224) += logo_parisc_clut224.o 11 | obj-$(CONFIG_LOGO_SGI_CLUT224) += logo_sgi_clut224.o 12 | obj-$(CONFIG_LOGO_SUN_CLUT224) += logo_sun_clut224.o 13 | obj-$(CONFIG_LOGO_SUPERH_MONO) += logo_superh_mono.o 14 | obj-$(CONFIG_LOGO_SUPERH_VGA16) += logo_superh_vga16.o 15 | obj-$(CONFIG_LOGO_SUPERH_CLUT224) += logo_superh_clut224.o 16 | 17 | # system feature-001: add user logo 18 | obj-$(CONFIG_LOGO_USER_CLUT224) += logo_user_clut224.o 19 | obj-$(CONFIG_SPU_BASE) += logo_spe_clut224.o 20 | 21 | # How to generate logo's 22 | 23 | hostprogs := pnmtologo 24 | 25 | # Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..." 26 | quiet_cmd_logo = LOGO $@ 27 | cmd_logo = $(obj)/pnmtologo -t $(lastword $(subst _, ,$*)) -n $* -o $@ $< 28 | 29 | $(obj)/%.c: $(src)/%.pbm $(obj)/pnmtologo FORCE 30 | $(call if_changed,logo) 31 | 32 | $(obj)/%.c: $(src)/%.ppm $(obj)/pnmtologo FORCE 33 | $(call if_changed,logo) 34 | 35 | $(obj)/%.c: $(src)/%.pgm $(obj)/pnmtologo FORCE 36 | $(call if_changed,logo) 37 | 38 | # generated C files 39 | targets += *_mono.c *_vga16.c *_clut224.c *_gray256.c 40 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/firmware/imx/sdma/sdma-imx6q.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/firmware/imx/sdma/sdma-imx6q.bin -------------------------------------------------------------------------------- /platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/firmware/regulatory.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/firmware/regulatory.db -------------------------------------------------------------------------------- /platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/firmware/regulatory.db.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/firmware/regulatory.db.p7s -------------------------------------------------------------------------------- /platform/I.MX6ULL/linux-imx-lf-6.1.y-patch/kernel_upgrade.sh: -------------------------------------------------------------------------------- 1 | 2 | PLATFORM_BOOT=$(pwd) 3 | 4 | #SRC_DIR=${SUPPORT_ENV_KERNEL_DIR} 5 | #DST_DIR=${PLATFORM_BOOT} 6 | SRC_DIR=${PLATFORM_BOOT} 7 | DST_DIR=${SUPPORT_ENV_KERNEL_DIR} 8 | 9 | #dts 10 | cp -rv ${SRC_DIR}/arch/arm/boot/dts/* ${DST_DIR}/arch/arm/boot/dts/ 11 | 12 | #config 13 | cp -rv ${SRC_DIR}/arch/arm/configs/* ${DST_DIR}/arch/arm/configs/ 14 | 15 | #firmware 16 | if [ ! -d ${DST_DIR}/firmware ]; then 17 | mkdir ${DST_DIR}/firmware 18 | fi 19 | cp -rv ${SRC_DIR}/firmware/* ${DST_DIR}/firmware/ 20 | 21 | #drivers 22 | cp -rv ${SRC_DIR}/drivers/* ${DST_DIR}/drivers/ 23 | 24 | #include 25 | cp -rv ${SRC_DIR}/include/* ${DST_DIR}/include/ 26 | 27 | # scripts, support for overlay 28 | cp -rv ${SRC_DIR}/scripts/* ${DST_DIR}/scripts/ 29 | 30 | #.vscode 31 | if [ ! -d ${DST_DIR}/.vscode ]; then 32 | mkdir ${DST_DIR}/.vscode 33 | fi 34 | cp -rv ${SRC_DIR}/.vscode/settings.json ${DST_DIR}/.vscode/ -------------------------------------------------------------------------------- /platform/I.MX6ULL/platform-diff.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/platform/I.MX6ULL/platform-diff.xlsx -------------------------------------------------------------------------------- /platform/I.MX6ULL/platform-shell/kill_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #stop all device 4 | kill -9 $(pidof -s logger_tool) 5 | kill -9 $(pidof -s local_device) 6 | kill -9 $(pidof -s main_process) 7 | kill -9 $(pidof -s lower_device) 8 | kill -9 $(pidof -s mosquitto) 9 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/platform-shell/qemu-nogui.sh: -------------------------------------------------------------------------------- 1 | kernel_file="${BUILD_TFTP_PATH}/zImage" 2 | dtb_file="${BUILD_TFTP_PATH}/imx6ull-qemu.dtb" 3 | rootfs_file="${SUPPORT_ENV_PACKAGE}/buildroot.img" 4 | 5 | #nogui 6 | qemu-system-arm -M mcimx6ul-evk -m 512M -kernel "${kernel_file}" \ 7 | -dtb "${dtb_file}" \ 8 | -nographic -serial mon:stdio \ 9 | -drive file="${rootfs_file}",format=raw,id=mysdcard -device sd-card,drive=mysdcard \ 10 | -append "console=ttymxc0,115200 rootfstype=ext4 root=/dev/mmcblk1 rw rootwait init=/sbin/init loglevel=8" 11 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/platform-shell/start_app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #stop all device 4 | kill -9 $(pidof -s logger_tool) 5 | kill -9 $(pidof -s local_device) 6 | kill -9 $(pidof -s main_process) 7 | kill -9 $(pidof -s lower_device) 8 | kill -9 $(pidof -s mosquitto) 9 | 10 | if [ ! -d /tmp/app ]; then 11 | mkdir -p /tmp/app 12 | fi 13 | 14 | #start application 15 | /usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf & 16 | 17 | sleep 1 18 | 19 | #start all device 20 | /home/sys/executable/logger_tool -f /home/sys/configs/config.json & 21 | sleep 2 22 | /home/sys/executable/local_device -f /home/sys/configs/config.json & 23 | sleep 2 24 | /home/sys/executable/main_process -f /home/sys/configs/config.json & 25 | sleep 2 26 | 27 | #run server.js 28 | cd /home/sys/server/ 29 | if [ ! -d /home/sys/server/node_module ]; then 30 | if [ -f node_modules.tar ]; then 31 | tar -xvf node_modules.tar 32 | fi 33 | fi 34 | #/usr/bin/node/bin/node main.js & 35 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/uboot-imx-lf_v2022.04-patch.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/platform/I.MX6ULL/uboot-imx-lf_v2022.04-patch.7z -------------------------------------------------------------------------------- /platform/I.MX6ULL/uboot-imx-lf_v2022.04-patch/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/platform/I.MX6ULL/uboot-imx-lf_v2022.04-patch/README.md -------------------------------------------------------------------------------- /platform/I.MX6ULL/uboot-imx-lf_v2022.04-patch/arch/arm/dts/imx6ull-14x14-rmk-emmc.dts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 NXP 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | */ 9 | /dts-v1/; 10 | 11 | #include "imx6ull.dtsi" 12 | #include "imx6ul-14x14-rmk.dtsi" 13 | 14 | / { 15 | model = "i.MX6 ULL 14x14 RMK Board"; 16 | compatible = "fsl,imx6ull-14x14-rmk", "fsl,imx6ull"; 17 | }; 18 | 19 | &{/aliases} { 20 | u-boot,dm-pre-reloc; 21 | display0 = &lcdif; 22 | }; 23 | 24 | &{/soc} { 25 | u-boot,dm-pre-reloc; 26 | }; 27 | 28 | &aips2 { 29 | u-boot,dm-pre-reloc; 30 | }; 31 | 32 | &iomuxc { 33 | u-boot,dm-pre-reloc; 34 | }; 35 | 36 | &clks { 37 | assigned-clocks = <&clks IMX6UL_CLK_PLL3_PFD2>; 38 | assigned-clock-rates = <320000000>; 39 | }; 40 | 41 | &usdhc2 { 42 | pinctrl-names = "default", "state_100mhz", "state_200mhz"; 43 | pinctrl-0 = <&pinctrl_usdhc2_8bit>; 44 | pinctrl-1 = <&pinctrl_usdhc2_8bit_100mhz>; 45 | pinctrl-2 = <&pinctrl_usdhc2_8bit_200mhz>; 46 | bus-width = <8>; 47 | non-removable; 48 | status = "okay"; 49 | }; 50 | 51 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/uboot-imx-lf_v2022.04-patch/arch/arm/dts/imx6ull-14x14-rmk-nand.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0 2 | // 3 | // Copyright (C) 2016 Freescale Semiconductor, Inc. 4 | 5 | #include "imx6ull-14x14-rmk-emmc.dts" 6 | 7 | / { 8 | memory@80000000 { 9 | device_type = "memory"; 10 | reg = <0x80000000 0x10000000>; 11 | }; 12 | }; 13 | 14 | &gpmi { 15 | pinctrl-names = "default"; 16 | pinctrl-0 = <&pinctrl_gpmi_nand_1>; 17 | status = "okay"; 18 | nand-on-flash-bbt; 19 | fsl,use-minimum-ecc; 20 | }; 21 | 22 | &iomuxc { 23 | pinctrl_gpmi_nand_1: gpmi-nand-1 { 24 | fsl,pins = < 25 | MX6UL_PAD_NAND_CLE__RAWNAND_CLE 0xb0b1 26 | MX6UL_PAD_NAND_ALE__RAWNAND_ALE 0xb0b1 27 | MX6UL_PAD_NAND_WP_B__RAWNAND_WP_B 0xb0b1 28 | MX6UL_PAD_NAND_READY_B__RAWNAND_READY_B 0xb000 29 | MX6UL_PAD_NAND_CE0_B__RAWNAND_CE0_B 0xb0b1 30 | MX6UL_PAD_NAND_CE1_B__RAWNAND_CE1_B 0xb0b1 31 | MX6UL_PAD_NAND_RE_B__RAWNAND_RE_B 0xb0b1 32 | MX6UL_PAD_NAND_WE_B__RAWNAND_WE_B 0xb0b1 33 | MX6UL_PAD_NAND_DATA00__RAWNAND_DATA00 0xb0b1 34 | MX6UL_PAD_NAND_DATA01__RAWNAND_DATA01 0xb0b1 35 | MX6UL_PAD_NAND_DATA02__RAWNAND_DATA02 0xb0b1 36 | MX6UL_PAD_NAND_DATA03__RAWNAND_DATA03 0xb0b1 37 | MX6UL_PAD_NAND_DATA04__RAWNAND_DATA04 0xb0b1 38 | MX6UL_PAD_NAND_DATA05__RAWNAND_DATA05 0xb0b1 39 | MX6UL_PAD_NAND_DATA06__RAWNAND_DATA06 0xb0b1 40 | MX6UL_PAD_NAND_DATA07__RAWNAND_DATA07 0xb0b1 41 | >; 42 | }; 43 | }; 44 | 45 | &qspi { 46 | status = "disabled"; 47 | }; 48 | 49 | &usdhc2 { 50 | status = "disabled"; 51 | }; 52 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/uboot-imx-lf_v2022.04-patch/board/freescale/mx6ullrmk/Kconfig: -------------------------------------------------------------------------------- 1 | if TARGET_MX6ULL_14X14_RMK || TARGET_MX6ULL_9X9_EVK 2 | 3 | config SYS_BOARD 4 | default "mx6ullrmk" 5 | 6 | config SYS_VENDOR 7 | default "freescale" 8 | 9 | config SYS_CONFIG_NAME 10 | default "mx6ullrmk" 11 | 12 | config IMX_CONFIG 13 | default "board/freescale/mx6ullrmk/imximage.cfg" 14 | 15 | config SYS_TEXT_BASE 16 | default 0x87800000 17 | endif 18 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/uboot-imx-lf_v2022.04-patch/board/freescale/mx6ullrmk/MAINTAINERS: -------------------------------------------------------------------------------- 1 | MX6ULLEVK BOARD 2 | M: Peng Fan 3 | S: Maintained 4 | F: board/freescale/mx6ullrmk/ 5 | F: include/configs/mx6ullrmk.h 6 | F: configs/mx6ull_14x14_rmk_defconfig 7 | F: configs/mx6ull_14x14_rmk_plugin_defconfig 8 | F: configs/mx6ulz_14x14_evk_defconfig 9 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/uboot-imx-lf_v2022.04-patch/board/freescale/mx6ullrmk/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0+ 2 | # (C) Copyright 2016 Freescale Semiconductor, Inc. 3 | 4 | obj-y := mx6ullrmk.o 5 | -------------------------------------------------------------------------------- /platform/I.MX6ULL/uboot-imx-lf_v2022.04-patch/uboot_upgrade.sh: -------------------------------------------------------------------------------- 1 | 2 | PLATFORM_BOOT=$(pwd) 3 | 4 | SRC_DIR=${PLATFORM_BOOT} 5 | DST_DIR=${SUPPORT_ENV_BOOT_DIR} 6 | 7 | echo "start copy u-boot patch..." 8 | 9 | #configs 10 | cp -fv ${SRC_DIR}/configs/* ${DST_DIR}/configs/ 11 | 12 | #dts 13 | cp -fv ${SRC_DIR}/arch/arm/dts/* ${DST_DIR}/arch/arm/dts/ 14 | cp -fv ${SRC_DIR}/arch/arm/mach-imx/mx6/Kconfig ${DST_DIR}/arch/arm/mach-imx/mx6/ 15 | 16 | #drivers 17 | cp -fv ${SRC_DIR}/drivers/net/phy/phy.c ${DST_DIR}/drivers/net/phy/ 18 | 19 | #include 20 | cp -fv ${SRC_DIR}/include/configs/mx6ullrmk.h ${DST_DIR}/include/configs/ 21 | 22 | #board 23 | if [ ! -d ${DST_DIR}/board/freescale/mx6ullrmk/ ]; then 24 | mkdir -p ${DST_DIR}/board/freescale/mx6ullrmk 25 | fi 26 | cp -rfv ${SRC_DIR}/board/freescale/mx6ullrmk/* ${DST_DIR}/board/freescale/mx6ullrmk/ 27 | 28 | #configs 29 | if [ ! -d "${DST_DIR}/.vscode" ]; then 30 | mkdir -p "${DST_DIR}/.vscode" 31 | fi 32 | cp -rv ${SRC_DIR}/.vscode/settings.json ${DST_DIR}/.vscode/ 33 | 34 | echo "end copy u-boot patch, success!" 35 | sleep 1 -------------------------------------------------------------------------------- /platform/README.md: -------------------------------------------------------------------------------- 1 | # platform 2 | 3 | ## U-Boot 4 | 5 | U-Boot下载适配方法。 6 | 7 | ```shell 8 | #解压U-Boot 9 | wget https://codeload.github.com/nxp-imx/uboot-imx/zip/refs/heads/lf_v2022.04 10 | unzip lf_v2022.04 11 | cd uboot-imx-lf_v2022.04/ 12 | 13 | #将uboot-imx-lf_v2022.04-patch目录下内容复制到上述目录下 14 | 15 | #执行编译 16 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- mx6ull_14x14_rmk_emmc_defconfig 17 | make -j8 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- 18 | ``` 19 | 20 | ## Linux 21 | 22 | Linux下载适配方法。 23 | 24 | ```shell 25 | #解压U-Boot 26 | wget https://codeload.github.com/nxp-imx/linux-imx/zip/refs/heads/lf-6.1.y 27 | unzip linux-imx-lf-6.1.y.zip 28 | cd linux-imx-lf-6.1.y/ 29 | 30 | #将linux-imx-lf-6.1.y-patch目录下内容复制到上述目录下 31 | 32 | #执行编译 33 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- imx_rmk_v7_defconfig 34 | make -j8 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- 35 | ``` 36 | -------------------------------------------------------------------------------- /platform/RK3568/README.md: -------------------------------------------------------------------------------- 1 | # platform 2 | 3 | ## U-Boot 4 | 5 | U-Boot下载适配方法。 6 | 7 | ```shell 8 | #解压U-Boot 9 | wget https://codeload.github.com/nxp-imx/uboot-imx/zip/refs/heads/lf_v2022.04 10 | unzip lf_v2022.04 11 | cd uboot-imx-lf_v2022.04/ 12 | 13 | #将uboot-imx-lf_v2022.04-patch目录下内容复制到上述目录下 14 | 15 | #执行编译 16 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- mx6ull_14x14_rmk_emmc_defconfig 17 | make -j8 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- 18 | ``` 19 | 20 | ## Linux 21 | 22 | Linux下载适配方法。 23 | 24 | ```shell 25 | #解压U-Boot 26 | wget https://codeload.github.com/nxp-imx/linux-imx/zip/refs/heads/lf-6.1.y 27 | unzip linux-imx-lf-6.1.y.zip 28 | cd linux-imx-lf-6.1.y/ 29 | 30 | #将linux-imx-lf-6.1.y-patch目录下内容复制到上述目录下 31 | 32 | #执行编译 33 | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- imx_rmk_v7_defconfig 34 | make -j8 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- 35 | ``` 36 | -------------------------------------------------------------------------------- /platform/RK3568/linux/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "**/.git": true, 4 | "**/.svn": true, 5 | "**/.hg": true, 6 | "**/CVS": true, 7 | "**/.DS_Store": true, 8 | "**/Thumbs.db": true, 9 | "**/.tmp_versions": true, 10 | "**/scripts":true, 11 | "**/*.cmd":true, 12 | "**/*.tmp":true, 13 | "**/*.dtb":true, 14 | 15 | "arch/[!a]*":true, 16 | "arch/arm/*":true, 17 | "arch/arc/*":true, 18 | "arch/alpha/*":true, 19 | "arch/arm64/boot/dts/[!r]*":true, 20 | "arch/arm64/boot/dts/r[!o]*":true, 21 | "arch/arm64/boot/dts/rockchip/[!r]*":true, 22 | "arch/arm64/boot/dts/rockchip/rk[!3]*":true, 23 | "arch/arm64/boot/dts/rockchip/rk3[!5]*":true, 24 | "arch/arm64/boot/dts/rockchip/rk35[!6]*":true, 25 | "arch/arm64/boot/dts/rockchip/rk356[!8]*":true, 26 | "arch/arm64/boot/dts/rockchip/rk3568-[e,n,t,i,l]*":true, 27 | "arch/arm64/boot/dts/rockchip/rk3568-a[m,n]*":true, 28 | }, 29 | 30 | "search.exclude": { 31 | "**/node_modules": true, 32 | "**/bower_components": true, 33 | "**/*.code-search": true, 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /rootfs/etc/README.md: -------------------------------------------------------------------------------- 1 | # etc 2 | 3 | 在Linux系统中,/etc目录是用来存放所有的系统管理所需要的配置文件和子目录。它基本上包含所有硬件和软件配置文件。 4 | 5 | 一些主要的文件和目录包括: 6 | 7 | - /etc/resolv.conf:这是DNS配置文件,用于在网卡配置文件中进行配置。 8 | - /etc/hostname:配置主机名。 9 | - /etc/hosts:存储ip与域名对应的关系,用于解析域名(主机名),可以用/etc/hosts搭建网站的测试环境(虚拟机)。 10 | - /etc/fstab:文件系统挂载表,开机的时候设备与入口对应关系开机自动挂载列表。 11 | - /etc/rc.local:开机自启。 12 | - /etc/inittab:运行级别的配置文件。 13 | - /etc/profile:环境变量配置文件。 14 | - /etc/bashrc:命令别名。 15 | - /etc/motd:文件中的内容会在用户登录系统之后显示出来。 16 | - /etc/issue和/etc/issue.net:文件中的内容会在用户登录系统之前显示出来 17 | -------------------------------------------------------------------------------- /rootfs/etc/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 8.8.8.8 2 | -------------------------------------------------------------------------------- /rootfs/home/sys/configs/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/rootfs/home/sys/configs/README.md -------------------------------------------------------------------------------- /rootfs/home/sys/configs/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "logger_privilege": { 3 | "gui_manage_level":2, 4 | "local_device_level":2, 5 | "logger_device_level":2, 6 | "lower_device_level":2, 7 | "main_process_level":2, 8 | "node_server_level":2 9 | }, 10 | "logger_manage": { 11 | "passwd":"user123", 12 | "allow_no_passed":false 13 | } 14 | } -------------------------------------------------------------------------------- /rootfs/home/sys/env/defineAlias: -------------------------------------------------------------------------------- 1 | 2 | #------------------------------------------------------------------------------- 3 | # alias global command. 4 | #------------------------------------------------------------------------------- 5 | # export ENV_PATH_CONFIGS=$ENV_PATH_ROOT/configs 6 | # export ENV_PATH_EXE=$ENV_PATH_ROOT/executable 7 | # export ENV_PATH_MODULES=$ENV_PATH_ROOT/modules 8 | # export ENV_PATH_SERVER=$ENV_PATH_ROOT/server 9 | alias cdc="cd $ENV_PATH_CONFIGS" 10 | alias cde="cd $ENV_PATH_EXE" 11 | alias cdm="cd $ENV_PATH_MODULES" 12 | alias cds="cd $ENV_PATH_SERVER" 13 | 14 | function SysRunStart() 15 | { 16 | SysRunStop 17 | 18 | if [ ! -d /tmp/app ]; then 19 | mkdir -p /tmp/app 20 | fi 21 | 22 | #start application 23 | mosquitto -c /etc/mosquitto/mosquitto.conf & 24 | 25 | sleep 1 26 | 27 | #start all device 28 | /home/sys/executable/logger_tool -f /home/sys/configs/config.json & 29 | sleep 2 30 | /home/sys/executable/local_device -f /home/sys/configs/config.json & 31 | sleep 2 32 | /home/sys/executable/main_process -f /home/sys/configs/config.json & 33 | sleep 2 34 | 35 | #run server.js 36 | # cd /home/sys/server 37 | # /usr/bin/node/bin/node server.js & 38 | } 39 | alias SysRunStart="SysRunStart" 40 | 41 | function SysRunStop() 42 | { 43 | #stop all device 44 | pkill -9 main_process 45 | pkill -9 local_device 46 | pkill -9 logger_tool 47 | pkill -9 mosquitto 48 | } 49 | alias SysRunStop="SysRunStop" -------------------------------------------------------------------------------- /rootfs/home/sys/env/defineEnvVars: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This file is used to define global vars, if want to create the build system, 3 | # also need update the file. 4 | # 5 | ################################################################################ 6 | 7 | echo "Load the Env Data..." 8 | 9 | #------------------------------------------------------------------------------- 10 | # This section defined the global variable. 11 | #------------------------------------------------------------------------------- 12 | export ENV_PATH_CONFIGS=$ENV_PATH_ROOT/configs 13 | export ENV_PATH_EXE=$ENV_PATH_ROOT/executable 14 | export ENV_PATH_MODULES=$ENV_PATH_ROOT/modules 15 | export ENV_PATH_SERVER=$ENV_PATH_ROOT/server 16 | 17 | #------------------------------------------------------------------------------- 18 | # This section defined the word color. 19 | #------------------------------------------------------------------------------- 20 | readonly defText="$(tput sgr0)" 21 | readonly redText="$(tput setaf 1)" 22 | readonly greenText="$(tput setaf 2)" 23 | readonly yellowText="$(tput setaf 3)" 24 | readonly limityellowText="$(tput setaf 190)" 25 | readonly powerblueText="$(tput setaf 153)" 26 | readonly blueText="$(tput setaf 4)" 27 | readonly magentaText="$(tput setaf 5)" 28 | readonly cyanText="$(tput setaf 6)" 29 | readonly whiteText="$(tput setaf 7)" 30 | readonly brightText="$(tput bold)" 31 | readonly blinkText="$(tput blink)" 32 | readonly reverseText="$(tput smso)" 33 | readonly underlineText="$(tput smul)" 34 | 35 | #------------------------------------------------------------------------------- 36 | # Env Vars define finish shows 37 | #------------------------------------------------------------------------------- 38 | echo "Update Environment Data Success!" 39 | echo "Can use command '${greenText}SysHelpCommand${defText}' for more helps." 40 | -------------------------------------------------------------------------------- /rootfs/home/sys/executable/README.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 3 | 放置arm 32位系统平台编译后文件。 4 | -------------------------------------------------------------------------------- /rootfs/home/sys/logger/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/rootfs/home/sys/logger/README.md -------------------------------------------------------------------------------- /rootfs/home/sys/modules/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/rootfs/home/sys/modules/README.md -------------------------------------------------------------------------------- /rootfs/home/sys/server/README.md: -------------------------------------------------------------------------------- 1 | # remote_manage 2 | 3 | ## web服务应用的实现 4 | ### 安装node到嵌入式平台 5 | web应用服务主要包含后端应用和前端界面实现.
6 | 后端应用基于node.js的服务器应用,由两部分组成.
7 | 1.作为客户端维持和设备管理模块的可靠连接(TCP+心跳包).
8 | 2.支持服务端允许前端界面获取信息刷新(短连接,请求刷新).
9 | 前端主要是包含控制和显示的管理界面,计划采用vue实现.
10 | 支持嵌入式平台运行的node可通过在嵌入式平台执行如下命令下载,如我使用的是13.14版本,命令如下.
11 | ```bash 12 | wget https://nodejs.org/dist/latest-v13.x/node-v13.14.0-linux-armv7l.tar.gz 13 | tar -xvf node-v13.14.0-linux-armv7l.tar.gz 14 | ln -sf [install]/bin/node /usr/bin/node 15 | node -v 16 | ``` 17 | 如果能够正常显示版本信息,表示node安装成功.
18 | 19 | ### 启动服务器 20 | 如果在PC平台测试,直接在lower_app/server目录下,执行.
21 | ```bash 22 | node server.js 23 | ``` 24 | 如果显示如下.
25 | ``` 26 | node server start! 27 | server listen ip:127.0.0.1, port 15,060 28 | ``` 29 | 则表示启动成功,此时通过在浏览器输入127.0.0.1:15060访问页面.
30 | 在嵌入式linux平台,需要将config.json中的ip地址修改为嵌入式平台ip地址,在通过上诉命令测试.
-------------------------------------------------------------------------------- /thirdparts/README.md: -------------------------------------------------------------------------------- 1 | # thirdparts 2 | 3 | 本目录下用于保存第三方构建的应用,对于应用执行,需要的第三方库包含如下。 4 | 5 | - openssl, 提供加解密的库,以动态库形式提供。 6 | - zlib, 用于解压缩的库,以动态库形式提供。 7 | - openssh,提供远程访问的服务器。 8 | - cJSON, 基于C语言实现的json解析库,mosquitto编译时需要。 9 | - jsoncpp,基于CPP实现的json解析库。 10 | - mosquitto,mqtt服务和应用接口。 11 | - asio, 提供socket应用的接口。 12 | 13 | 在交叉编译前,系统已经创建以下变量如下。 14 | 15 | - PROGRAM_DOWNLOAD=/home/program/download 16 | - APPLICATION_ROOTFS=${ENV_PATH_ROOT}/rootfs 17 | - SUPPORT_ENV_INSTALL=${PROGRAM_PATH}/install/arm 18 | 19 | 详细脚本见preThirdParts.sh. 20 | -------------------------------------------------------------------------------- /thirdparts/cJSON-master/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2017 Dave Gamble and cJSON contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /thirdparts/jsoncpp.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zc110747/remote_manage/7225400ce93e1c1d24b553d4f8ffb587d5a24756/thirdparts/jsoncpp.tar.bz2 --------------------------------------------------------------------------------