├── .clang-format ├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ └── release.yml ├── .gitignore ├── .gitmodules ├── .readthedocs.yaml ├── .vscode ├── c_cpp_properties.json ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── AUTHORS ├── CHANGELOG.md ├── CMakeLists.txt ├── CMakePresets.json ├── LICENSE ├── README.md ├── cmake ├── i686-w64-mingw32-gcc.cmake └── x86_64-w64-mingw32-gcc.cmake ├── dev ├── lwcell_opts.h ├── lwmem_opts.h └── main.c ├── docs ├── 4a-esp8266_at_instruction_set_en.pdf ├── Makefile ├── SIM800 Series_AT Command Manual_V1.09.pdf ├── SIM900_TCPIP_Application Note_V1.02.pdf ├── Telit_NE866B1_NL865B1_AT_Commands_Refernce_Guide_r4.pdf ├── api-reference │ ├── apps │ │ ├── index.rst │ │ ├── mqtt_client.rst │ │ ├── mqtt_client_api.rst │ │ └── netconn.rst │ ├── index.rst │ ├── lwcell │ │ ├── buff.rst │ │ ├── conn.rst │ │ ├── debug.rst │ │ ├── device_info.rst │ │ ├── evt.rst │ │ ├── ftp.rst │ │ ├── http.rst │ │ ├── index.rst │ │ ├── input.rst │ │ ├── mem.rst │ │ ├── network.rst │ │ ├── network_api.rst │ │ ├── operator.rst │ │ ├── pbuf.rst │ │ ├── phonebook.rst │ │ ├── ping.rst │ │ ├── sim.rst │ │ ├── sms.rst │ │ ├── timeout.rst │ │ ├── types.rst │ │ ├── unicode.rst │ │ ├── ussd.rst │ │ └── utils.rst │ ├── opt.rst │ └── port │ │ ├── index.rst │ │ ├── ll.rst │ │ └── sys.rst ├── authors │ └── index.rst ├── changelog │ └── index.rst ├── conf.py ├── doxyfile.doxy ├── examples │ └── index.rst ├── examples_src │ ├── command_blocking.c │ ├── command_nonblocking.c │ ├── command_nonblocking_bad.c │ ├── config.h │ ├── conn_write.c │ ├── debug.c │ ├── debug_opts.h │ ├── evt.c │ ├── mem.c │ ├── pbuf_cat.c │ ├── pbuf_chain.c │ └── pbuf_extract.c ├── get-started │ └── index.rst ├── index.rst ├── make.bat ├── mqtt-v3.1.1-os.pdf ├── requirements.txt ├── sim800_series_tcpip_application_note_v1.00.pdf ├── static │ ├── css │ │ ├── common.css │ │ └── custom.css │ ├── dark-light │ │ ├── checked.svg │ │ ├── common-dark-light.css │ │ ├── dark-mode-toggle.mjs │ │ ├── dark.css │ │ ├── light.css │ │ ├── moon.png │ │ ├── moon.svg │ │ ├── sun.png │ │ ├── sun.svg │ │ └── unchecked.svg │ └── images │ │ ├── example_app_arch.svg │ │ ├── example_app_arch.xml │ │ ├── logo.drawio │ │ ├── logo.svg │ │ ├── logo_tm.png │ │ ├── logo_tm_full.png │ │ ├── memory_manager_structure.svg │ │ ├── memory_manager_structure.xml │ │ ├── memory_manager_structure_freeing.svg │ │ ├── memory_manager_structure_freeing.xml │ │ ├── netconn_client.svg │ │ ├── netconn_client.xml │ │ ├── pbuf_block_diagram.svg │ │ ├── pbuf_block_diagram.xml │ │ ├── pbuf_block_diagram_after_free.svg │ │ ├── pbuf_block_diagram_after_free.xml │ │ ├── pbuf_cat_vs_chain_1.svg │ │ ├── pbuf_cat_vs_chain_1.xml │ │ ├── pbuf_cat_vs_chain_2.svg │ │ ├── pbuf_cat_vs_chain_2.xml │ │ ├── pbuf_cat_vs_chain_3.svg │ │ ├── pbuf_cat_vs_chain_3.xml │ │ ├── system_structure.svg │ │ ├── system_structure.xml │ │ ├── thread_communication.svg │ │ └── thread_communication.xml ├── ts_127007v100300p.pdf └── user-manual │ ├── architecture.rst │ ├── blocking-nonblocking.rst │ ├── events-cb-fn.rst │ ├── index.rst │ ├── inter-thread-comm.rst │ ├── overview.rst │ └── porting-guide.rst ├── examples ├── lib │ ├── FreeRTOS │ │ ├── CMSIS_RTOS │ │ │ ├── cmsis_os.c │ │ │ ├── cmsis_os.h │ │ │ ├── cpu_utils.c │ │ │ └── cpu_utils.h │ │ ├── CMSIS_RTOS_V2 │ │ │ ├── cmsis_os.h │ │ │ ├── cmsis_os2.c │ │ │ └── cmsis_os2.h │ │ ├── croutine.c │ │ ├── event_groups.c │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── FreeRTOSConfig_template.h │ │ │ ├── StackMacros.h │ │ │ ├── croutine.h │ │ │ ├── deprecated_definitions.h │ │ │ ├── event_groups.h │ │ │ ├── list.h │ │ │ ├── message_buffer.h │ │ │ ├── mpu_prototypes.h │ │ │ ├── mpu_wrappers.h │ │ │ ├── portable.h │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ ├── stack_macros.h │ │ │ ├── stdint.readme │ │ │ ├── stream_buffer.h │ │ │ ├── task.h │ │ │ └── timers.h │ │ ├── list.c │ │ ├── portable │ │ │ ├── Common │ │ │ │ └── mpu_wrappers.c │ │ │ ├── GCC │ │ │ │ └── ARM_CM4F │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ └── MemMang │ │ │ │ ├── ReadMe.url │ │ │ │ ├── heap_1.c │ │ │ │ ├── heap_2.c │ │ │ │ ├── heap_3.c │ │ │ │ ├── heap_4.c │ │ │ │ └── heap_5.c │ │ ├── queue.c │ │ ├── stream_buffer.c │ │ ├── tasks.c │ │ └── timers.c │ └── st │ │ ├── CMSIS │ │ ├── Device │ │ │ └── ST │ │ │ │ └── STM32F4xx │ │ │ │ └── Include │ │ │ │ ├── stm32f429xx.h │ │ │ │ ├── stm32f4xx.h │ │ │ │ └── system_stm32f4xx.h │ │ └── Include │ │ │ ├── arm_common_tables.h │ │ │ ├── arm_const_structs.h │ │ │ ├── arm_math.h │ │ │ ├── cmsis_armcc.h │ │ │ ├── cmsis_armcc_V6.h │ │ │ ├── cmsis_armclang.h │ │ │ ├── cmsis_compiler.h │ │ │ ├── cmsis_gcc.h │ │ │ ├── cmsis_iccarm.h │ │ │ ├── cmsis_version.h │ │ │ ├── core_armv8mbl.h │ │ │ ├── core_armv8mml.h │ │ │ ├── core_cm0.h │ │ │ ├── core_cm0plus.h │ │ │ ├── core_cm1.h │ │ │ ├── core_cm23.h │ │ │ ├── core_cm3.h │ │ │ ├── core_cm33.h │ │ │ ├── core_cm4.h │ │ │ ├── core_cm7.h │ │ │ ├── core_cmFunc.h │ │ │ ├── core_cmInstr.h │ │ │ ├── core_cmSimd.h │ │ │ ├── core_sc000.h │ │ │ ├── core_sc300.h │ │ │ ├── mpu_armv7.h │ │ │ ├── mpu_armv8.h │ │ │ └── tz_context.h │ │ └── STM32F4xx_HAL_Driver │ │ ├── Inc │ │ ├── stm32f4xx_ll_bus.h │ │ ├── stm32f4xx_ll_cortex.h │ │ ├── stm32f4xx_ll_dma.h │ │ ├── stm32f4xx_ll_exti.h │ │ ├── stm32f4xx_ll_gpio.h │ │ ├── stm32f4xx_ll_pwr.h │ │ ├── stm32f4xx_ll_rcc.h │ │ ├── stm32f4xx_ll_system.h │ │ ├── stm32f4xx_ll_usart.h │ │ └── stm32f4xx_ll_utils.h │ │ └── Src │ │ ├── stm32f4xx_ll_dma.c │ │ ├── stm32f4xx_ll_exti.c │ │ ├── stm32f4xx_ll_gpio.c │ │ ├── stm32f4xx_ll_pwr.c │ │ ├── stm32f4xx_ll_rcc.c │ │ ├── stm32f4xx_ll_usart.c │ │ └── stm32f4xx_ll_utils.c ├── stm32 │ ├── mqtt_client_api_rtos_stm32f429zi_nucleo │ │ ├── .vscode │ │ │ ├── c_cpp_properties.json │ │ │ ├── extensions.json │ │ │ ├── launch.json │ │ │ └── tasks.json │ │ ├── CMakeLists.txt │ │ ├── CMakePresets.json │ │ ├── STM32CubeIDE │ │ │ ├── .cproject │ │ │ ├── .project │ │ │ ├── Debug_STM32F429ZI_FLASH.ld │ │ │ └── startup │ │ │ │ └── startup_stm32f429xx.s │ │ ├── cmake │ │ │ └── gcc-arm-none-eabi.cmake │ │ ├── inc │ │ │ ├── FreeRTOSConfig.h │ │ │ ├── lwcell_opts.h │ │ │ ├── main.h │ │ │ ├── stm32_assert.h │ │ │ ├── stm32f4xx_hal_conf.h │ │ │ └── stm32f4xx_it.h │ │ └── src │ │ │ ├── main.c │ │ │ ├── stm32f4xx_it.c │ │ │ ├── syscalls.c │ │ │ └── system_stm32f4xx.c │ ├── netconn_client_rtos_stm32f429zi_nucleo │ │ ├── .vscode │ │ │ ├── c_cpp_properties.json │ │ │ ├── extensions.json │ │ │ ├── launch.json │ │ │ └── tasks.json │ │ ├── CMakeLists.txt │ │ ├── CMakePresets.json │ │ ├── STM32CubeIDE │ │ │ ├── .cproject │ │ │ ├── .project │ │ │ ├── Debug_STM32F429ZI_FLASH.ld │ │ │ └── startup │ │ │ │ └── startup_stm32f429xx.s │ │ ├── cmake │ │ │ └── gcc-arm-none-eabi.cmake │ │ ├── inc │ │ │ ├── FreeRTOSConfig.h │ │ │ ├── lwcell_opts.h │ │ │ ├── main.h │ │ │ ├── stm32_assert.h │ │ │ ├── stm32f4xx_hal_conf.h │ │ │ └── stm32f4xx_it.h │ │ └── src │ │ │ ├── main.c │ │ │ ├── stm32f4xx_it.c │ │ │ ├── syscalls.c │ │ │ └── system_stm32f4xx.c │ ├── sms_send_receive_rtos_stm32f429zi_nucleo │ │ ├── .vscode │ │ │ ├── c_cpp_properties.json │ │ │ ├── extensions.json │ │ │ ├── launch.json │ │ │ └── tasks.json │ │ ├── CMakeLists.txt │ │ ├── CMakePresets.json │ │ ├── STM32CubeIDE │ │ │ ├── .cproject │ │ │ ├── .project │ │ │ ├── Debug_STM32F429ZI_FLASH.ld │ │ │ └── startup │ │ │ │ └── startup_stm32f429xx.s │ │ ├── cmake │ │ │ └── gcc-arm-none-eabi.cmake │ │ ├── inc │ │ │ ├── FreeRTOSConfig.h │ │ │ ├── lwcell_opts.h │ │ │ ├── main.h │ │ │ ├── stm32_assert.h │ │ │ ├── stm32f4xx_hal_conf.h │ │ │ └── stm32f4xx_it.h │ │ └── src │ │ │ ├── main.c │ │ │ ├── stm32f4xx_it.c │ │ │ ├── syscalls.c │ │ │ └── system_stm32f4xx.c │ └── sms_send_receive_thread_rtos_stm32f429zi_nucleo │ │ ├── .vscode │ │ ├── c_cpp_properties.json │ │ ├── extensions.json │ │ ├── launch.json │ │ └── tasks.json │ │ ├── CMakeLists.txt │ │ ├── CMakePresets.json │ │ ├── STM32CubeIDE │ │ ├── .cproject │ │ ├── .project │ │ ├── Debug_STM32F429ZI_FLASH.ld │ │ └── startup │ │ │ └── startup_stm32f429xx.s │ │ ├── cmake │ │ └── gcc-arm-none-eabi.cmake │ │ ├── inc │ │ ├── FreeRTOSConfig.h │ │ ├── lwcell_opts.h │ │ ├── main.h │ │ ├── stm32_assert.h │ │ ├── stm32f4xx_hal_conf.h │ │ └── stm32f4xx_it.h │ │ └── src │ │ ├── main.c │ │ ├── stm32f4xx_it.c │ │ ├── syscalls.c │ │ └── system_stm32f4xx.c └── win32 │ ├── .vscode │ ├── c_cpp_properties.json │ ├── extensions.json │ ├── launch.json │ ├── settings.json │ └── tasks.json │ ├── CMakeLists.txt │ ├── CMakePresets.json │ ├── README.md │ ├── build_all_examples.py │ ├── call_rtos │ ├── lwcell_opts.h │ └── main.c │ ├── call_sms_rtos │ ├── lwcell_opts.h │ └── main.c │ ├── device_info_rtos │ ├── lwcell_opts.h │ └── main.c │ ├── mqtt_client_api_rtos │ ├── lwcell_opts.h │ └── main.c │ ├── netconn_client_rtos │ ├── lwcell_opts.h │ └── main.c │ └── sms_send_receive_rtos │ ├── lwcell_opts.h │ └── main.c ├── library.json ├── lwcell ├── CMakeLists.txt ├── library.cmake └── src │ ├── api │ ├── lwcell_netconn.c │ └── lwcell_network_api.c │ ├── apps │ └── mqtt │ │ ├── lwcell_mqtt_client.c │ │ ├── lwcell_mqtt_client_api.c │ │ └── lwcell_mqtt_client_evt.c │ ├── include │ ├── lwcell │ │ ├── apps │ │ │ ├── lwcell_apps.h │ │ │ ├── lwcell_mqtt_client.h │ │ │ ├── lwcell_mqtt_client_api.h │ │ │ └── lwcell_mqtt_client_evt.h │ │ ├── lwcell.h │ │ ├── lwcell_buff.h │ │ ├── lwcell_call.h │ │ ├── lwcell_conn.h │ │ ├── lwcell_debug.h │ │ ├── lwcell_debug_types.h │ │ ├── lwcell_device_info.h │ │ ├── lwcell_evt.h │ │ ├── lwcell_ftp.h │ │ ├── lwcell_http.h │ │ ├── lwcell_includes.h │ │ ├── lwcell_input.h │ │ ├── lwcell_int.h │ │ ├── lwcell_mem.h │ │ ├── lwcell_memories.h │ │ ├── lwcell_models.h │ │ ├── lwcell_mqtt.h │ │ ├── lwcell_netconn.h │ │ ├── lwcell_network.h │ │ ├── lwcell_network_api.h │ │ ├── lwcell_operator.h │ │ ├── lwcell_opt.h │ │ ├── lwcell_opts_template.h │ │ ├── lwcell_parser.h │ │ ├── lwcell_pbuf.h │ │ ├── lwcell_phonebook.h │ │ ├── lwcell_ping.h │ │ ├── lwcell_private.h │ │ ├── lwcell_sim.h │ │ ├── lwcell_sms.h │ │ ├── lwcell_threads.h │ │ ├── lwcell_timeout.h │ │ ├── lwcell_types.h │ │ ├── lwcell_unicode.h │ │ ├── lwcell_ussd.h │ │ └── lwcell_utils.h │ └── system │ │ ├── lwcell_ll.h │ │ ├── lwcell_sys.h │ │ └── port │ │ ├── cmsis_os │ │ └── lwcell_sys_port.h │ │ ├── freeRTOS │ │ └── lwcell_sys_port.h │ │ ├── threadx │ │ └── lwcell_sys_port.h │ │ └── win32 │ │ └── lwcell_sys_port.h │ ├── lwcell │ ├── lwcell.c │ ├── lwcell_buff.c │ ├── lwcell_call.c │ ├── lwcell_conn.c │ ├── lwcell_debug.c │ ├── lwcell_device_info.c │ ├── lwcell_evt.c │ ├── lwcell_ftp.c │ ├── lwcell_http.c │ ├── lwcell_input.c │ ├── lwcell_int.c │ ├── lwcell_mem.c │ ├── lwcell_mqtt.c │ ├── lwcell_network.c │ ├── lwcell_operator.c │ ├── lwcell_parser.c │ ├── lwcell_pbuf.c │ ├── lwcell_phonebook.c │ ├── lwcell_ping.c │ ├── lwcell_sim.c │ ├── lwcell_sms.c │ ├── lwcell_threads.c │ ├── lwcell_timeout.c │ ├── lwcell_unicode.c │ ├── lwcell_ussd.c │ └── lwcell_utils.c │ └── system │ ├── lwcell_ll_esp32.c │ ├── lwcell_ll_stm32.c │ ├── lwcell_ll_stm32f429zi_nucleo.c │ ├── lwcell_ll_stm32h735g_dk_threadx.c │ ├── lwcell_ll_win32.c │ ├── lwcell_mem_lwmem.c │ ├── lwcell_mem_threadx.c │ ├── lwcell_sys_cmsis_os.c │ ├── lwcell_sys_freeRTOS.c │ ├── lwcell_sys_threadx.c │ └── lwcell_sys_win32.c └── snippets ├── CMakeLists.txt ├── call.c ├── call_sms.c ├── client.c ├── device_info.c ├── examples_common_lwcell_callback_func.c ├── include ├── call.h ├── call_sms.h ├── client.h ├── device_info.h ├── examples_common_lwcell_callback_func.h ├── mqtt_client_api.h ├── netconn_client.h ├── network_apn_settings.h ├── network_utils.h ├── sim_manager.h ├── sms_send_receive.h └── sms_send_receive_thread.h ├── mqtt_client_api.c ├── netconn_client.c ├── network_utils.c ├── sim_manager.c ├── sms_send_receive.c └── sms_send_receive_thread.c /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | custom: ['paypal.me/tilz0R'] 4 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | # Sequence of patterns matched against refs/tags 4 | tags: 5 | - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 6 | 7 | name: Create Release 8 | 9 | jobs: 10 | build: 11 | name: Create Release 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v2 16 | - name: Create Release 17 | id: create_release 18 | uses: actions/create-release@v1 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token 21 | with: 22 | tag_name: ${{ github.ref }} 23 | release_name: Release ${{ github.ref }} 24 | body: | 25 | See the [CHANGELOG](CHANGELOG.md) 26 | draft: false 27 | prerelease: false -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/.gitmodules -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | build: 3 | os: ubuntu-22.04 4 | tools: 5 | python: "3.11" 6 | 7 | # Build documentation in the docs/ directory with Sphinx 8 | sphinx: 9 | configuration: docs/conf.py 10 | 11 | # Python configuration 12 | python: 13 | install: 14 | - requirements: docs/requirements.txt 15 | 16 | formats: 17 | - pdf 18 | - epub 19 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "configurations": [ 4 | { 5 | /* 6 | * Full configuration is provided by CMake plugin for vscode, 7 | * that shall be installed by user 8 | */ 9 | "name": "Win32", 10 | "intelliSenseMode": "${default}", 11 | "configurationProvider": "ms-vscode.cmake-tools" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-vscode.cpptools", 4 | "ms-vscode.cmake-tools", 5 | "twxs.cmake", 6 | ] 7 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | /* GDB must in be in the PATH environment */ 6 | "name": "(Windows) Launch", 7 | "type": "cppdbg", 8 | "request": "launch", 9 | "program": "${command:cmake.launchTargetPath}", 10 | "args": [], 11 | "stopAtEntry": false, 12 | "cwd": "${fileDirname}", 13 | "environment": [] 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "lwevt_types.h": "c", 4 | "lwevt_type.h": "c", 5 | "lwevt.h": "c", 6 | "string.h": "c", 7 | "lwevt_opt.h": "c", 8 | "lwcell_private.h": "c", 9 | "lwcell.h": "c", 10 | "lwcell_includes.h": "c", 11 | "lwcell_opt.h": "c", 12 | "lwcell_device_info.h": "c", 13 | "LWCELL_TYPES.h": "c", 14 | "lwcell_int.h": "c", 15 | "lwcell_mem.h": "c", 16 | "lwcell_sim.h": "c", 17 | "lwcell_buff.h": "c", 18 | "lwcell_input.h": "c", 19 | "lwcell_parser.h": "c", 20 | "lwcell_debug.h": "c", 21 | "lwcell_sms.h": "c", 22 | "lwcell_threads.h": "c", 23 | "lwcell_unicode.h": "c", 24 | "lwcell_sys.h": "c", 25 | "lwcell_mqtt_client_api.h": "c", 26 | "lwcell_mqtt_client.h": "c", 27 | "lwcell_phonebook.h": "c", 28 | "lwcell_opts.h": "c" 29 | }, 30 | "esbonio.sphinx.confDir": "" 31 | } -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Tilen Majerle 2 | sa100 3 | Arthur Blomnik 4 | Ilya Kargapolov 5 | vsanisimova <70365668+vsanisimova@users.noreply.github.com> 6 | Tomas Strand 7 | yoyo 8 | Tilen Majerle -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## Develop 4 | 5 | - Split CMakeLists.txt files between library and executable 6 | - Change license year to 2022 7 | - Timeout: Module returns ERRMEM if no memory to allocate block 8 | - MQTT: update client to be consistent with client from LwESP library 9 | - Port: Add ThreadX port aligned with LwESP library 10 | - Add optional keep-alive system period event 11 | - Add `LWGSM ` prefix for debug messages 12 | - Update code style with astyle 13 | - Add `.clang-format` draft 14 | - Delete `lwgsm_datetime_t` and use generic `struct tm` instead 15 | - Rename project from `lwgsm` to `lwcell`, indicating cellular 16 | - Rework library CMake with removed INTERFACE type 17 | 18 | ## v0.1.1 19 | 20 | - Update CMSIS OS driver to support FreeRTOS aware kernel 21 | - Update to support library.json for Platform.IO 22 | 23 | ## v0.1.0 24 | 25 | - First release 26 | - Support for SIM800/SIM900 for the moment 27 | - Added AT commands as per documentation 28 | - Sequential API for network supported 29 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.22) 2 | 3 | # Setup project 4 | project(LwLibPROJECT) 5 | 6 | if(NOT PROJECT_IS_TOP_LEVEL) 7 | add_subdirectory(lwcell) 8 | else() 9 | add_executable(${PROJECT_NAME}) 10 | target_sources(${PROJECT_NAME} PRIVATE 11 | ${CMAKE_CURRENT_LIST_DIR}/dev/main.c 12 | 13 | # Development additional files 14 | ${CMAKE_CURRENT_LIST_DIR}/lwcell/src/system/lwcell_mem_lwmem.c 15 | ${CMAKE_CURRENT_LIST_DIR}/../lwmem/lwmem/src/lwmem/lwmem.c 16 | ${CMAKE_CURRENT_LIST_DIR}/../lwmem/lwmem/src/system/lwmem_sys_win32.c 17 | 18 | # Port specific 19 | ${CMAKE_CURRENT_LIST_DIR}/lwcell/src/system/lwcell_ll_win32.c 20 | ) 21 | target_include_directories(${PROJECT_NAME} PUBLIC 22 | ${CMAKE_CURRENT_LIST_DIR} 23 | ${CMAKE_CURRENT_LIST_DIR}/dev 24 | ${CMAKE_CURRENT_LIST_DIR}/../lwmem/lwmem/src/include 25 | ) 26 | 27 | # Add subdir with lwcell and link to the project 28 | set(LWCELL_OPTS_FILE ${CMAKE_CURRENT_LIST_DIR}/dev/lwcell_opts.h) 29 | set(LWCELL_SYS_PORT "win32") 30 | add_subdirectory(lwcell) 31 | target_link_libraries(${PROJECT_NAME} PUBLIC lwcell_api) 32 | target_link_libraries(${PROJECT_NAME} PUBLIC lwcell_apps) 33 | target_link_libraries(${PROJECT_NAME} PUBLIC lwcell) 34 | add_subdirectory(snippets) 35 | target_link_libraries(${PROJECT_NAME} PUBLIC lwcell_snippets) 36 | 37 | # Add compile options to the library, which will propagate options to executable through public link 38 | target_compile_definitions(lwcell PUBLIC WIN32 _DEBUG CONSOLE LWCELL_DEV) 39 | target_compile_options(lwcell PUBLIC -Wall -Wextra -Wpedantic) 40 | endif() 41 | -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "configurePresets": [ 4 | { 5 | "name": "default", 6 | "hidden": true, 7 | "generator": "Ninja", 8 | "binaryDir": "${sourceDir}/build/${presetName}", 9 | "cacheVariables": { 10 | "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" 11 | } 12 | }, 13 | { 14 | "name": "Win32-Debug", 15 | "inherits": "default", 16 | "toolchainFile": "${sourceDir}/cmake/i686-w64-mingw32-gcc.cmake", 17 | "cacheVariables": { 18 | "CMAKE_BUILD_TYPE": "Debug" 19 | } 20 | }, 21 | { 22 | "name": "Win64-Debug", 23 | "inherits": "default", 24 | "toolchainFile": "${sourceDir}/cmake/x86_64-w64-mingw32-gcc.cmake", 25 | "cacheVariables": { 26 | "CMAKE_BUILD_TYPE": "Debug" 27 | } 28 | } 29 | ], 30 | "buildPresets": [ 31 | { 32 | "name": "Win32-Debug", 33 | "configurePreset": "Win32-Debug" 34 | }, 35 | { 36 | "name": "Win64-Debug", 37 | "configurePreset": "Win64-Debug" 38 | } 39 | ] 40 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Tilen MAJERLE 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lightweight Cellular AT parser 2 | 3 | LwCELL is lightweight, platform independent, cellular modem AT commands parser, targeting (as of today) communicion with SIMCOM based modules SIM800/SIM900 or SIM70xx. 4 | Module is written in C11 and is independent from used platform. Its main targets are embedded system devices like ARM Cortex-M, AVR, PIC and others, but can easily work under `Windows`, `Linux` or `MAC` environments. 5 | 6 |

Read first: Documentation

7 | 8 | ## Features 9 | 10 | * Supports ``SIM800/SIM900 (2G)`` and ``SIM7000/SIM7020 (NB-Iot LTE)`` modules 11 | * Platform independent and very easy to port 12 | * Development of library under Win32 platform 13 | * Provided examples for ARM Cortex-M or Win32 platforms 14 | * Written in C language (C11) 15 | * Allows different configurations to optimize user requirements 16 | * Supports implementation with operating systems with advanced inter-thread communications 17 | * Currently only OS mode is supported 18 | * 2 different threads handling user data and received data 19 | * First (producer) thread (collects user commands from user threads and starts the command processing) 20 | * Second (process) thread reads the data from GSM device and does the job accordingly 21 | * Allows sequential API for connections in client and server mode 22 | * Includes several applications built on top of library: 23 | * MQTT client for MQTT connection 24 | * User friendly MIT license 25 | 26 | ## Contribute 27 | 28 | Fresh contributions are always welcome. Simple instructions to proceed: 29 | 30 | 1. Fork Github repository 31 | 2. Follow [C style & coding rules](https://github.com/MaJerle/c-code-style) already used in the project 32 | 3. Create a pull request to develop branch with new features or bug fixes 33 | 34 | Alternatively you may: 35 | 36 | 1. Report a bug 37 | 2. Ask for a feature request -------------------------------------------------------------------------------- /cmake/i686-w64-mingw32-gcc.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Windows) 2 | 3 | # Some default GCC settings 4 | set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) 5 | set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) 6 | 7 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) 8 | -------------------------------------------------------------------------------- /cmake/x86_64-w64-mingw32-gcc.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Windows) 2 | 3 | # Some default GCC settings 4 | set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) 5 | set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) 6 | 7 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) 8 | -------------------------------------------------------------------------------- /dev/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #if !__DOXYGEN__ 44 | #define LWCELL_CFG_DBG LWCELL_DBG_ON 45 | #define LWCELL_CFG_DBG_TYPES_ON LWCELL_DBG_TYPE_TRACE | LWCELL_DBG_TYPE_STATE 46 | #define LWCELL_CFG_DBG_MQTT LWCELL_DBG_OFF 47 | 48 | #define LWCELL_CFG_CONN_MAX_DATA_LEN 1460 49 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 50 | #define LWCELL_CFG_AT_ECHO 0 51 | 52 | #define LWCELL_CFG_NETWORK 1 53 | 54 | #define LWCELL_CFG_CONN 1 55 | #define LWCELL_CFG_SMS 1 56 | #define LWCELL_CFG_CALL 1 57 | #define LWCELL_CFG_PHONEBOOK 1 58 | #define LWCELL_CFG_USSD 1 59 | 60 | #define LWCELL_CFG_USE_API_FUNC_EVT 1 61 | 62 | #define LWCELL_CFG_NETCONN 1 63 | 64 | #define LWCELL_CFG_MEM_CUSTOM 1 65 | 66 | #define LWCELL_CFG_MQTT 1 67 | 68 | #if defined(WIN32) 69 | #define LWCELL_CFG_SYS_PORT LWCELL_SYS_PORT_WIN32 70 | #endif 71 | 72 | #endif /* !__DOXYGEN__ */ 73 | 74 | #endif /* LWCELL_HDR_OPTS_H */ 75 | -------------------------------------------------------------------------------- /dev/lwmem_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwmem_opts.h 3 | * \brief LwMEM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwMEM - Lightweight dynamic memory manager library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWMEM_HDR_OPTS_H 35 | #define LWMEM_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwmem_opts.h" for your application */ 38 | 39 | #include "windows.h" 40 | 41 | /* 42 | * Open "include/lwmem/lwmem_opt.h" and 43 | * copy & replace here settings you want to change values 44 | */ 45 | #define LWMEM_CFG_OS 1 46 | #define LWMEM_CFG_OS_MUTEX_HANDLE HANDLE 47 | 48 | #endif /* LWMEM_HDR_OPTS_H */ 49 | -------------------------------------------------------------------------------- /docs/4a-esp8266_at_instruction_set_en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/4a-esp8266_at_instruction_set_en.pdf -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/SIM800 Series_AT Command Manual_V1.09.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/SIM800 Series_AT Command Manual_V1.09.pdf -------------------------------------------------------------------------------- /docs/SIM900_TCPIP_Application Note_V1.02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/SIM900_TCPIP_Application Note_V1.02.pdf -------------------------------------------------------------------------------- /docs/Telit_NE866B1_NL865B1_AT_Commands_Refernce_Guide_r4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/Telit_NE866B1_NL865B1_AT_Commands_Refernce_Guide_r4.pdf -------------------------------------------------------------------------------- /docs/api-reference/apps/index.rst: -------------------------------------------------------------------------------- 1 | .. _api_apps: 2 | 3 | Applications 4 | ============ 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | :glob: 9 | 10 | * -------------------------------------------------------------------------------- /docs/api-reference/apps/mqtt_client.rst: -------------------------------------------------------------------------------- 1 | .. _api_app_mqtt_client: 2 | 3 | MQTT Client 4 | =========== 5 | 6 | MQTT client v3.1.1 implementation, based on callback (non-netconn) connection API. 7 | 8 | .. literalinclude:: ../../../snippets/mqtt_client.c 9 | :language: c 10 | :linenos: 11 | :caption: MQTT application example code 12 | 13 | .. doxygengroup:: LWCELL_APP_MQTT_CLIENT 14 | .. doxygengroup:: LWCELL_APP_MQTT_CLIENT_EVT -------------------------------------------------------------------------------- /docs/api-reference/apps/mqtt_client_api.rst: -------------------------------------------------------------------------------- 1 | .. _api_app_mqtt_client_api: 2 | 3 | MQTT Client API 4 | =============== 5 | 6 | *MQTT Client API* provides sequential API built on top of :ref:`api_app_mqtt_client`. 7 | 8 | .. literalinclude:: ../../../snippets/mqtt_client_api.c 9 | :language: c 10 | :linenos: 11 | :caption: MQTT API application example code 12 | 13 | .. doxygengroup:: LWCELL_APP_MQTT_CLIENT_API -------------------------------------------------------------------------------- /docs/api-reference/apps/netconn.rst: -------------------------------------------------------------------------------- 1 | .. _api_app_netconn: 2 | 3 | Netconn API 4 | =========== 5 | 6 | *Netconn API* is addon on top of existing connection module and allows sending and receiving data with sequential API calls, similar to *POSIX socket* API. 7 | 8 | It can operate in client mode and uses operating system features, such as message queues and semaphore to link non-blocking callback API for connections with sequential API for application thread. 9 | 10 | .. note:: 11 | Connection API does not directly allow receiving data with sequential and linear code execution. 12 | All is based on connection event system. 13 | Netconn adds this functionality as it is implemented on top of regular connection API. 14 | 15 | .. warning:: 16 | Netconn API are designed to be called from application threads ONLY. 17 | It is not allowed to call any of *netconn API* functions from within interrupt or callback event functions. 18 | 19 | Netconn client 20 | ^^^^^^^^^^^^^^ 21 | 22 | .. figure:: ../../static/images/netconn_client.svg 23 | :align: center 24 | :alt: Netconn API client block diagram 25 | 26 | Netconn API client block diagram 27 | 28 | Above block diagram shows basic architecture of netconn client application. 29 | There is always one application thread (in green) which calls *netconn API* functions to interact with connection API in synchronous mode. 30 | 31 | Every netconn connection uses dedicated structure to handle message queue for data received packet buffers. 32 | Each time new packet is received (red block, *data received event*), reference to it is written to message queue of netconn structure, while application thread reads new entries from the same queue to get packets. 33 | 34 | .. literalinclude:: ../../../snippets/netconn_client.c 35 | :language: c 36 | :linenos: 37 | :caption: Netconn client example 38 | 39 | Non-blocking receive 40 | ^^^^^^^^^^^^^^^^^^^^ 41 | 42 | By default, netconn API is written to only work in separate application thread, 43 | dedicated for network connection processing. Because of that, by default every function is fully blocking. 44 | It will wait until result is ready to be used by application. 45 | 46 | It is, however, possible to enable timeout feature for receiving data only. 47 | When this feature is enabled, :cpp:func:`lwcell_netconn_receive` will block for maximal timeout set with 48 | :cpp:func:`lwcell_netconn_set_receive_timeout` function. 49 | 50 | When enabled, if there is no received data for timeout amount of time, function will return with timeout status and application needs to process it accordingly. 51 | 52 | .. tip:: 53 | :c:macro:`LWCELL_CFG_NETCONN_RECEIVE_TIMEOUT` must be set to ``1`` to use this feature. 54 | 55 | .. doxygengroup:: LWCELL_NETCONN -------------------------------------------------------------------------------- /docs/api-reference/index.rst: -------------------------------------------------------------------------------- 1 | .. _api_reference: 2 | 3 | API reference 4 | ============= 5 | 6 | List of all the modules: 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | lwcell/index 12 | opt 13 | port/index 14 | apps/index -------------------------------------------------------------------------------- /docs/api-reference/lwcell/buff.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_buff: 2 | 3 | Ring buffer 4 | =========== 5 | 6 | .. doxygengroup:: LWCELL_BUFF -------------------------------------------------------------------------------- /docs/api-reference/lwcell/debug.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_debug: 2 | 3 | Debug support 4 | ============= 5 | 6 | Middleware has extended debugging capabilities. 7 | These consist of different debugging levels and types of debug messages, 8 | allowing to track and catch different types of warnings, severe problems or simply output messages 9 | program flow messages (trace messages). 10 | 11 | Module is highly configurable using library configuration methods. 12 | Application must enable some options to decide what type of messages and for which modules it would like to output messages. 13 | 14 | With default configuration, ``printf`` is used as output function. 15 | This behavior can be changed with :c:macro:`LWCELL_CFG_DBG_OUT` configuration. 16 | 17 | For successful debugging, application must: 18 | 19 | * Enable global debugging by setting :c:macro:`LWCELL_CFG_DBG` to :c:macro:`LWCELL_DBG_ON` 20 | * Configure which types of messages to output 21 | * Configure debugging level, from all messages to severe only 22 | * Enable specific modules to debug, by setting its configuration value to :c:macro:`LWCELL_DBG_ON` 23 | 24 | .. tip:: 25 | Check :ref:`api_lwcell_opt` for all modules with debug implementation. 26 | 27 | An example code with config and latter usage: 28 | 29 | .. literalinclude:: ../../examples_src/debug_opts.h 30 | :language: c 31 | :linenos: 32 | :caption: Debug configuration setup 33 | 34 | .. literalinclude:: ../../examples_src/debug.c 35 | :language: c 36 | :linenos: 37 | :caption: Debug usage within middleware 38 | 39 | .. doxygengroup:: LWCELL_DEBUG -------------------------------------------------------------------------------- /docs/api-reference/lwcell/device_info.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_device_info: 2 | 3 | Device info 4 | =========== 5 | 6 | .. doxygengroup:: LWCELL_DEVICE_INFO -------------------------------------------------------------------------------- /docs/api-reference/lwcell/evt.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_evt: 2 | 3 | Event management 4 | ================ 5 | 6 | .. doxygengroup:: LWCELL_EVT -------------------------------------------------------------------------------- /docs/api-reference/lwcell/ftp.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_ftp: 2 | 3 | File Transfer Protocol 4 | ====================== 5 | 6 | .. doxygengroup:: LWCELL_FTP -------------------------------------------------------------------------------- /docs/api-reference/lwcell/http.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_http: 2 | 3 | HTTP 4 | ==== 5 | 6 | .. doxygengroup:: LWCELL_HTTP -------------------------------------------------------------------------------- /docs/api-reference/lwcell/index.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell: 2 | 3 | LwCELL 4 | ===== 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | :glob: 9 | 10 | * 11 | 12 | .. doxygengroup:: LWCELL -------------------------------------------------------------------------------- /docs/api-reference/lwcell/input.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_input: 2 | 3 | Input module 4 | ============ 5 | 6 | Input module is used to input received data from *GSM* device to *LwCELL-Lib* middleware part. 7 | ``2`` processing options are possible: 8 | 9 | * Indirect processing with :cpp:func:`lwcell_input` (default mode) 10 | * Direct processing with :cpp:func:`lwcell_input_process` 11 | 12 | .. tip:: 13 | Direct or indirect processing mode is select by setting :c:macro:`LWCELL_CFG_INPUT_USE_PROCESS` configuration value. 14 | 15 | Indirect processing 16 | ^^^^^^^^^^^^^^^^^^^ 17 | 18 | With indirect processing mode, every received character from *GSM* physical device is written to 19 | intermediate buffer between low-level driver and *processing* thread. 20 | 21 | Function :cpp:func:`lwcell_input` is used to write data to buffer, which is later processed 22 | by *processing* thread. 23 | 24 | Indirect processing mode allows embedded systems to write received data to buffer from interrupt context (outside threads). 25 | As a drawback, its performance is decreased as it involves copying every receive character to intermediate buffer, 26 | and may also introduce RAM memory footprint increase. 27 | 28 | Direct processing 29 | ^^^^^^^^^^^^^^^^^ 30 | 31 | Direct processing is targeting more advanced host controllers, like STM32 or WIN32 implementation use. 32 | It is developed with DMA support in mind, allowing low-level drivers to skip intermediate data buffer 33 | and process input bytes directly. 34 | 35 | .. note:: 36 | When using this mode, function :cpp:func:`lwcell_input_process` must be used and it may 37 | only be called from thread context. Processing of input bytes is done in low-level 38 | input thread, started by application. 39 | 40 | .. tip:: 41 | Check :ref:`um_porting_guide` for implementation examples. 42 | 43 | .. doxygengroup:: LWCELL_INPUT -------------------------------------------------------------------------------- /docs/api-reference/lwcell/mem.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_mem: 2 | 3 | Memory manager 4 | ============== 5 | 6 | .. doxygengroup:: LWCELL_MEM -------------------------------------------------------------------------------- /docs/api-reference/lwcell/network.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_network: 2 | 3 | Network 4 | ======= 5 | 6 | .. doxygengroup:: LWCELL_NETWORK -------------------------------------------------------------------------------- /docs/api-reference/lwcell/network_api.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_network_api: 2 | 3 | Network API 4 | =========== 5 | 6 | Network API provides functions for multi-thread application network management. 7 | It allows multiple threads to request to join to network (internet access). 8 | 9 | Network API module controls when network connection shall be active or can be closed. 10 | 11 | .. doxygengroup:: LWCELL_NETWORK_API -------------------------------------------------------------------------------- /docs/api-reference/lwcell/operator.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_operator: 2 | 3 | Network operator 4 | ================ 5 | 6 | .. doxygengroup:: LWCELL_OPERATOR -------------------------------------------------------------------------------- /docs/api-reference/lwcell/phonebook.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_pb: 2 | 3 | Phonebook 4 | ========= 5 | 6 | .. doxygengroup:: LWCELL_PHONEBOOK -------------------------------------------------------------------------------- /docs/api-reference/lwcell/ping.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_ping: 2 | 3 | Ping support 4 | ============ 5 | 6 | .. doxygengroup:: LWCELL_PING -------------------------------------------------------------------------------- /docs/api-reference/lwcell/sim.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_sim: 2 | 3 | SIM card 4 | ======== 5 | 6 | .. doxygengroup:: LWCELL_SIM -------------------------------------------------------------------------------- /docs/api-reference/lwcell/sms.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_sms: 2 | 3 | SMS 4 | === 5 | 6 | .. doxygengroup:: LWCELL_SMS -------------------------------------------------------------------------------- /docs/api-reference/lwcell/timeout.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_timeout: 2 | 3 | Timeout manager 4 | =============== 5 | 6 | Timeout manager allows application to call specific function at desired time. 7 | It is used in middleware (and can be used by application too) to poll active connections. 8 | 9 | .. note:: 10 | Callback function is called from *processing* thread. 11 | It is not allowed to call any blocking API function from it. 12 | 13 | When application registers timeout, it needs to set timeout, callback function and optional user argument. 14 | When timeout elapses, GSM middleware will call timeout callback. 15 | 16 | This feature can be considered as single-shot software timer. 17 | 18 | .. doxygengroup:: LWCELL_TIMEOUT -------------------------------------------------------------------------------- /docs/api-reference/lwcell/types.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_types: 2 | 3 | Structures and enumerations 4 | =========================== 5 | 6 | .. doxygengroup:: LWCELL_TYPES -------------------------------------------------------------------------------- /docs/api-reference/lwcell/unicode.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_unicode: 2 | 3 | Unicode 4 | ======= 5 | 6 | Unicode decoder block. It can decode sequence of *UTF-8* characters, 7 | between ``1`` and ``4`` bytes long. 8 | 9 | .. note:: 10 | This is simple implementation and does not support string encoding. 11 | 12 | .. doxygengroup:: LWCELL_UNICODE -------------------------------------------------------------------------------- /docs/api-reference/lwcell/ussd.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_ussd: 2 | 3 | Unstructured Supplementary Service Data 4 | ======================================= 5 | 6 | .. doxygengroup:: LWCELL_USSD -------------------------------------------------------------------------------- /docs/api-reference/lwcell/utils.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_utils: 2 | 3 | Utilities 4 | ========= 5 | 6 | Utility functions for various cases. 7 | These function are used across entire middleware and can also be used by application. 8 | 9 | .. doxygengroup:: LWCELL_UTILS -------------------------------------------------------------------------------- /docs/api-reference/opt.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_opt: 2 | 3 | Configuration 4 | ============= 5 | 6 | This is the default configuration of the middleware. 7 | When any of the settings shall be modified, it shall be done in dedicated application config ``lwcell_opts.h`` file. 8 | 9 | .. note:: 10 | Check :ref:`getting_started` for guidelines on how to create and use configuration file. 11 | 12 | .. doxygengroup:: LWCELL_OPT 13 | :inner: 14 | -------------------------------------------------------------------------------- /docs/api-reference/port/index.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_port: 2 | 3 | Platform specific 4 | ================= 5 | 6 | List of all the modules: 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | :glob: 11 | 12 | * -------------------------------------------------------------------------------- /docs/api-reference/port/ll.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_ll: 2 | 3 | Low-Level functions 4 | =================== 5 | 6 | Low-level module consists of callback-only functions, which are called by middleware 7 | and must be implemented by final application. 8 | 9 | .. tip:: 10 | Check :ref:`um_porting_guide` for actual implementation 11 | 12 | .. doxygengroup:: LWCELL_LL -------------------------------------------------------------------------------- /docs/api-reference/port/sys.rst: -------------------------------------------------------------------------------- 1 | .. _api_lwcell_sys: 2 | 3 | System functions 4 | ================ 5 | 6 | System functions are bridge between operating system system calls and middleware system calls. 7 | Middleware is tightly coupled with operating system features hence it is important to include OS features directly. 8 | 9 | It includes support for: 10 | 11 | * Thread management, to start/stop threads 12 | * Mutex management for recursive mutexes 13 | * Semaphore management for binary-only semaphores 14 | * Message queues for thread-safe data exchange between threads 15 | * Core system protection for mutual exclusion to access shared resources 16 | 17 | .. tip:: 18 | Check :ref:`um_porting_guide` for actual implementation guidelines. 19 | 20 | .. doxygengroup:: LWCELL_SYS -------------------------------------------------------------------------------- /docs/authors/index.rst: -------------------------------------------------------------------------------- 1 | .. _authors: 2 | 3 | Authors 4 | ======= 5 | 6 | List of authors and contributors to the library 7 | 8 | .. literalinclude:: ../../AUTHORS -------------------------------------------------------------------------------- /docs/changelog/index.rst: -------------------------------------------------------------------------------- 1 | .. _changelof: 2 | 3 | Changelog 4 | ========= 5 | 6 | .. literalinclude:: ../../CHANGELOG.md 7 | -------------------------------------------------------------------------------- /docs/examples_src/command_blocking.c: -------------------------------------------------------------------------------- 1 | /* Somewhere in thread function */ 2 | 3 | /* Get device hostname in blocking mode */ 4 | /* Function returns actual result */ 5 | if (lwcell_sms_send("+0123456789", "text", NULL, NULL, 1 /* 1 means blocking call */) == lwcellOK) { 6 | /* At this point we have valid result from device */ 7 | printf("SMS sent successfully\r\n"); 8 | } else { 9 | printf("Error trying to send SMS..\r\n"); 10 | } -------------------------------------------------------------------------------- /docs/examples_src/command_nonblocking.c: -------------------------------------------------------------------------------- 1 | /* Hostname event function, called when lwcell_sms_send() function finishes */ 2 | void 3 | sms_send_fn(lwcellr_t res, void* arg) { 4 | /* Check actual result from device */ 5 | if (res == lwcellOK) { 6 | printf("SMS sent successfully\r\n"); 7 | } else { 8 | printf("Error trying to send SMS\r\n"); 9 | } 10 | } 11 | 12 | /* Somewhere in thread and/or other GSM event function */ 13 | 14 | /* Send SMS in non-blocking mode */ 15 | /* Function now returns if command has been sent to internal message queue */ 16 | if (lwcell_sms_send("number", "text message", sms_send_fn, NULL, 0 /* 0 means non-blocking call */) == lwcellOK) { 17 | /* At this point we only know that command has been sent to queue */ 18 | printf("SMS send message command sent to queue.\r\n"); 19 | } else { 20 | /* Error writing message to queue */ 21 | printf("Cannot send SMS send message command to queue. Maybe out of memory? Check result from function\r\n"); 22 | } -------------------------------------------------------------------------------- /docs/examples_src/command_nonblocking_bad.c: -------------------------------------------------------------------------------- 1 | /* Hostname event function, called when lwcell_sms_send() function finishes */ 2 | void 3 | sms_send_fn(lwcellr_t res, void* arg) { 4 | /* Check actual result from device */ 5 | if (res == lwcellOK) { 6 | printf("SMS sent successfully\r\n"); 7 | } else { 8 | printf("Error trying to send SMS\r\n"); 9 | } 10 | } 11 | 12 | /* Check hostname */ 13 | void 14 | check_hostname(void) { 15 | char message[] = "text message"; 16 | 17 | /* Send SMS in non-blocking mode */ 18 | /* Function now returns if command has been sent to internal message queue */ 19 | /* It uses pointer to local data but w/o blocking command */ 20 | if (lwcell_sms_send("number", message, sms_send_fn, NULL, 0 /* 0 means non-blocking call */) == lwcellOK) { 21 | /* At this point we only know that command has been sent to queue */ 22 | printf("SMS send message command sent to queue.\r\n"); 23 | } else { 24 | /* Error writing message to queue */ 25 | printf("Cannot send SMS send message command to queue. Maybe out of memory? Check result from function\r\n"); 26 | } 27 | } -------------------------------------------------------------------------------- /docs/examples_src/config.h: -------------------------------------------------------------------------------- 1 | #ifndef LWCELL_HDR_OPTS_H 2 | #define LWCELL_HDR_OPTS_H 3 | 4 | /* Rename this file to "lwcell_opts.h" for your application */ 5 | 6 | /* Increase default receive buffer length */ 7 | #define LWCELL_RCV_BUFF_SIZE 0x800 8 | 9 | #endif /* LWCELL_HDR_OPTS_H */ -------------------------------------------------------------------------------- /docs/examples_src/conn_write.c: -------------------------------------------------------------------------------- 1 | size_t rem_len; 2 | lwcell_conn_p conn; 3 | lwcellr_t res; 4 | 5 | /* ... other tasks to make sure connection is established */ 6 | 7 | /* We are connected to server at this point! */ 8 | /* 9 | * Call write function to write data to memory 10 | * and do not send immediately unless buffer is full after this write 11 | * 12 | * rem_len will give us response how much bytes 13 | * is available in memory after write 14 | */ 15 | res = lwcell_conn_write(conn, "My string", 9, 0, &rem_len); 16 | if (rem_len == 0) { 17 | printf("No more memory available for next write!\r\n"); 18 | } 19 | res = lwcell_conn_write(conn, "example.com", 11, 0, &rem_len); 20 | 21 | /* 22 | * Data will stay in buffer until buffer is full, 23 | * except if user wants to force send, 24 | * call write function with flush mode enabled 25 | * 26 | * It will send out together 20 bytes 27 | */ 28 | lwcell_conn_write(conn, NULL, 0, 1, NULL); 29 | -------------------------------------------------------------------------------- /docs/examples_src/debug.c: -------------------------------------------------------------------------------- 1 | #include "lwcell/lwcell_debug.h" 2 | 3 | /* 4 | * Print debug message to the screen 5 | * Trace message will be printed as it is enabled in types 6 | * while state message will not be printed. 7 | */ 8 | LWCELL_DEBUGF(MY_DBG_MODULE | LWCELL_DBG_TYPE_TRACE, "This is trace message on my program\r\n"); 9 | LWCELL_DEBUGF(MY_DBG_MODULE | LWCELL_DBG_TYPE_STATE, "This is state message on my program\r\n"); 10 | -------------------------------------------------------------------------------- /docs/examples_src/debug_opts.h: -------------------------------------------------------------------------------- 1 | /* Modifications of lwcell_opts.h file for configuration */ 2 | 3 | /* Enable global debug */ 4 | #define LWCELL_CFG_DBG LWCELL_DBG_ON 5 | 6 | /* 7 | * Enable debug types. 8 | * Application may use bitwise OR | to use multiple types: 9 | * LWCELL_DBG_TYPE_TRACE | LWCELL_DBG_TYPE_STATE 10 | */ 11 | #define LWCELL_CFG_DBG_TYPES_ON LWCELL_DBG_TYPE_TRACE 12 | 13 | /* Enable debug on custom module */ 14 | #define MY_DBG_MODULE LWCELL_DBG_ON 15 | -------------------------------------------------------------------------------- /docs/examples_src/evt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * \brief User defined callback function for GSM events 3 | * \param[in] evt: Callback event data 4 | */ 5 | lwcellr_t 6 | lwcell_callback_function(lwcell_evt_t* evt) { 7 | switch (lwcell_evt_get_type(evt)) { 8 | case LWCELL_EVT_RESET: { /* Reset detected on GSM device */ 9 | if (lwcell_evt_reset_is_forced(evt)) { /* Check if forced by user */ 10 | printf("Reset forced by user!\r\n"); 11 | } 12 | break; 13 | } 14 | default: break; 15 | } 16 | return lwcellOK; 17 | } -------------------------------------------------------------------------------- /docs/examples_src/mem.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This part should be done in ll initialization function only once on startup 3 | * Check LWCELL_LL part of library for more info 4 | */ 5 | 6 | #if !LWCELL_CFG_MEM_CUSTOM 7 | 8 | /* We can simply create a big array variable which will be linked to internal memory by linker */ 9 | uint8_t mem_int[0x1000]; 10 | 11 | /* 12 | * Define memory regions for allocating algorithm, 13 | * make sure regions are in correct order for memory location 14 | */ 15 | lwcell_mem_region_t mem_regions[] = { 16 | { mem_int, sizeof(mem_int) }, /* Set first memory region to internal memory of length 0x1000 bytes */ 17 | { (void *)0xC0000000, 0x8000 }, /* External heap memory is located on 0xC0000000 and has 0x8000 bytes of memory */ 18 | }; 19 | 20 | /* On startup, user must call function to assign memory regions */ 21 | lwcell_mem_assignmemory(mem_regions, LWCELL_ARRAYSIZE(mem_regions)); 22 | 23 | #endif /* !LWCELL_CFG_MEM_CUSTOM */ -------------------------------------------------------------------------------- /docs/examples_src/pbuf_cat.c: -------------------------------------------------------------------------------- 1 | lwcell_pbuf_p a, b; 2 | 3 | /* Create 2 pbufs of different sizes */ 4 | a = lwcell_pbuf_new(10); 5 | b = lwcell_pbuf_new(20); 6 | 7 | /* Link them together with concat operation */ 8 | /* Reference on b will stay as is, won't be increased */ 9 | lwcell_pbuf_cat(a, b); 10 | 11 | /* 12 | * Operating with b variable has from now on undefined behavior, 13 | * application shall stop using variable b to access pbuf. 14 | * 15 | * The best way would be to set b reference to NULL 16 | */ 17 | b = NULL; 18 | 19 | /* 20 | * When application doesn't need pbufs anymore, 21 | * free a and it will also free b 22 | */ 23 | lwcell_pbuf_free(a); -------------------------------------------------------------------------------- /docs/examples_src/pbuf_chain.c: -------------------------------------------------------------------------------- 1 | lwcell_pbuf_p a, b; 2 | 3 | /* Create 2 pbufs of different sizes */ 4 | a = lwcell_pbuf_new(10); 5 | b = lwcell_pbuf_new(20); 6 | 7 | /* Chain both pbufs together */ 8 | /* This will increase reference on b as 2 variables now point to it */ 9 | lwcell_pbuf_chain(a, b); 10 | 11 | /* 12 | * When application does not need a anymore, it may free it 13 | 14 | * This will free only pbuf a, as pbuf b has now 2 references: 15 | * - one from pbuf a 16 | * - one from variable b 17 | */ 18 | 19 | /* If application calls this, it will free only first pbuf */ 20 | /* As there is link to b pbuf somewhere */ 21 | lwcell_pbuf_free(a); 22 | 23 | /* Reset a variable, not used anymore */ 24 | a = NULL; 25 | 26 | /* 27 | * At this point, b is still valid memory block, 28 | * but when application doesn't need it anymore, 29 | * it should free it, otherwise memory leak appears 30 | */ 31 | lwcell_pbuf_free(b); 32 | 33 | /* Reset b variable */ 34 | b = NULL; -------------------------------------------------------------------------------- /docs/examples_src/pbuf_extract.c: -------------------------------------------------------------------------------- 1 | const void* data; 2 | size_t pos, len; 3 | lwcell_pbuf_p a, b, c; 4 | 5 | const char str_a[] = "This is one long"; 6 | const char str_a[] = "string. We want to save"; 7 | const char str_a[] = "chain of pbufs to file"; 8 | 9 | /* Create pbufs to hold these strings */ 10 | a = lwcell_pbuf_new(strlen(str_a)); 11 | b = lwcell_pbuf_new(strlen(str_b)); 12 | c = lwcell_pbuf_new(strlen(str_c)); 13 | 14 | /* Write data to pbufs */ 15 | lwcell_pbuf_take(a, str_a, strlen(str_a), 0); 16 | lwcell_pbuf_take(b, str_b, strlen(str_b), 0); 17 | lwcell_pbuf_take(c, str_c, strlen(str_c), 0); 18 | 19 | /* Connect pbufs together */ 20 | lwcell_pbuf_chain(a, b); 21 | lwcell_pbuf_chain(a, c); 22 | 23 | /* 24 | * pbuf a now contains chain of b and c together 25 | * and at this point application wants to print (or save) data from chained pbuf 26 | * 27 | * Process pbuf by pbuf with code below 28 | */ 29 | 30 | /* 31 | * Get linear address of current pbuf at specific offset 32 | * Function will return pointer to memory address at specific position 33 | * and `len` will hold length of data block 34 | */ 35 | pos = 0; 36 | while ((data = lwcell_pbuf_get_linear_addr(a, pos, &len)) != NULL) { 37 | /* Custom process function... */ 38 | /* Process data with data pointer and block length */ 39 | process_data(data, len); 40 | printf("Str: %.*s", len, data); 41 | 42 | /* Increase offset position for next block */ 43 | pos += len; 44 | } 45 | 46 | /* Call free only on a pbuf. Since it is chained, b and c will be freed too */ 47 | lwcell_pbuf_free(a); 48 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/mqtt-v3.1.1-os.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/mqtt-v3.1.1-os.pdf -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx>=3.5.1 2 | breathe>=4.9.1 3 | urllib3==1.26.18 4 | docutils==0.16 5 | colorama 6 | sphinx_rtd_theme>=1.0.0 7 | sphinx-tabs 8 | sphinxcontrib-svg2pdfconverter 9 | sphinx-sitemap 10 | -------------------------------------------------------------------------------- /docs/sim800_series_tcpip_application_note_v1.00.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/sim800_series_tcpip_application_note_v1.00.pdf -------------------------------------------------------------------------------- /docs/static/css/common.css: -------------------------------------------------------------------------------- 1 | /* Center aligned text */ 2 | .center { 3 | text-align: center; 4 | } 5 | 6 | /* Paragraph with main links on index page */ 7 | .index-links { 8 | text-align: center; 9 | margin-top: 10px; 10 | } 11 | .index-links a { 12 | display: inline-block; 13 | border: 1px solid #0E4263; 14 | padding: 5px 20px; 15 | margin: 2px 5px; 16 | background: #2980B9; 17 | border-radius: 4px; 18 | color: #FFFFFF; 19 | } 20 | .index-links a:hover, .index-links a:active { 21 | background: #0E4263; 22 | } 23 | 24 | /* Table header p w/0 margin */ 25 | .index-links a table thead th { 26 | vertical-align: middle; 27 | } 28 | 29 | table thead th p { 30 | margin: 0; 31 | } 32 | 33 | .table-nowrap td { 34 | white-space: normal !important; 35 | } 36 | 37 | /* Breathe output changes */ 38 | .breathe-sectiondef.container { 39 | background: #f9f9f9; 40 | padding: 10px; 41 | margin-bottom: 10px; 42 | border: 1px solid #efefef; 43 | } 44 | .breathe-sectiondef.container .breathe-sectiondef-title { 45 | background: #2980b9; 46 | color: #FFFFFF; 47 | padding: 4px; 48 | margin: -10px -10px 0 -10px; 49 | } 50 | .breathe-sectiondef.container .function, 51 | .breathe-sectiondef.container .member, 52 | .breathe-sectiondef.container .class, 53 | .breathe-sectiondef.container .type { 54 | border-bottom: 1px solid #efefef; 55 | } 56 | .breathe-sectiondef.container .function:last-child, 57 | .breathe-sectiondef.container .member:last-child, 58 | .breathe-sectiondef.container .class:last-child, 59 | .breathe-sectiondef.container .type:last-child { 60 | border-bottom: none; 61 | margin-bottom: 0; 62 | } 63 | 64 | /*# sourceMappingURL=common.css.map */ 65 | -------------------------------------------------------------------------------- /docs/static/css/custom.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/static/css/custom.css -------------------------------------------------------------------------------- /docs/static/dark-light/checked.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/static/dark-light/dark.css: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright 2019 Google LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * https://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | :root { 18 | color-scheme: dark; /* stylelint-disable-line property-no-unknown */ 19 | 20 | --background-color: rgb(15 15 15); 21 | --text-color: rgb(240 240 240); 22 | --shadow-color: rgb(240 240 240 / 50%); 23 | --accent-color: rgb(0 0 240 / 50%); 24 | } 25 | 26 | img { 27 | filter: grayscale(50%); 28 | } 29 | 30 | .icon { 31 | filter: invert(100%); 32 | } 33 | 34 | a { 35 | color: yellow; 36 | } 37 | -------------------------------------------------------------------------------- /docs/static/dark-light/light.css: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright 2019 Google LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * https://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | :root { 18 | color-scheme: light; /* stylelint-disable-line property-no-unknown */ 19 | 20 | --background-color: rgb(240 240 240); 21 | --text-color: rgb(15 15 15); 22 | --shadow-color: rgb(15 15 15 / 50%); 23 | --accent-color: rgb(240 0 0 / 50%); 24 | } 25 | -------------------------------------------------------------------------------- /docs/static/dark-light/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/static/dark-light/moon.png -------------------------------------------------------------------------------- /docs/static/dark-light/moon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | moon 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/static/dark-light/sun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/static/dark-light/sun.png -------------------------------------------------------------------------------- /docs/static/dark-light/sun.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/static/dark-light/unchecked.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/static/images/example_app_arch.xml: -------------------------------------------------------------------------------- 1 | 3Vldc6IwFP01PrYDBCg+KrrbB/sxotv6tIMQhRaMG2LV/fWbSPgMtrZjh41P5p7kxnBuzk0udIAd735idx3cIR9GHU3xdx0w6GiaqgCF/jBknyKGbqbAEoc+H1QATvgXZp4c3YQ+TCoDCUIRCddV0EOrFfRIBXMxRtvqsAWKqv+6dpdQABzPjUT0KfRJkKKWdlPgtzBcBtk/q2Y37YndbDB/kiRwfbQtQWDYATZGiKSteGfDiJGX8ZL6/TjSmy8MwxU5xaH7++lq+vIncofGtu/czrzR68sVn+XNjTb8ge/sKV8v2WckYLRZ+ZDNo3RAfxuEBDpr12O9Wxp2igUkjqil0uYijCIbRQgffMHC8qDnUTwhGL3CUs/cMnSDTcjXADGBu6MPp+aU0b0GUQwJ3tMh3EGzOMt8m6kZ69siaJrCsaAUsBx0+UZZ5nMXXNIGp/Mz1KoCj9Cne4ubCJMALdHKjYYF2q8yXYwZIbTm/L5AQvZcKO6GoCr7cBeSZ+7O2jPWvja4NdiVugb7zFjR533OJmBGyYuZhdvByvxOjnQ/i3TakwlJy2PPiHk/8pRHtMEefIdwjacHFy8heS8wSvNWwjBySfhWXcjZt4UmKG7oPFqaSdOiGdFl9+eYtpasRTuAJsIiQtPuhm4fAXeQfYr7eLNK6JJ6E5YgQxxvKfmsiVFMf4bJGsMkCRcsBvuEwDiRMEEYZi1BmGKCUI2GBJFnkvMniG6bCSJrfypB5EbqleeLIwniYD1CHFLCIP4/swY4NWu0mTSAeEw/TB7GEupQreuw4aC2GmSof5sKLdlVCD46p2WQoS6DDHVBhve/7i5BhDcti7DVk7DQ3awsuw80eG1VVdjtdr8iQ1FUxwV4RrkZMsjNEOQ2sgcSyk1XqnIDestya/XI+6Lc1EJfs06pVJVAbKYMYjMFsTmDcU/G063+Lqh1uWXvMqs1v1iHswK8jo3C+VlD4BvQ8vWmEFjaHJjmmTKeVrtgdMUQmA0hML8tBIZ0t/wr5VpR6pcM5RJKblWKmlsVi25nYPfGMt5A6hf+PP+1lhJvpNNjreo2L6HqVqUou1Wx7u5PJ5OHe6fhvBwOnEsQKGhZoJr4nWLaG08kpNaoVV/5F78StXoDtV9470/N4nvuoa/0VRwM/wE= -------------------------------------------------------------------------------- /docs/static/images/logo.drawio: -------------------------------------------------------------------------------- 1 | jZLLbsMgEEW/xstItkkiZ5s0TaUm2XiRNTITgwLGwrg4/frievBDUaWuYM48gHuJyEF1J0NrftEMZJTGrIvIW5SmSZxlfunJcyC7LYLSCIZFE8jFN4ROpK1g0CwKrdbSinoJC11VUNgFo8Zotyy7a7k8taYlvIC8oPKV3gSzfKDZJp74B4iSh5OTGDOKhmIEDadMuxkix4gcjNZ22KnuALIXL+gy9L3/kR0vZqCy/2m4rtgadsqdr6rdr3efd3lLVjjli8oWH3x2p/yCN7bPIIPRbcWgn5REZO+4sJDXtOizzhvvGbdKYrqxRj9Gubae3HVl0VvSx6MWsQ9eHxJuBcZCN0P4sBNoBdY8fQlmyXoztOAvS0PsJs+SLRrBZ34FHyl+k3IcPSnpNyhmCCfTfnOzr0+OPw== -------------------------------------------------------------------------------- /docs/static/images/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
LwCELL
13 |
14 |
15 | LwCELL 16 |
17 |
18 |
19 |
-------------------------------------------------------------------------------- /docs/static/images/logo_tm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/static/images/logo_tm.png -------------------------------------------------------------------------------- /docs/static/images/logo_tm_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/static/images/logo_tm_full.png -------------------------------------------------------------------------------- /docs/static/images/memory_manager_structure.xml: -------------------------------------------------------------------------------- 1 | 7Vvbdps4FP0av3YBsh38mKRp5yHt6mqmazqPMshGE4y8hHybrx8BErejxHQC2ND4IYEjicveh322ZDxB95vjZ463wRfmk3DiWP5xgj5OHMex0FT+SyKnLGLbroqsOfVVrAg80X+JCloquqM+iSsdBWOhoNtq0GNRRDxRiWHO2aHabcXC6lm3eE1A4MnDIYz+RX0R6NuYL4qGPwhdB+rUrnOTNSyx97zmbBep800ctEo/WfMG62OpG40D7LNDKYQeJuieMyayrc3xnoQJuBq2bNynF1rz6+YkEk0GLObZiD0Od0Rfcnph4qTBSG+HJAOsCbo7BFSQpy32ktaD5F/GArEJ5Z4tN1csEopP20n2aRjes5Dx9FjIx8RdeTIeC86eSall7rlkuZIt8BbUXe0JF+RYCqlb+kzYhgh+kl1Uq6vQPVV3DwWVC01AUGLRsVQQq/RZ50cuIJQbCsUXEL35DRBFTq+QugDS72RNWSRjMi7HW+QoCI9wMurp4/fbL1k0FpgL+T8dY1nHeyv7ZK0hidby4otm19JXW+JKAiSqhFSBjlhEaqyoEA7pOpK7noSdyPhdAjeVInOrGjbU95PTGDOgmiOlJHDsy1KK2mB08TKjdsYOjXJGfbKnEhrHepFY+3Vi7d+Z2Kbq1wavtsa5ROw3Fsd0GSb8LUPmPSeEYoEzqpa7hMaYRl65ncZJ0eaEZJ2y7rKwJ30iJrLjU/+D3LhTQ3LOZYn1AhKXQ2xVOraEFsv7kry1qsot8JaDp13THDJnm5iz2xBZ254CRIgvXZHaZVwEbM3kE/lQRGvJXMKHHKn4Wdr+O+nyYZbsRfLKfqoR6U7R9g8R4qRgxTvBZKg47yNj22Y1ceV6xDPWxKU7m86svEWbu1cZjNmOe7lB1XYU8zXR/WxV4hO8XmWakxALuq+6zLc9cDrNigfuayJs+vnReX/tuT5tmOtOKyrlANAeTWJx7aAZSnaHoCEA2p9BqtTpHyKnPAo9rks5jXxZFoV8+OS503YREE5WLFXyXJ/T8VZeryOWdN9jGuKsbOQdV+pIp7woXBlD7rzK0NTqVcKt6SDFoI4aMliWDvN61kwMtJu8fvia+oZ24IMrCO+ycIahvp3dAiDy7uygs1MLN1Vnp4LtObt06C3n+FTqsGVyuhuXjvwtCZQrv1PLoFltXe/cAGS9PqCuIb/YfVHpLjeyOyzyM4eqoarAVbQhVrKebS1cJxt2JevX4NpwKnV1CE1nl60ks/dKcr6S6OWASiWxWq8kzVmD090hiCnI9V7F1IbT3SGsEQDQ+pXQrr9ObAEhZ3HROboDy+6IJbShYJqst17MuIRgDtN91jO733UUu6H7vHbQel09caDn/BEn302ZFzLe9qrAW57XX6hAdk1fm5bteSuAQq/TJAsHCWzTwtVOpkI/VNXENGZ9/fH4OA50ezVODly5H7oOzNB5HUCoMx1ouKo/BmANOmAEtp1MhRZ/VDoA0DXoQIfoQuc5eB24qQLqGABdGPCctoLn/zOlQ8TVtBRowrWdPIUv8I1LBergmt6i6ypptbqMSATyrNMiYKhZTmdmAMFZ1lhUoA6sSQWMwLYiAwjOtkYlAwBdgwx0iC6ccg1dB+bzC5oBBCdZY5GBOq69mgEE51qjUgEAbq9mAM63hi4CN7PzZsC2OzMDcIo1FhWoA2t8O8AEbDsyAOdao5IBgK7p65Xu0IUzrqHrQP19duM3BSZhbUUH9MlGqAMAWJPAdmYHpud+kjJwHQDomr4paAlduVv8GDx7kbL4yT16+A8= -------------------------------------------------------------------------------- /docs/static/images/memory_manager_structure_freeing.xml: -------------------------------------------------------------------------------- 1 | 7VtLk5s4EP41vqZ4GdvHZHY2e5iktjKb2uxRBhm0g5FLyK/99SuBhIFWZqgJ2EDZBxu6JR5ftz61uuWZ+7A9fWZoF3+hIU5mjhWeZu5vM8dxLNcTP1JyLiS2vVSSiJFQyS6CZ/IfVkJLSfckxFmtIac04WRXFwY0TXHAazLEGD3Wm21oUr/rDkUYCJ4DlEDp3yTksX4Nf3VR/IFJFKtbL51FoVij4CVidJ+q+80cd5N/CvUW6WupF81iFNJjReQ+ztwHRikvjranB5xIcDVsRb/ff6Itn5vhlLfpsPKLHgeU7LF+5PzB+FmDkb8Olh2smfvpGBOOn3cokNqjsL+QxXybiDNbHG5oypU9bUeekyR5oAll+bXcEOHlJhDyjDP6gisaP1ji9UZo4CuotzpgxvGpIlKv9BnTLebsLJoo7VKhe66fHi+mXGkDxBUrOpYSIuU+UXnlC4TiQKH4E0RXANFvOCI0FTLx1A+yacoxS1E+ZvCBCCQd69vHL4Uy44hx8Zt3tayTbRWfQpvgNBLvUFcDiwmYeN0sdbhTmuKGbZQIJSRKxWmA5TMKgQSdiIHxUSm2JAzlbYx+UPeUiis49k0N63ZgV1vjXDHsnzTLyDqR9lsnNHiRBkUcFaZa76UZM5IGVT3JJB8xjItGRXPBWbJNSnlxfRJ+EAefVJfS5oI9ghhnVRHdVK4toEXivYTdOh3CHditBE9PCD60nG2ynN3FkLQtGyCCQ0H46pQyHtOIihH5eJE2nLmCDz4R/qNy/I9s8mEuz1LxZD9Uj/zkovsXc35WsKI9p0J0ue8Tpbt2BLpZBjgwEuh6OffmVqnR89arFszongXl3KuoXxBQhHU72y2EEq9XLc1wgjg51CfQX7OaAwbcV0lsevxovx+6r3stfd3pxNVdANqTiSyGDppzVdAWALS/4pyp8y8sojmFHtNTOUlDMS1yMfjEvXM9jzHDG5ozecnPeX+rnK9TKpsfEElQMW2UDTfqSudyUhiYhZb+bSkchlVjIAOA2lXJwIYhi5EMdDQ5fPiuSgu2DeAbHEJyyr/hsNQL4ntk9VpkpYOoWmTlz2e3iqxsGCSMgUyBr1+XTL12ZDp00K5Koc4cgPY9kwtUc5Dza8mlFiO4A0DnizqgjgHQlQFPrxM8Yb6ujROOEVfTTGbCtRs/hSuAOiMWEdLX709P0wDXlDrrzWmXkyOB0us0CVgQzzLtWAXU7wRQuBiaCgs0gTWxgBHYTmhAX3iqNADQNdBAj+jCCGrsPLCYv80D5TK8cx5wYXQ1FR5oAmtc15qA7cZTYZg1KR4A6Bp4oD90PciyAMXRF51d07Kgt6qz7cFc1b3s3FPZubVpO6k7ew6w7L3u/M6ykmeanvvLjnouQOSeHc0BqWZHPRUW1rKjeoK6QXbUg2HqGLKjTV93TXN6b4k+732h6OBAa1s+6QY0GGbe685vlACvTeFvJQaH6ddN1K5MBjDhN+6685VpAab3BodQs6xkGpau1duwXNx39LWIrLSNapGVZrQbRFb6eUZGpk1fN5Gp0dc7YYM5XNmPIbICoBkotEfQpld3bubuPcPuh/5KTvPpFp4BsG1red146sQrzwBdQ/KsP3R9SJ5j54Fm7t7EA/2VnHxnsjwAgG1by+vGU9/akzdyHgDomvah9YcuzOkBFG8dMfktdtib9uh0tKKCq/D7igqsqPSm3dqKSv834QYrKh/GuWNYUQFXN8xhve31898Xyg4Os5b7Tt+BmTi9/AU911X+6O8+/g8= -------------------------------------------------------------------------------- /docs/static/images/netconn_client.xml: -------------------------------------------------------------------------------- 1 | 7Vpde9o2FP41XG6PkbBxLglJu4ttT59lW5veCVtgt8KisszHfv0kW7IlWwFG1ZCs5Saco6Ov93wrjOB8vX/L0Cb7jaaYjECQ7kfwbgTAGIBI/JGcQ8OZBkHDWLE8VUId4yH/ByumFqvyFJeWIKeU8HxjMxNaFDjhFg8xRne22JISe9cNWuEB4yFBZMh9n6c8U9xxdNMN/ILzVaa2jsG0GVig5POK0apQ+40AXNafZniN9FrqomWGUrozWPB+BOeMUt58W+/nmEhsNWzNvDdPjLbnZrjg50xgs+TLm/2ff338FP4dLYr72WP68SetvS0iFdb3qE/LDxqh+o5YrhKM4O0uyzl+2KBEju6ETQhextdEUGPxdZkTMqeEMkEXtBBCtykqs3q6HB+eWl1kixnHe4OlbvEW0zXm7CBE1GgYKkSVxY1vFL0z9BcrXmaorlUFUjazatfucBNfFHRuGIFvwGjBlVeMQQ9AaVJxgpNE8EvO6GdsjCzicBIGniCNbEhB4IA0ckEaeIAUDiCdN86e00J6PiJEOpv07qpQ3B7k4p7cxtXGS5miwzoRyVeFIBOBHhb8W4laLvacqYF1nqZyG6cibVWbuowUbWgMwkB8tJw6fHBN9YUetDcZaO8OcSQ4DCc43wpwQIC38nJ+/eQJbH3AGdtwwiAcwgkccEIPcIbfOr7YuM3n2ibtuJMiHC+dcSdKYrxY+kEaXjXuDHPf75jLOqMrN5oIJDCoEl4x/CPu+FGfj7gzHWjvjy7gpE0IWuOylPUfCL5UuBqq76VGINiPQMABrCsCRR6A1ZW5gRNORc2sSMp4Rle0QOS+4/YM0kAN73P+wfj+KEV+DgX1CXN+UICiilPB6tb+ldKNA/ej1v2fK6dmRJf94JjuSlqxRKGhOgMJylFlMkwQFwZpLeTSjJr6juYySz6Z1XVu0EtwxFaYq1mdfmeMoYMhtpEC5ZF9Jr194l4jcUpenaszr+YEnbG1mJxlfzcDx54lNYy9qMzwEgs9Ja/XrVt3PeXWEw9u7e7/pl/t606fdfi2IyYEg5ggqbu9MXR30EQh7tsGEkk0s6ahprt5NaUnPltYGKs+pnFLK0n5CxVnB/FTTRWh5f+hNA/P9CAfpble9+q1eYjjdOIy4RgsYBT5gXp81dq8Pa+zOCd5bbQB2myIqJmVTfOMYZQOVPJ91+gXq9FHja5bLL+lZJcqHs18YAy16eHCMvNYFBtmB49PdmY+0dHFzCe6BHz+hKJPYzjke5RLJ1yK67UdF9qinKAFkdVazW8TjVW7va6sM+7XbedmHS8+NPkmPmSVXtNL+7FjwPsovC6u+s7ysKnDwYBvB7uoJ4OwV+dEVo91Uh7Ecc/GjJ5sODtwd4CnOs0Lmjv92O/Jmtu4b5sHeLH27HwNAcdbn4uzhffu4zJb7r8XROC4LffkITzyvnDaE/pPYg1oXmx5+Fb/jtEEl+XI+u+HTo1FqvNhXaz2HzReaTJ81rdJ9yNG/NUx5cqPGODFPGJMniGKPKFsQXa/hmjcsfvJCbz/Fw== -------------------------------------------------------------------------------- /docs/static/images/pbuf_block_diagram.xml: -------------------------------------------------------------------------------- 1 | 5Vrdk5owEP9rfGyHACI+9ryrfbheO73p9OMtwiKpSJwY/Ohf3wSCgEHLzHnE2nvw2E02YX+7+WUTHTiT5W7K8Cr+SENIBrYV7gbO/cC2x95YfErFvlAMPbdQzBkJCxWqFM/kNyilpbQZCWHd6MgpTThZNZUBTVMIeEOHGaPbZreIJs1ZV3gOmuI5wImu/UZCHistKv2SDR+AzGM1tW+PioYZDhZzRrNUzTewnSj/K5qXuBxLObqOcUi3NZXzMHAmjFJePC13E0gktCVshd37E62H92aQ8i4GY6+w2OAkU77fZVEETAYPc6zeku9LZHLfQFpbA+duGxMOzyscyNatSAWhi/kyERISjxFNuQousqVMkmRCE8rysZwQgx8FQr/mjC6g1uIFPswi0aL7o1zcAOOwq6mUf1OgS+BsL7qoVttXWKtcPGC/rUW21MW1oLpKh1UyzQ9DV4CKB4XpCXxHGr5fQMALqYBM5m8m/BKTyxYL3SLaVke07Uug7Wto54DYFo0k2hnLPbs9lJHbJ8pjk5wxBD902/D17ZnjeZfB13UNcgYql0wn0rBvEe4+SQMhR4NbwxRCUR8okTIe0zlNcfJQae+aqNcQ/gWc7xXEOONUqKoRHildnYhEgXhZfrTEJvIDCFqpZuYP3aF1LjZrmrHgUHSVJRZmcyj7Wapik56fjSGDBHOyaVZOL8t/pAXkCXY89yRYgHyYKcK5udRHXZnmIqlfsocRKhfzeO35G47GM+ts/nYH2LOMUrnOLabqP0Nw90rlJWmZZQ4zSPfLHEhnjv9s0xy2bZrI3KY5vIbUN3T86XfT1O9Mej9lmqlN+jxlIku/OukbZkNE3i/MHe9MxFx3cq7cOi2YhaSyR4zl/9sjFa/XQlG/VLm6MJghnV7DUH4BccVhMERKfYbh59TxPt2TKaHk8QlRtly4/M1hthdUmK01ZEutWYsG7Aj/Xnv+IYd6O1TS/U6NnAv7UkiFw9/rQs1KipVZLpV2/VWvSB2UmtWrKiENVK9IP7h9XefXEBvMCJ4l8OrnY0CC4EZt2I69kYMvRG+HLDZzavNfvIQ6LY3rP76hi+e6Mv1MSb5BnNrOnKM4FitQWVWhfMcY3te6rWSH9Zl5jvJqfPS971+6l69VJVLxAlVaHSDpmGn6cVRf0PqVwb+3oI/LRv/11rMQq18GFEGpfn3hPPwB -------------------------------------------------------------------------------- /docs/static/images/pbuf_block_diagram_after_free.xml: -------------------------------------------------------------------------------- 1 | 3VjLjpswFP0atiNjAyHLJp1OF21VdVS1XTpweXQcHDkmj359bTAvORmlmgjSsEjMuX5wz7k+wXHIcn14EnSTfeYxMAej+OCQ9w7G82CuPjVwrAE/8GogFXlcQ24HPOd/wIDIoGUew3bQUXLOZL4ZghEvCojkAKNC8P2wW8LZcNUNTcECniPKbPRHHsvMoG6Tlw58hDzNzNIhntWBFY1eUsHLwqznYJJUVx1e02Yuk+g2ozHf9yDy6JCl4FzWrfVhCUxT29BWj/twJto+t4BCXjJgbhLaUVaa3BdlkoDQ4lFJzVPKY8NMlRvo0cghi32WS3je0EhH96oUFJbJNVN3rmomvJBGXBfr+5yxJWdcVHOR2Icw9hS+lYK/QC8S4hUJAhWx8zEp7kBIOPQgk98T8DVIcVRdTJQ0XJtabLnf95RtsKwnqmcwaoopbafuCFUNw+kZQRCyCP4Gil8oFGe6gEuVmFpdR5A7Nd16hh6+XCJ1NTObpzpRY2/XBF2oCb6KJq6liUU8xMoQzC0XMuMpLyh77NDFUJqeDL9ByqPRgZaSK6ib4RPnm8vkSsIIouiUXKvQ93zURhqHwq/tly0vRdS6rMlXUpFC0w/5Nagzf1VDAYzKfDe0yrcJgi1BvsBBVplEL6AbK+NKd2dH7qV2dJ3SJxP6vVonOF3R8Wy+qozmCgR74aR+792M309E97hW7t+Cc0zD9MjOEVpMV4xgxBNd2KWoUrtDg/ZGpdl+IR+b5omqeVSaXfsV8CTNaq2FXqsaXdTOkhe6R0b19/1VezDmr6Vrv/jdmgwT7YZxZfAtCt9w/oFDLn/22r90lwf/vzgZuYFz5UOQGfqV51Uhn9t2BD1g1Lv84Yz1Sc1M0in7Tgh67HXb6A7b88viubVsf7p/7a8a9RN0ZdZSdGHlBZYBfN9Wp5EdFTldMe0F9un8mhscXOW0s1PVNA9mhF7JZ9sNPcLLm7rt/kGsVen+pSWPfwE= -------------------------------------------------------------------------------- /docs/static/images/pbuf_cat_vs_chain_1.xml: -------------------------------------------------------------------------------- 1 | 3VhLj5swEP41XFdgwuvYpNntoa2qRlXbo4EJ0DgYGZOQ/vra2LyWbBRVeexuDsj+ZuxhvhmPhxj2Yls/MVykX2gMxEBmXBv2RwOhwA3EUwIHBTjuTAEJy2IFWT2wyv6CBk2NVlkM5UiRU0p4VozBiOY5RHyEYcbofqy2pmRstcAJTIBVhMkU/ZnFPNWo1folBZ8gS1Jt2keeEoQ42iSMVrm2ZyB73fyUeIvbvbSjZYpjuh9A9tKwF4xSrkbbegFEUtvSptY9viDt3ptBzs9ZELhqxQ6TSvs+r9ZrYDJ4mGP9lvzQMtP4BnK1adjzfZpxWBU4ktK9SAWBpXxLxMwSwzXNuQ6uheQ8I2RBCWXNXnbsgB/PBF5yRjcwkPgotF1XSKb+aBd3wDjUA0j79wR0C5wdhIqWIl9zrXMRzfR8P4hsG490ENRWD+tkSrqte0LFQHP6Ar/ehN/vIOiFXFAm87cSfgnjUmJa75FtdCbb6BJsBxO2v0LNG5+iDchBqLP7/RFt3pBoqzV2l7oh7LhRdIzg2AtC07wOwfYt64bVFoNXUDjuRPctC4dlotdQOe7E9G0rhzehEGLRfOkpZTylCc0xWfbofEzygFCoM/5rMP4tVR4cMfsDnB8017jiVED93p8pLc4MiR/B8ZCEvjNzzE7S9onoVJBKWrGo63V9BUr3T8aNAcE8241702NB0Eu/0awpDm28veDBNwNH3D/q6YwvDutZWDlmCXC9SR/ZD4zhw0CtkArlCbOOedTO4//pi4F6gz7NOorOzDx/csZ/lM2NtcMswyGBq5dSsERz4B3LpsD1bHyh1qA7vHdpDaxpa3DJE/8GzrXuQtU5enbBXO6wn19xp13xNO+nMXr7eX/Ni01M+690VY36f0Ls5T8= -------------------------------------------------------------------------------- /docs/static/images/pbuf_cat_vs_chain_2.xml: -------------------------------------------------------------------------------- 1 | 3VhLj9owEP41ua7shLyOXfbRQ1tVRVXbo0mGJMXEyDg8+utrkwlJMCC0y4J2OQT7m7En883DVhxvOFs/SzbPv4oUuOOSdO14D47rUhq4+s8gmxoJwrAGMlmkqNQCo+IfIEgQrYoUFj1FJQRXxbwPJqIsIVE9jEkpVn21ieB9q3OWgQWMEsZt9FeRqnznV9wKPkOR5Wg6ctG/MUummRRVifYc15tsf7V4xpq90NFFzlKx6kDeo+MNpRCqHs3WQ+CG24a2et3TEenuvSWU6pwFcVCvWDJeoe/31WQC0gSPKYZvqTYNM1vfwKwmjne/ygsFozlLjHSlc0FjuZpxPaN6OBGlwuBS18wLzoeCC7ndy0t9iNKBxhdKiil0JJE79oJAS2x/0MUlSAXrDoT+PYOYgZIbrYJSN0KuMRfdAc5Xncg28cg7QW30GCZTttu6JVQPkNMj/IYWvz9A0wulpszkb6X90saNhNCPyLZ7JtvuBdimlFp0W5xCqksdp0KqXGSiZPyxRe/7rHcY/gtKbZBiVimhoXaHL0LMj0SiZrzpJAdiM4kSSJJDsRlH/sAnp2KzEJVM0LcY+5NiMoNGjSAHxvGTIZTAmSqW/R74quyPrXB8g7Xa+pFMwQzG2G0+XuKTayZ+Y+wmfVzbCQ5nbxrGY3Iye88neDC4YR+nxO4st2rkZ9BtdujgwyEhO7zpfQfuCq+PyVW7fdPYbttebpT9120v4SWPUVgX6ndn/Meo3Pnv4YClJLr0YYpLv4ti20Ga4ySM7yIS+/qQqp9+P/x0L6z1iY+btJH9JCXbdNTmRmFxwqxPDtp5epm+HtRv0KbZjqIzMy+yavznYnusLZks2JjDm/dboPoGER7KnTgIPXah+8OueG9S4NS+P1yy4t9BXV/n5vyiohzspQYNTxflvv7li9K+19tFaSfQ+yvK/Us9Dd6uKPW0/e5TR6X9uOY9/gc= -------------------------------------------------------------------------------- /docs/static/images/pbuf_cat_vs_chain_3.xml: -------------------------------------------------------------------------------- 1 | 3VhLc5swEP41XDMSb46Nm6SHttNpptP2KMMaaGTkkYUf/fWVzGLAcjyehNiTcmCkb1cS++1DOzjeZL55kGxRfBEZcMcl2cbxPjquG1Nfvw2wbQA/QiCXZdZAtAMey7+AIEG0LjNYDhSVEFyViyGYiqqCVA0wJqVYD9Vmgg9PXbAcLOAxZdxGf5aZKhClYdIJPkGZF3h07EaNYMrSp1yKusLzHNeb7Z5GPGftXmjosmCZWPcg787xJlII1YzmmwlwQ21LW7Pu/hnp/rslVOqcBUnYrFgxXqPtt/VsBtI4jymGX6m2LTM728CsJo53uy5KBY8LlhrpWoeCxgo153pG9XAmKoXOpa6Zl5xPBBdyt5eXBRBnvsaXSoon6Elid+qFoZbY9qCJK5AKNj0I7XsAMQclt1oFpW6MXGMsuj7O1z3Ptv4oek5t9RgGU77fuiNUD5DTZ/iNLH6/g6YXKk2Zid9a26UPNxJC/0e23TPZdkdgm1Jq0W1xCplOdZwKqQqRi4rxuw69HbLeY/gPKLVFilmthIa6HT4LsTjPE7M4hTQ95olpHPgB2Uva2uOe8s1S1DJF2xKsT4rJHFo1ghwYw0+6UAJnqlwNa+Croj+x3PEVNmpnR/oEZjDFavP/BT65ZOC3h12ljutzwuPxnEXJlJBxCPb9K9ZxSuzK8nwht4vOhek2O/TwyYSQPd7WviO9wut9ctFq3/J83fJypei/bHmJxrxGYVOqX73xb6NyE7yHC5aSeOzLFJd+E+WugrTXSZTcxCQJ9CXVvIOh++mBW5sbHzfpPPtBSrbtqS2MwvLEsQE5es79y/T1oPmCLsz2FJ0ZebGV4z+Wu2ttxWTJphzevHEGqjuI6Fg0JWHksZH6h33yXiXBqd0/jJnx7yCvL9M5vygp/YPQoNHppDzUHz8p7b7eTsq3bYIuk5SHTT0N3y4p9bT779N4pfu35t39Aw== -------------------------------------------------------------------------------- /docs/static/images/system_structure.xml: -------------------------------------------------------------------------------- 1 | 3ZZNj5swEIZ/DcdKYCeEHJt0mx52T7Tq2bEHsNZgZJwQ+us7gPkS2raHpZXKAex3ZjzMw8jGo+f8cTGszF60AOURXzw8+skjJPAPO3y0StMrx/2+F1IjhXOahFj+gCHSqTcpoFo4Wq2VleVS5LoogNuFxozR9dIt0WqZtWQprISYM7VWv0thM6cG4XEyfAGZZi51RA694cr4a2r0rXD5PEKT7urNORvWcoVWGRO6nkn0yaNno7XtR/njDKplO2Dr4z6/YR3f20Bh/yTgGPYRd6ZurvZvFZgWY1kqyZmVunCvapsBT1cgtEv4Hj3VmbQQl4y31hobArXM5gpnAQ4TqdRZK2262BYH4Rz1yhr9CjMLjagfHNoIXVjXEwESOa2LcnXewVh4zCRX5AV0DtY06OKsxHfAXUPu3LSevu7oks0+7ODHXEOl48oTVBw4rm8wPqwYX+IXFD5+xduzvHokVJjvdEXuYdqOcimEghorflf2gkGU/Jr9Bqyjv8k6WrGOm8pCvmac3Arednf1zu0N4W/aewPEAVkzDjZjfFwxftb1BwX37hTYhqvYQyR2W3Ol/5LruPAM7NC2cujafucos6bCzbk7dOEuEaHzwxyj63+wdQThdnsHTqdztrPNfmbo008= -------------------------------------------------------------------------------- /docs/ts_127007v100300p.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/docs/ts_127007v100300p.pdf -------------------------------------------------------------------------------- /docs/user-manual/architecture.rst: -------------------------------------------------------------------------------- 1 | .. _um_arch: 2 | 3 | Architecture 4 | ============ 5 | 6 | Architecture of the library consists of ``4`` layers. 7 | 8 | .. figure:: ../static/images/system_structure.svg 9 | :align: center 10 | :alt: LwCELL layer architecture overview 11 | 12 | LwCELL layer architecture overview 13 | 14 | Application layer 15 | ^^^^^^^^^^^^^^^^^ 16 | 17 | *User layer* is the highest layer of the final application. 18 | This is the part where API functions are called to execute some command. 19 | 20 | Middleware layer 21 | ^^^^^^^^^^^^^^^^ 22 | 23 | Middleware part is actively developed and shall not be modified by customer by any means. 24 | If there is a necessity to do it, often it means that developer of the application uses it wrongly. 25 | This part is platform independent and does not use any specific compiler features for proper operation. 26 | 27 | .. note:: 28 | There is no compiler specific features implemented in this layer. 29 | 30 | System & low-level layer 31 | ^^^^^^^^^^^^^^^^^^^^^^^^ 32 | 33 | Application needs to fully implement this part and resolve it with care. 34 | Functions are related to actual implementation with *GSM* device and are highly 35 | architecture oriented. Some examples for `WIN32` and `ARM Cortex-M` are included with library. 36 | 37 | .. tip:: 38 | Check :ref:`um_porting_guide` for detailed instructions and examples. 39 | 40 | System functions 41 | **************** 42 | 43 | System functions are bridge between operating system running on embedded system and LwCELL middleware. 44 | Functions need to provide: 45 | 46 | * Thread management 47 | * Binary semaphore management 48 | * Recursive mutex management 49 | * Message queue management 50 | * Current time status information 51 | 52 | .. tip:: 53 | System function prototypes are available in :ref:`api_lwcell_sys` section. 54 | 55 | Low-level implementation 56 | ************************ 57 | 58 | Low-Level, or *LWCELL_LL*, is part, dedicated for communication between *LwCELL* middleware and *GSM* physical device. 59 | Application needs to implement output function to send necessary *AT command* instruction aswell as implement 60 | *input module* to send received data from *GSM* device to *LwCELL* middleware. 61 | 62 | Application must also assure memory assignment for :ref:`api_lwcell_mem` when default allocation is used. 63 | 64 | .. tip:: 65 | Low level, input module & memory function prototypes are available in 66 | :ref:`api_lwcell_ll`, :ref:`api_lwcell_input` and :ref:`api_lwcell_mem` respectfully. 67 | 68 | GSM physical device 69 | ^^^^^^^^^^^^^^^^^^^ 70 | 71 | .. toctree:: 72 | :maxdepth: 2 -------------------------------------------------------------------------------- /docs/user-manual/blocking-nonblocking.rst: -------------------------------------------------------------------------------- 1 | .. _um_blocking_nonblocking: 2 | 3 | Blocking or non-blocking API calls 4 | ================================== 5 | 6 | API functions often allow application to set ``blocking`` parameter indicating if function shall be blocking or non-blocking. 7 | 8 | Blocking mode 9 | ^^^^^^^^^^^^^ 10 | 11 | When the function is called in blocking mode ``blocking = 1``, application thread gets suspended until response from *GSM* device is received. 12 | If there is a queue of multiple commands, thread may wait a while before receiving data. 13 | 14 | When API function returns, application has valid response data and can react immediately. 15 | 16 | * Linear programming model may be used 17 | * Application may use multiple threads for real-time execution to prevent system stalling when running function call 18 | 19 | .. warning:: 20 | Due to internal architecture, it is not allowed to call API functions in *blocking mode* from events or callbacks. 21 | Any attempt not to do so will result in function returning error. 22 | 23 | Example code: 24 | 25 | .. literalinclude:: ../examples_src/command_blocking.c 26 | :language: c 27 | :linenos: 28 | :caption: Blocking command example 29 | 30 | Non-blocking mode 31 | ^^^^^^^^^^^^^^^^^ 32 | 33 | If the API function is called in non-blocking mode, function will return immediately with status indicating if command request has been successfully sent to internal command queue. 34 | Response has to be processed in event callback function. 35 | 36 | .. warning:: 37 | Due to internal architecture, it is only allowed to call API functions in *non-blocking mode* from events or callbacks. 38 | Any attempt to do so will result in function returning error. 39 | 40 | Example code: 41 | 42 | .. literalinclude:: ../examples_src/command_nonblocking.c 43 | :language: c 44 | :linenos: 45 | :caption: Non-blocking command example 46 | 47 | .. warning:: 48 | When using non-blocking API calls, do not use local variables as parameter. 49 | This may introduce *undefined behavior* and *memory corruption* if application function returns before command is executed. 50 | 51 | Example of a bad code: 52 | 53 | .. literalinclude:: ../examples_src/command_nonblocking_bad.c 54 | :language: c 55 | :linenos: 56 | :caption: Example of bad usage of non-blocking command 57 | 58 | .. toctree:: 59 | :maxdepth: 2 60 | :glob: -------------------------------------------------------------------------------- /docs/user-manual/index.rst: -------------------------------------------------------------------------------- 1 | .. _um: 2 | 3 | User manual 4 | =========== 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | overview 10 | architecture 11 | inter-thread-comm 12 | events-cb-fn 13 | blocking-nonblocking 14 | porting-guide 15 | -------------------------------------------------------------------------------- /docs/user-manual/overview.rst: -------------------------------------------------------------------------------- 1 | .. _um_overview: 2 | 3 | Overview 4 | ======== 5 | 6 | IoT activity is embedded in today's application. Almost every device uses some type of communication, 7 | from WiFi, BLE, Sub-GHz or NB-IoT/LTE/2G/3G. 8 | 9 | *LwCELL* has been developed to allow customers to: 10 | 11 | * Develop on single (host MCU) architecture at the same time and do not care about device arch 12 | * Shorten time to market 13 | 14 | Customers using *LwCELL* do not need to take care about proper command for specific task, 15 | they can call API functions to execute the task. 16 | Library will take the necessary steps in order to send right command to device via low-level driver (usually UART) and 17 | process incoming response from device before it will notify application layer if it was successfuly or not. 18 | 19 | To summarize: 20 | 21 | * *GSM* device runs official *AT* firmware, provided by device vendor 22 | * Host MCU runs custom application, together with *LwCELL* library 23 | * Host MCU communicates with *GSM* device with UART or similar interface. 24 | 25 | .. toctree:: 26 | :maxdepth: 2 27 | :glob: -------------------------------------------------------------------------------- /examples/lib/FreeRTOS/CMSIS_RTOS/cmsis_os.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/examples/lib/FreeRTOS/CMSIS_RTOS/cmsis_os.c -------------------------------------------------------------------------------- /examples/lib/FreeRTOS/CMSIS_RTOS/cmsis_os.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/examples/lib/FreeRTOS/CMSIS_RTOS/cmsis_os.h -------------------------------------------------------------------------------- /examples/lib/FreeRTOS/CMSIS_RTOS_V2/cmsis_os.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/examples/lib/FreeRTOS/CMSIS_RTOS_V2/cmsis_os.h -------------------------------------------------------------------------------- /examples/lib/FreeRTOS/include/stdint.readme: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FREERTOS_STDINT 3 | #define FREERTOS_STDINT 4 | 5 | /******************************************************************************* 6 | * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions 7 | * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be 8 | * built using compilers that do not provide their own stdint.h definition. 9 | * 10 | * To use this file: 11 | * 12 | * 1) Copy this file into the directory that contains your FreeRTOSConfig.h 13 | * header file, as that directory will already be in the compilers include 14 | * path. 15 | * 16 | * 2) Rename the copied file stdint.h. 17 | * 18 | */ 19 | 20 | typedef signed char int8_t; 21 | typedef unsigned char uint8_t; 22 | typedef short int16_t; 23 | typedef unsigned short uint16_t; 24 | typedef long int32_t; 25 | typedef unsigned long uint32_t; 26 | 27 | #endif /* FREERTOS_STDINT */ 28 | -------------------------------------------------------------------------------- /examples/lib/FreeRTOS/portable/MemMang/ReadMe.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,2 3 | [InternetShortcut] 4 | URL=http://www.freertos.org/a00111.html 5 | IDList= 6 | -------------------------------------------------------------------------------- /examples/lib/st/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaJerle/lwcell/486462d5095612c4656a7881d3d009d0aba59a78/examples/lib/st/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h -------------------------------------------------------------------------------- /examples/lib/st/CMSIS/Include/cmsis_version.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file cmsis_version.h 3 | * @brief CMSIS Core(M) Version definitions 4 | * @version V5.0.2 5 | * @date 19. April 2017 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef __CMSIS_VERSION_H 32 | #define __CMSIS_VERSION_H 33 | 34 | /* CMSIS Version definitions */ 35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ 36 | #define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */ 37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ 38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ 39 | #endif 40 | -------------------------------------------------------------------------------- /examples/stm32/mqtt_client_api_rtos_stm32f429zi_nucleo/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "configurations": [ 4 | { 5 | /* 6 | * ms-vscode.cmake-tools plugin should be installed. 7 | * 8 | * It provides data for C/C++ plugin, 9 | * such as include paths, browse paths, defines, etc. 10 | */ 11 | "name": "STM32", 12 | "configurationProvider": "ms-vscode.cmake-tools", 13 | "intelliSenseMode": "${default}" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/stm32/mqtt_client_api_rtos_stm32f429zi_nucleo/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-vscode.cpptools", 4 | "ms-vscode.cmake-tools", 5 | "marus25.cortex-debug", 6 | "twxs.cmake", 7 | "dan-c-underwood.arm", 8 | "zixuanwang.linkerscript" 9 | ] 10 | } -------------------------------------------------------------------------------- /examples/stm32/mqtt_client_api_rtos_stm32f429zi_nucleo/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Debug Microcontroller - ST-Link", 9 | "cwd": "${workspaceFolder}", 10 | "type": "cortex-debug", 11 | "executable": "${command:cmake.launchTargetPath}", //or fixed file path: build/stm32h735g-dk-led.elf 12 | "request": "launch", //Use "attach" to connect to target w/o elf download 13 | "servertype": "stlink", 14 | "device": "", //MCU used, ex. "STM32H735IG" 15 | "interface": "swd", 16 | "serialNumber": "", //Set ST-Link ID if you use multiple at the same time 17 | "runToMain": true, 18 | "svdFile": "path/to/file.svd", //Path to SVD file to see registers 19 | "v1": false, 20 | "showDevDebugOutput": "both", 21 | 22 | /* Will get automatically detected if STM32CubeIDE is installed to default directory 23 | or it can be manually provided if necessary.. */ 24 | //"serverpath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.0.100.202109301221\\tools\\bin\\ST-LINK_gdbserver.exe", 25 | //"armToolchainPath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\\tools\\bin", 26 | //"stm32cubeprogrammer": "c:\\Program Files\\STMicroelectronics\\STM32Cube\\STM32CubeProgrammer\\bin", 27 | 28 | /* If you use external loader, add additional arguments */ 29 | //"serverArgs": ["--extload", "path/to/ext/loader.stldr"], 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /examples/stm32/mqtt_client_api_rtos_stm32f429zi_nucleo/CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "configurePresets": [ 4 | { 5 | "name": "default", 6 | "hidden": true, 7 | "generator": "Ninja", 8 | "binaryDir": "${sourceDir}/build/${presetName}", 9 | "toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake", 10 | "cacheVariables": { 11 | "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" 12 | } 13 | }, 14 | { 15 | "name": "Debug", 16 | "inherits": "default", 17 | "cacheVariables": { 18 | "CMAKE_BUILD_TYPE": "Debug" 19 | } 20 | }, 21 | { 22 | "name": "RelWithDebInfo", 23 | "inherits": "default", 24 | "cacheVariables": { 25 | "CMAKE_BUILD_TYPE": "RelWithDebInfo" 26 | } 27 | }, 28 | { 29 | "name": "Release", 30 | "inherits": "default", 31 | "cacheVariables": { 32 | "CMAKE_BUILD_TYPE": "Release" 33 | } 34 | }, 35 | { 36 | "name": "MinSizeRel", 37 | "inherits": "default", 38 | "cacheVariables": { 39 | "CMAKE_BUILD_TYPE": "MinSizeRel" 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /examples/stm32/mqtt_client_api_rtos_stm32f429zi_nucleo/cmake/gcc-arm-none-eabi.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Generic) 2 | set(CMAKE_SYSTEM_PROCESSOR arm) 3 | 4 | # Some default GCC settings 5 | # arm-none-eabi- must be part of path environment 6 | set(TOOLCHAIN_PREFIX arm-none-eabi-) 7 | set(FLAGS "-fdata-sections -ffunction-sections -Wl,--gc-sections") 8 | set(CPP_FLAGS "${FLAGS} -fno-rtti -fno-exceptions -fno-threadsafe-statics") 9 | 10 | set(CMAKE_C_FLAGS ${FLAGS}) 11 | set(CMAKE_CXX_FLAGS ${CPP_FLAGS}) 12 | 13 | set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) 14 | set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) 15 | set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++) 16 | set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy) 17 | set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size) 18 | 19 | set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf") 20 | set(CMAKE_EXECUTABLE_SUFFIX_C ".elf") 21 | set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf") 22 | 23 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) 24 | -------------------------------------------------------------------------------- /examples/stm32/mqtt_client_api_rtos_stm32f429zi_nucleo/inc/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #define LWCELL_CFG_AT_ECHO 1 44 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 45 | 46 | /* Enable network, conn and netconn APIs */ 47 | #define LWCELL_CFG_NETWORK 1 48 | #define LWCELL_CFG_CONN 1 49 | #define LWCELL_CFG_NETCONN 1 50 | 51 | 52 | #endif /* LWCELL_HDR_OPTS_H */ 53 | -------------------------------------------------------------------------------- /examples/stm32/netconn_client_rtos_stm32f429zi_nucleo/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "configurations": [ 4 | { 5 | /* 6 | * ms-vscode.cmake-tools plugin should be installed. 7 | * 8 | * It provides data for C/C++ plugin, 9 | * such as include paths, browse paths, defines, etc. 10 | */ 11 | "name": "STM32", 12 | "configurationProvider": "ms-vscode.cmake-tools", 13 | "intelliSenseMode": "${default}" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/stm32/netconn_client_rtos_stm32f429zi_nucleo/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-vscode.cpptools", 4 | "ms-vscode.cmake-tools", 5 | "marus25.cortex-debug", 6 | "twxs.cmake", 7 | "dan-c-underwood.arm", 8 | "zixuanwang.linkerscript" 9 | ] 10 | } -------------------------------------------------------------------------------- /examples/stm32/netconn_client_rtos_stm32f429zi_nucleo/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Debug Microcontroller - ST-Link", 9 | "cwd": "${workspaceFolder}", 10 | "type": "cortex-debug", 11 | "executable": "${command:cmake.launchTargetPath}", //or fixed file path: build/stm32h735g-dk-led.elf 12 | "request": "launch", //Use "attach" to connect to target w/o elf download 13 | "servertype": "stlink", 14 | "device": "", //MCU used, ex. "STM32H735IG" 15 | "interface": "swd", 16 | "serialNumber": "", //Set ST-Link ID if you use multiple at the same time 17 | "runToMain": true, 18 | "svdFile": "path/to/file.svd", //Path to SVD file to see registers 19 | "v1": false, 20 | "showDevDebugOutput": "both", 21 | 22 | /* Will get automatically detected if STM32CubeIDE is installed to default directory 23 | or it can be manually provided if necessary.. */ 24 | //"serverpath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.0.100.202109301221\\tools\\bin\\ST-LINK_gdbserver.exe", 25 | //"armToolchainPath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\\tools\\bin", 26 | //"stm32cubeprogrammer": "c:\\Program Files\\STMicroelectronics\\STM32Cube\\STM32CubeProgrammer\\bin", 27 | 28 | /* If you use external loader, add additional arguments */ 29 | //"serverArgs": ["--extload", "path/to/ext/loader.stldr"], 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /examples/stm32/netconn_client_rtos_stm32f429zi_nucleo/CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "configurePresets": [ 4 | { 5 | "name": "default", 6 | "hidden": true, 7 | "generator": "Ninja", 8 | "binaryDir": "${sourceDir}/build/${presetName}", 9 | "toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake", 10 | "cacheVariables": { 11 | "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" 12 | } 13 | }, 14 | { 15 | "name": "Debug", 16 | "inherits": "default", 17 | "cacheVariables": { 18 | "CMAKE_BUILD_TYPE": "Debug" 19 | } 20 | }, 21 | { 22 | "name": "RelWithDebInfo", 23 | "inherits": "default", 24 | "cacheVariables": { 25 | "CMAKE_BUILD_TYPE": "RelWithDebInfo" 26 | } 27 | }, 28 | { 29 | "name": "Release", 30 | "inherits": "default", 31 | "cacheVariables": { 32 | "CMAKE_BUILD_TYPE": "Release" 33 | } 34 | }, 35 | { 36 | "name": "MinSizeRel", 37 | "inherits": "default", 38 | "cacheVariables": { 39 | "CMAKE_BUILD_TYPE": "MinSizeRel" 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /examples/stm32/netconn_client_rtos_stm32f429zi_nucleo/cmake/gcc-arm-none-eabi.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Generic) 2 | set(CMAKE_SYSTEM_PROCESSOR arm) 3 | 4 | # Some default GCC settings 5 | # arm-none-eabi- must be part of path environment 6 | set(TOOLCHAIN_PREFIX arm-none-eabi-) 7 | set(FLAGS "-fdata-sections -ffunction-sections -Wl,--gc-sections") 8 | set(CPP_FLAGS "${FLAGS} -fno-rtti -fno-exceptions -fno-threadsafe-statics") 9 | 10 | set(CMAKE_C_FLAGS ${FLAGS}) 11 | set(CMAKE_CXX_FLAGS ${CPP_FLAGS}) 12 | 13 | set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) 14 | set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) 15 | set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++) 16 | set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy) 17 | set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size) 18 | 19 | set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf") 20 | set(CMAKE_EXECUTABLE_SUFFIX_C ".elf") 21 | set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf") 22 | 23 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) 24 | -------------------------------------------------------------------------------- /examples/stm32/netconn_client_rtos_stm32f429zi_nucleo/inc/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #define LWCELL_CFG_AT_ECHO 1 44 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 45 | 46 | /* Enable network, conn and netconn APIs */ 47 | #define LWCELL_CFG_NETWORK 1 48 | #define LWCELL_CFG_CONN 1 49 | #define LWCELL_CFG_NETCONN 1 50 | 51 | #endif /* LWCELL_HDR_OPTS_H */ 52 | -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_rtos_stm32f429zi_nucleo/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "configurations": [ 4 | { 5 | /* 6 | * ms-vscode.cmake-tools plugin should be installed. 7 | * 8 | * It provides data for C/C++ plugin, 9 | * such as include paths, browse paths, defines, etc. 10 | */ 11 | "name": "STM32", 12 | "configurationProvider": "ms-vscode.cmake-tools", 13 | "intelliSenseMode": "${default}" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_rtos_stm32f429zi_nucleo/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-vscode.cpptools", 4 | "ms-vscode.cmake-tools", 5 | "marus25.cortex-debug", 6 | "twxs.cmake", 7 | "dan-c-underwood.arm", 8 | "zixuanwang.linkerscript" 9 | ] 10 | } -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_rtos_stm32f429zi_nucleo/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Debug Microcontroller - ST-Link", 9 | "cwd": "${workspaceFolder}", 10 | "type": "cortex-debug", 11 | "executable": "${command:cmake.launchTargetPath}", //or fixed file path: build/stm32h735g-dk-led.elf 12 | "request": "launch", //Use "attach" to connect to target w/o elf download 13 | "servertype": "stlink", 14 | "device": "", //MCU used, ex. "STM32H735IG" 15 | "interface": "swd", 16 | "serialNumber": "", //Set ST-Link ID if you use multiple at the same time 17 | "runToMain": true, 18 | "svdFile": "path/to/file.svd", //Path to SVD file to see registers 19 | "v1": false, 20 | "showDevDebugOutput": "both", 21 | 22 | /* Will get automatically detected if STM32CubeIDE is installed to default directory 23 | or it can be manually provided if necessary.. */ 24 | //"serverpath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.0.100.202109301221\\tools\\bin\\ST-LINK_gdbserver.exe", 25 | //"armToolchainPath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\\tools\\bin", 26 | //"stm32cubeprogrammer": "c:\\Program Files\\STMicroelectronics\\STM32Cube\\STM32CubeProgrammer\\bin", 27 | 28 | /* If you use external loader, add additional arguments */ 29 | //"serverArgs": ["--extload", "path/to/ext/loader.stldr"], 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_rtos_stm32f429zi_nucleo/CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "configurePresets": [ 4 | { 5 | "name": "default", 6 | "hidden": true, 7 | "generator": "Ninja", 8 | "binaryDir": "${sourceDir}/build/${presetName}", 9 | "toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake", 10 | "cacheVariables": { 11 | "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" 12 | } 13 | }, 14 | { 15 | "name": "Debug", 16 | "inherits": "default", 17 | "cacheVariables": { 18 | "CMAKE_BUILD_TYPE": "Debug" 19 | } 20 | }, 21 | { 22 | "name": "RelWithDebInfo", 23 | "inherits": "default", 24 | "cacheVariables": { 25 | "CMAKE_BUILD_TYPE": "RelWithDebInfo" 26 | } 27 | }, 28 | { 29 | "name": "Release", 30 | "inherits": "default", 31 | "cacheVariables": { 32 | "CMAKE_BUILD_TYPE": "Release" 33 | } 34 | }, 35 | { 36 | "name": "MinSizeRel", 37 | "inherits": "default", 38 | "cacheVariables": { 39 | "CMAKE_BUILD_TYPE": "MinSizeRel" 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_rtos_stm32f429zi_nucleo/cmake/gcc-arm-none-eabi.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Generic) 2 | set(CMAKE_SYSTEM_PROCESSOR arm) 3 | 4 | # Some default GCC settings 5 | # arm-none-eabi- must be part of path environment 6 | set(TOOLCHAIN_PREFIX arm-none-eabi-) 7 | set(FLAGS "-fdata-sections -ffunction-sections -Wl,--gc-sections") 8 | set(CPP_FLAGS "${FLAGS} -fno-rtti -fno-exceptions -fno-threadsafe-statics") 9 | 10 | set(CMAKE_C_FLAGS ${FLAGS}) 11 | set(CMAKE_CXX_FLAGS ${CPP_FLAGS}) 12 | 13 | set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) 14 | set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) 15 | set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++) 16 | set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy) 17 | set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size) 18 | 19 | set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf") 20 | set(CMAKE_EXECUTABLE_SUFFIX_C ".elf") 21 | set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf") 22 | 23 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) 24 | -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_rtos_stm32f429zi_nucleo/inc/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #define LWCELL_CFG_AT_ECHO 1 44 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 45 | 46 | /* Enable SMS API */ 47 | #define LWCELL_CFG_SMS 1 48 | 49 | 50 | #endif /* LWCELL_HDR_OPTS_H */ 51 | -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_thread_rtos_stm32f429zi_nucleo/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "configurations": [ 4 | { 5 | /* 6 | * ms-vscode.cmake-tools plugin should be installed. 7 | * 8 | * It provides data for C/C++ plugin, 9 | * such as include paths, browse paths, defines, etc. 10 | */ 11 | "name": "STM32", 12 | "configurationProvider": "ms-vscode.cmake-tools", 13 | "intelliSenseMode": "${default}" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_thread_rtos_stm32f429zi_nucleo/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-vscode.cpptools", 4 | "ms-vscode.cmake-tools", 5 | "marus25.cortex-debug", 6 | "twxs.cmake", 7 | "dan-c-underwood.arm", 8 | "zixuanwang.linkerscript" 9 | ] 10 | } -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_thread_rtos_stm32f429zi_nucleo/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Debug Microcontroller - ST-Link", 9 | "cwd": "${workspaceFolder}", 10 | "type": "cortex-debug", 11 | "executable": "${command:cmake.launchTargetPath}", //or fixed file path: build/stm32h735g-dk-led.elf 12 | "request": "launch", //Use "attach" to connect to target w/o elf download 13 | "servertype": "stlink", 14 | "device": "", //MCU used, ex. "STM32H735IG" 15 | "interface": "swd", 16 | "serialNumber": "", //Set ST-Link ID if you use multiple at the same time 17 | "runToMain": true, 18 | "svdFile": "path/to/file.svd", //Path to SVD file to see registers 19 | "v1": false, 20 | "showDevDebugOutput": "both", 21 | 22 | /* Will get automatically detected if STM32CubeIDE is installed to default directory 23 | or it can be manually provided if necessary.. */ 24 | //"serverpath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.0.100.202109301221\\tools\\bin\\ST-LINK_gdbserver.exe", 25 | //"armToolchainPath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\\tools\\bin", 26 | //"stm32cubeprogrammer": "c:\\Program Files\\STMicroelectronics\\STM32Cube\\STM32CubeProgrammer\\bin", 27 | 28 | /* If you use external loader, add additional arguments */ 29 | //"serverArgs": ["--extload", "path/to/ext/loader.stldr"], 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_thread_rtos_stm32f429zi_nucleo/CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "configurePresets": [ 4 | { 5 | "name": "default", 6 | "hidden": true, 7 | "generator": "Ninja", 8 | "binaryDir": "${sourceDir}/build/${presetName}", 9 | "toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake", 10 | "cacheVariables": { 11 | "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" 12 | } 13 | }, 14 | { 15 | "name": "Debug", 16 | "inherits": "default", 17 | "cacheVariables": { 18 | "CMAKE_BUILD_TYPE": "Debug" 19 | } 20 | }, 21 | { 22 | "name": "RelWithDebInfo", 23 | "inherits": "default", 24 | "cacheVariables": { 25 | "CMAKE_BUILD_TYPE": "RelWithDebInfo" 26 | } 27 | }, 28 | { 29 | "name": "Release", 30 | "inherits": "default", 31 | "cacheVariables": { 32 | "CMAKE_BUILD_TYPE": "Release" 33 | } 34 | }, 35 | { 36 | "name": "MinSizeRel", 37 | "inherits": "default", 38 | "cacheVariables": { 39 | "CMAKE_BUILD_TYPE": "MinSizeRel" 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_thread_rtos_stm32f429zi_nucleo/cmake/gcc-arm-none-eabi.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Generic) 2 | set(CMAKE_SYSTEM_PROCESSOR arm) 3 | 4 | # Some default GCC settings 5 | # arm-none-eabi- must be part of path environment 6 | set(TOOLCHAIN_PREFIX arm-none-eabi-) 7 | set(FLAGS "-fdata-sections -ffunction-sections -Wl,--gc-sections") 8 | set(CPP_FLAGS "${FLAGS} -fno-rtti -fno-exceptions -fno-threadsafe-statics") 9 | 10 | set(CMAKE_C_FLAGS ${FLAGS}) 11 | set(CMAKE_CXX_FLAGS ${CPP_FLAGS}) 12 | 13 | set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) 14 | set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) 15 | set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++) 16 | set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy) 17 | set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size) 18 | 19 | set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf") 20 | set(CMAKE_EXECUTABLE_SUFFIX_C ".elf") 21 | set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf") 22 | 23 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) 24 | -------------------------------------------------------------------------------- /examples/stm32/sms_send_receive_thread_rtos_stm32f429zi_nucleo/inc/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #define LWCELL_CFG_AT_ECHO 1 44 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 45 | 46 | /* Enable SMS API */ 47 | #define LWCELL_CFG_SMS 1 48 | 49 | #endif /* LWCELL_HDR_OPTS_H */ 50 | -------------------------------------------------------------------------------- /examples/win32/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "configurations": [ 4 | { 5 | /* 6 | * Full configuration is provided by CMake plugin for vscode, 7 | * that shall be installed by user 8 | */ 9 | "name": "Win32", 10 | "intelliSenseMode": "${default}", 11 | "configurationProvider": "ms-vscode.cmake-tools" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /examples/win32/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-vscode.cpptools", 4 | "ms-vscode.cmake-tools", 5 | "twxs.cmake", 6 | ] 7 | } -------------------------------------------------------------------------------- /examples/win32/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "(Windows) Launch", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${command:cmake.launchTargetPath}", 12 | "miDebuggerPath": "c:\\msys64\\mingw64\\bin\\gdb.exe", 13 | "args": [], 14 | "stopAtEntry": false, 15 | "cwd": "${fileDirname}", 16 | "environment": [] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /examples/win32/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "lwevt_types.h": "c", 4 | "lwevt_type.h": "c", 5 | "lwevt.h": "c", 6 | "string.h": "c", 7 | "lwevt_opt.h": "c", 8 | "cli.h": "c", 9 | "windows.h": "c" 10 | }, 11 | "esbonio.sphinx.confDir": "" 12 | } -------------------------------------------------------------------------------- /examples/win32/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "cppbuild", 6 | "label": "Build project", 7 | "command": "cmake", 8 | "args": ["--build", "${command:cmake.buildDirectory}", "-j", "8"], 9 | "options": { 10 | "cwd": "${workspaceFolder}" 11 | }, 12 | "problemMatcher": ["$gcc"], 13 | "group": { 14 | "kind": "build", 15 | "isDefault": true 16 | } 17 | }, 18 | { 19 | "type": "shell", 20 | "label": "Re-build project", 21 | "command": "cmake", 22 | "args": ["--build", "${command:cmake.buildDirectory}", "--clean-first", "-v", "-j", "8"], 23 | "options": { 24 | "cwd": "${workspaceFolder}" 25 | }, 26 | "problemMatcher": ["$gcc"], 27 | }, 28 | { 29 | "type": "shell", 30 | "label": "Clean project", 31 | "command": "cmake", 32 | "args": ["--build", "${command:cmake.buildDirectory}", "--target", "clean"], 33 | "options": { 34 | "cwd": "${workspaceFolder}" 35 | }, 36 | "problemMatcher": [] 37 | }, 38 | { 39 | "type": "shell", 40 | "label": "Run application", 41 | "command": "${command:cmake.launchTargetPath}", 42 | "args": [], 43 | "problemMatcher": [], 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /examples/win32/CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "configurePresets": [ 4 | { 5 | "name": "default", 6 | "hidden": true, 7 | "generator": "Ninja", 8 | "binaryDir": "${sourceDir}/build/${presetName}", 9 | "toolchainFile": "${sourceDir}/../../cmake/i686-w64-mingw32-gcc.cmake", 10 | "cacheVariables": { 11 | "CMAKE_BUILD_TYPE": "Debug", 12 | "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" 13 | } 14 | }, 15 | { 16 | "name": "call_rtos", 17 | "inherits": "default", 18 | "cacheVariables": { 19 | "PROJECT_NAME": "call_rtos" 20 | } 21 | }, 22 | { 23 | "name": "call_sms_rtos", 24 | "inherits": "default", 25 | "cacheVariables": { 26 | "PROJECT_NAME": "call_sms_rtos" 27 | } 28 | }, 29 | { 30 | "name": "device_info_rtos", 31 | "inherits": "default", 32 | "cacheVariables": { 33 | "PROJECT_NAME": "device_info_rtos" 34 | } 35 | }, 36 | { 37 | "name": "mqtt_client_api_rtos", 38 | "inherits": "default", 39 | "cacheVariables": { 40 | "PROJECT_NAME": "mqtt_client_api_rtos" 41 | } 42 | }, 43 | { 44 | "name": "netconn_client_rtos", 45 | "inherits": "default", 46 | "cacheVariables": { 47 | "PROJECT_NAME": "netconn_client_rtos" 48 | } 49 | }, 50 | { 51 | "name": "sms_send_receive_rtos", 52 | "inherits": "default", 53 | "cacheVariables": { 54 | "PROJECT_NAME": "sms_send_receive_rtos" 55 | } 56 | } 57 | ], 58 | "buildPresets": [ 59 | { 60 | "name": "call_rtos", 61 | "configurePreset": "call_rtos" 62 | }, 63 | { 64 | "name": "call_sms_rtos", 65 | "configurePreset": "call_sms_rtos" 66 | }, 67 | { 68 | "name": "device_info_rtos", 69 | "configurePreset": "device_info_rtos" 70 | }, 71 | { 72 | "name": "mqtt_client_api_rtos", 73 | "configurePreset": "mqtt_client_api_rtos" 74 | }, 75 | { 76 | "name": "netconn_client_rtos", 77 | "configurePreset": "netconn_client_rtos" 78 | }, 79 | { 80 | "name": "sms_send_receive_rtos", 81 | "configurePreset": "sms_send_receive_rtos" 82 | } 83 | ] 84 | } -------------------------------------------------------------------------------- /examples/win32/README.md: -------------------------------------------------------------------------------- 1 | # WIN32 examples 2 | 3 | Examples are provided as CMake sources. 4 | To run then, you can use VSCode or CMake directly. 5 | 6 | ``` 7 | cmake --preset 8 | cmake --build --preset 9 | ``` 10 | -------------------------------------------------------------------------------- /examples/win32/build_all_examples.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | 4 | # Get presets from the path 5 | # Use cmake command line to list actual presets visible to cmake 6 | def get_presets(): 7 | presets = [] 8 | resp = os.popen("cmake --list-presets").read().strip() 9 | for line in resp.split("\n"): 10 | l = line.strip() 11 | r = re.findall("\"(.*)\"", l) 12 | if r: 13 | presets.append(r[0]) 14 | return presets 15 | 16 | # Main execution 17 | if __name__ == '__main__': 18 | # Get all presets 19 | failed = [] 20 | presets = get_presets() 21 | for preset in presets: 22 | print("-------------------------------") 23 | print("Configuring preset " + preset) 24 | print("-------------------------------") 25 | ret = os.system("cmake --preset " + preset) 26 | if ret != 0: 27 | print("!!!! Command failed !!!! with result code: " + str(ret)) 28 | failed.append(preset) 29 | print("Return: " + str(ret)) 30 | print("-------------------------------") 31 | print("Building preset " + preset) 32 | print("-------------------------------") 33 | ret = os.system("cmake --build --preset " + preset) 34 | if ret != 0: 35 | print("!!!! Command failed !!!! with result code: " + str(ret)) 36 | failed.append(preset) 37 | print("Return: " + str(ret)) 38 | print("-------------------------------") 39 | print("Failed presets:") 40 | for p in failed: 41 | print(p) 42 | print("-------------------------------") -------------------------------------------------------------------------------- /examples/win32/call_rtos/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #define LWCELL_CFG_AT_ECHO 1 44 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 45 | 46 | #define LWCELL_CFG_CALL 1 47 | 48 | #endif /* LWCELL_HDR_OPTS_H */ 49 | -------------------------------------------------------------------------------- /examples/win32/call_rtos/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file main.c 3 | * \brief Main file 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Before you start using WIN32 implementation with USB and VCP, 32 | * check lwcell_ll_win32.c implementation and choose your COM port! 33 | */ 34 | #include "lwcell/lwcell.h" 35 | #include "sim_manager.h" 36 | #include "network_utils.h" 37 | #include "call.h" 38 | #include "examples_common_lwcell_callback_func.h" 39 | 40 | /** 41 | * \brief Program entry point 42 | */ 43 | int 44 | main(void) { 45 | printf("Starting GSM application!\r\n"); 46 | 47 | /* Initialize GSM with default callback function */ 48 | if (lwcell_init(examples_common_lwcell_callback_func, 1) != lwcellOK) { 49 | printf("Cannot initialize LwCELL\r\n"); 50 | } 51 | 52 | /* Configure device by unlocking SIM card */ 53 | if (configure_sim_card()) { 54 | printf("SIM card configured. Adding delay to stabilize SIM card.\r\n"); 55 | lwcell_delay(10000); 56 | } else { 57 | printf("Cannot configure SIM card! Is it inserted, pin valid and not under PUK? Closing down...\r\n"); 58 | while (1) { lwcell_delay(1000); } 59 | } 60 | 61 | /* Start call example */ 62 | call_start(); 63 | 64 | /* 65 | * Do not stop program here. 66 | * New threads were created for GSM processing 67 | */ 68 | while (1) { 69 | lwcell_delay(1000); 70 | } 71 | 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /examples/win32/call_sms_rtos/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #define LWCELL_CFG_AT_ECHO 1 44 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 45 | 46 | #define LWCELL_CFG_SMS 1 47 | #define LWCELL_CFG_CALL 1 48 | 49 | #endif /* LWCELL_HDR_OPTS_H */ 50 | -------------------------------------------------------------------------------- /examples/win32/device_info_rtos/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #define LWCELL_CFG_AT_ECHO 1 44 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 45 | 46 | /* Enable SMS API */ 47 | #define LWCELL_CFG_SMS 1 48 | 49 | #endif /* LWCELL_HDR_OPTS_H */ 50 | -------------------------------------------------------------------------------- /examples/win32/device_info_rtos/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file main.c 3 | * \brief Main file 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Before you start using WIN32 implementation with USB and VCP, 32 | * check lwcell_ll_win32.c implementation and choose your COM port! 33 | */ 34 | #include "lwcell/lwcell.h" 35 | #include "sim_manager.h" 36 | #include "network_utils.h" 37 | #include "device_info.h" 38 | #include "examples_common_lwcell_callback_func.h" 39 | 40 | /** 41 | * \brief Program entry point 42 | */ 43 | int 44 | main(void) { 45 | printf("Starting GSM application!\r\n"); 46 | 47 | /* Initialize GSM with default callback function */ 48 | if (lwcell_init(examples_common_lwcell_callback_func, 1) != lwcellOK) { 49 | printf("Cannot initialize LwCELL\r\n"); 50 | } 51 | 52 | /* Read device info */ 53 | read_device_info(); 54 | 55 | /* 56 | * Do not stop program here. 57 | * New threads were created for GSM processing 58 | */ 59 | while (1) { 60 | lwcell_delay(1000); 61 | } 62 | 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /examples/win32/mqtt_client_api_rtos/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #define LWCELL_CFG_AT_ECHO 1 44 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 45 | 46 | /* Enable network, conn and netconn APIs */ 47 | #define LWCELL_CFG_NETWORK 1 48 | #define LWCELL_CFG_CONN 1 49 | #define LWCELL_CFG_NETCONN 1 50 | 51 | #endif /* LWCELL_HDR_OPTS_H */ 52 | -------------------------------------------------------------------------------- /examples/win32/netconn_client_rtos/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #define LWCELL_CFG_AT_ECHO 1 44 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 45 | 46 | /* Enable network, conn and netconn APIs */ 47 | #define LWCELL_CFG_NETWORK 1 48 | #define LWCELL_CFG_CONN 1 49 | #define LWCELL_CFG_NETCONN 1 50 | 51 | #endif /* LWCELL_HDR_OPTS_H */ 52 | -------------------------------------------------------------------------------- /examples/win32/sms_send_receive_rtos/lwcell_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts.h 3 | * \brief GSM application options 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.0 33 | */ 34 | #ifndef LWCELL_HDR_OPTS_H 35 | #define LWCELL_HDR_OPTS_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | #define LWCELL_CFG_AT_ECHO 1 44 | #define LWCELL_CFG_INPUT_USE_PROCESS 1 45 | 46 | /* Enable SMS API */ 47 | #define LWCELL_CFG_SMS 1 48 | 49 | #endif /* LWCELL_HDR_OPTS_H */ 50 | -------------------------------------------------------------------------------- /library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LwCELL", 3 | "version": "0.1.1", 4 | "description": "Lightweight cellular modem AT commands parser for embedded systems and SimCOM modules", 5 | "keywords": "lwcell, simcom, quectel, lightweiight, AT, AT Commands", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/MaJerle/lwcell.git" 9 | }, 10 | "authors": [ 11 | { 12 | "name": "Tilen Majerle", 13 | "email": "tilen@majerle.eu", 14 | "url": "https://majerle.eu" 15 | } 16 | ], 17 | "license": "MIT", 18 | "homepage": "https://github.com/MaJerle/lwcell", 19 | "dependencies": {}, 20 | "frameworks": "*", 21 | "platforms": "*", 22 | "export": { 23 | "exclude": [ 24 | ".github", 25 | "dev", 26 | "docs", 27 | "**/.vs", 28 | "**/Debug", 29 | "build", 30 | "**/build" 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /lwcell/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.22) 2 | 3 | include(${CMAKE_CURRENT_LIST_DIR}/library.cmake) -------------------------------------------------------------------------------- /lwcell/src/apps/mqtt/lwcell_mqtt_client_evt.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_mqtt_client_evt.c 3 | * \brief MQTT client event helper functions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #include "lwcell/apps/lwcell_mqtt_client_evt.h" 35 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/apps/lwcell_apps.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_apps.h 3 | * \brief Applications main header file 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_APPS_HDR_H 35 | #define LWCELL_APPS_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \defgroup LWCELL_APPS Applications 45 | * \brief Applications based on GSM stack 46 | * \{ 47 | */ 48 | 49 | /** 50 | * \} 51 | */ 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif /* __cplusplus */ 56 | 57 | #endif /* LWCELL_APPS_HDR_H */ 58 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_call.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_call.h 3 | * \brief Call API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_CALL_HDR_H 35 | #define LWCELL_CALL_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL 45 | * \defgroup LWCELL_CALL Call API 46 | * \brief Call manager 47 | * \{ 48 | */ 49 | 50 | lwcellr_t lwcell_call_enable(const lwcell_api_cmd_evt_fn evt_fn, void* const evt_arg, const uint32_t blocking); 51 | lwcellr_t lwcell_call_disable(const lwcell_api_cmd_evt_fn evt_fn, void* const evt_arg, const uint32_t blocking); 52 | 53 | lwcellr_t lwcell_call_start(const char* number, const lwcell_api_cmd_evt_fn evt_fn, void* const evt_arg, 54 | const uint32_t blocking); 55 | lwcellr_t lwcell_call_answer(const lwcell_api_cmd_evt_fn evt_fn, void* const evt_arg, const uint32_t blocking); 56 | lwcellr_t lwcell_call_hangup(const lwcell_api_cmd_evt_fn evt_fn, void* const evt_arg, const uint32_t blocking); 57 | 58 | /** 59 | * \} 60 | */ 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif /* __cplusplus */ 65 | 66 | #endif /* LWCELL_CALL_HDR_H */ 67 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_ftp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_ftp.h 3 | * \brief FTP API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_FTP_HDR_H 35 | #define LWCELL_FTP_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL 45 | * \defgroup LWCELL_FTP File transfer protocol 46 | * \brief File Transfer Protocol (FTP) manager 47 | * 48 | * Currently it is under development 49 | * 50 | * \{ 51 | */ 52 | 53 | /** 54 | * \} 55 | */ 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif /* __cplusplus */ 60 | 61 | #endif /* LWCELL_FTP_HDR_H */ 62 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_http.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_http.h 3 | * \brief HTTP API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_HTTP_HDR_H 35 | #define LWCELL_HTTP_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL 45 | * \defgroup LWCELL_HTTP Hyper Text Transfer Protocol 46 | * \brief Hyper Text Transfer Protocol (HTTP) manager 47 | * \{ 48 | * 49 | * Currently it is under development 50 | * 51 | */ 52 | 53 | /** 54 | * \} 55 | */ 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif /* __cplusplus */ 60 | 61 | #endif /* LWCELL_HTTP_HDR_H */ 62 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_input.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_input.h 3 | * \brief Initialization process 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_INPUT_HDR_H 35 | #define LWCELL_INPUT_HDR_H 36 | 37 | #include 38 | #include "lwcell/lwcell_types.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif /* __cplusplus */ 43 | 44 | /** 45 | * \ingroup LWCELL 46 | * \defgroup LWCELL_INPUT Input processing 47 | * \brief Input function for received data 48 | * \{ 49 | */ 50 | 51 | lwcellr_t lwcell_input(const void* data, size_t len); 52 | lwcellr_t lwcell_input_process(const void* data, size_t len); 53 | 54 | /** 55 | * \} 56 | */ 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif /* __cplusplus */ 61 | 62 | #endif /* LWCELL_INPUT_HDR_H */ 63 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_int.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_int.h 3 | * \brief Internal functions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_INT_HDR_H 35 | #define LWCELL_INT_HDR_H 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif /* __cplusplus */ 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif /* __cplusplus */ 44 | 45 | #endif /* LWCELL_INT_HDR_H */ 46 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_mem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_mem.h 3 | * \brief Memory manager 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_MEM_HDR_H 35 | #define LWCELL_MEM_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL 45 | * \defgroup LWCELL_MEM Memory manager 46 | * \brief Dynamic memory manager 47 | * \{ 48 | */ 49 | 50 | #if !LWCELL_CFG_MEM_CUSTOM || __DOXYGEN__ 51 | 52 | /** 53 | * \brief Single memory region descriptor 54 | */ 55 | typedef struct { 56 | void* start_addr; /*!< Start address of region */ 57 | size_t size; /*!< Size in units of bytes of region */ 58 | } lwcell_mem_region_t; 59 | 60 | uint8_t lwcell_mem_assignmemory(const lwcell_mem_region_t* regions, size_t size); 61 | 62 | #endif /* !LWCELL_CFG_MEM_CUSTOM || __DOXYGEN__ */ 63 | 64 | void* lwcell_mem_malloc(size_t size); 65 | void* lwcell_mem_realloc(void* ptr, size_t size); 66 | void* lwcell_mem_calloc(size_t num, size_t size); 67 | void lwcell_mem_free(void* ptr); 68 | uint8_t lwcell_mem_free_s(void** ptr); 69 | 70 | /** 71 | * \} 72 | */ 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif /* __cplusplus */ 77 | 78 | #endif /* LWCELL_MEM_HDR_H */ 79 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_memories.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_memories.h 3 | * \brief Supported GSM device memories 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | 35 | LWCELL_DEV_MEMORY_ENTRY(SM_P, "SM_P") 36 | LWCELL_DEV_MEMORY_ENTRY(ME_P, "ME_P") 37 | LWCELL_DEV_MEMORY_ENTRY(SM, "SM") 38 | LWCELL_DEV_MEMORY_ENTRY(ME, "ME") 39 | LWCELL_DEV_MEMORY_ENTRY(MT, "MT") 40 | LWCELL_DEV_MEMORY_ENTRY(BM, "BM") 41 | LWCELL_DEV_MEMORY_ENTRY(SR, "SR") 42 | LWCELL_DEV_MEMORY_ENTRY(ON, "ON") 43 | LWCELL_DEV_MEMORY_ENTRY(FD, "FD") 44 | 45 | #undef LWCELL_DEV_MEMORY_ENTRY -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_models.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_models.h 3 | * \brief Supported GSM devices 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | 35 | /* Order: Device name; Device model identification, Is_2G, Is_LTE */ 36 | LWCELL_DEVICE_MODEL_ENTRY(SIM800x, "SIM800", 1, 0, 0) 37 | LWCELL_DEVICE_MODEL_ENTRY(SIM900x, "SIM900", 1, 0, 0) 38 | LWCELL_DEVICE_MODEL_ENTRY(SIM7070G, "7070G", 0, 1, 0) 39 | //LWCELL_DEVICE_MODEL_ENTRY(SIM7000x, "SIM7000", 1, 0) 40 | //LWCELL_DEVICE_MODEL_ENTRY(SIM7020x, "SIM7020", 1, 0) 41 | 42 | #undef LWCELL_DEVICE_MODEL_ENTRY -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_mqtt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_mqtt.h 3 | * \brief MQTT API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_MQTT_HDR_H 35 | #define LWCELL_MQTT_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL 45 | * \defgroup LWCELL_MQTT MQTT API 46 | * \brief MQTT manager 47 | * \{ 48 | */ 49 | 50 | lwcellr_t lwcell_mqtt_connect(lwcell_mqtt_t** instance, const lwcell_mqtt_conn_desc_t* desc, lwcell_evt_fn evt_fn, 51 | const uint32_t blocking); 52 | lwcellr_t lwcell_mqtt_disconnect(lwcell_mqtt_t* instance, const uint32_t blocking); 53 | lwcellr_t lwcell_mqtt_subscribe(lwcell_mqtt_t* instance, const char* topic, uint8_t qos, const uint32_t blocking); 54 | lwcellr_t lwcell_mqtt_unsubscribe(lwcell_mqtt_t* instance, const char* topic, const uint32_t blocking); 55 | lwcellr_t lwcell_mqtt_publish(lwcell_mqtt_t* instance, const char* topic, const void* data, size_t data_len, 56 | const uint32_t blocking); 57 | 58 | /** 59 | * \} 60 | */ 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif /* __cplusplus */ 65 | 66 | #endif /* LWCELL_MQTT_HDR_H */ 67 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_network_api.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_network_api.h 3 | * \brief API functions for multi-thread network functions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_NETWORK_API_HDR_H 35 | #define LWCELL_NETWORK_API_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL_API 45 | * \defgroup LWCELL_NETWORK_API Network API 46 | * \brief Network API functions for multi-thread operations 47 | * \{ 48 | */ 49 | 50 | lwcellr_t lwcell_network_set_credentials(const char* apn, const char* user, const char* pass); 51 | lwcellr_t lwcell_network_request_attach(void); 52 | lwcellr_t lwcell_network_request_detach(void); 53 | 54 | /** 55 | * \} 56 | */ 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif /* __cplusplus */ 61 | 62 | #endif /* LWCELL_NETWORK_API_HDR_H */ 63 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_operator.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_operator.h 3 | * \brief Operator API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_OPERATOR_HDR_H 35 | #define LWCELL_OPERATOR_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL 45 | * \defgroup LWCELL_OPERATOR Network operator API 46 | * \brief network operator API 47 | * \{ 48 | */ 49 | 50 | lwcellr_t lwcell_operator_get(lwcell_operator_curr_t* curr, const lwcell_api_cmd_evt_fn evt_fn, void* const evt_arg, 51 | const uint32_t blocking); 52 | lwcellr_t lwcell_operator_set(lwcell_operator_mode_t mode, lwcell_operator_format_t format, const char* name, 53 | uint32_t num, const lwcell_api_cmd_evt_fn evt_fn, void* const evt_arg, 54 | const uint32_t blocking); 55 | 56 | lwcellr_t lwcell_operator_scan(lwcell_operator_t* ops, size_t opsl, size_t* opf, const lwcell_api_cmd_evt_fn evt_fn, 57 | void* const evt_arg, const uint32_t blocking); 58 | 59 | /** 60 | * \} 61 | */ 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif /* __cplusplus */ 66 | 67 | #endif /* LWCELL_OPERATOR_HDR_H */ 68 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_opts_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_opts_template.h 3 | * \brief Template config file 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_OPTS_HDR_H 35 | #define LWCELL_OPTS_HDR_H 36 | 37 | /* Rename this file to "lwcell_opts.h" for your application */ 38 | 39 | /* 40 | * Open "include/lwcell/lwcell_opt.h" and 41 | * copy & replace here settings you want to change values 42 | */ 43 | 44 | #endif /* LWCELL_OPTS_HDR_H */ 45 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_ping.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_ping.h 3 | * \brief PING API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_PING_HDR_H 35 | #define LWCELL_PING_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL 45 | * \defgroup LWCELL_PING PING API 46 | * \brief PING manager 47 | * \{ 48 | */ 49 | 50 | /** 51 | * \} 52 | */ 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif /* __cplusplus */ 57 | 58 | #endif /* LWCELL_PING_HDR_H */ 59 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_threads.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_threads.h 3 | * \brief OS threads implementations 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_THREADS_HDR_H 35 | #define LWCELL_THREADS_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | void lwcell_thread_produce(void* const arg); 44 | void lwcell_thread_process(void* const arg); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif /* __cplusplus */ 49 | 50 | #endif /* LWCELL_THREADS_HDR_H */ 51 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_timeout.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_timeout.h 3 | * \brief Timeout manager 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_TIMEOUT_HDR_H 35 | #define LWCELL_TIMEOUT_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL 45 | * \defgroup LWCELL_TIMEOUT Timeout manager 46 | * \brief Timeout manager 47 | * \{ 48 | */ 49 | 50 | lwcellr_t lwcell_timeout_add(uint32_t time, lwcell_timeout_fn fn, void* arg); 51 | lwcellr_t lwcell_timeout_remove(lwcell_timeout_fn fn); 52 | 53 | /** 54 | * \} 55 | */ 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif /* __cplusplus */ 60 | 61 | #endif /* LWCELL_TIMEOUT_HDR_H */ 62 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_unicode.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_unicode.h 3 | * \brief Unicode support 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_UNICODE_HDR_H 35 | #define LWCELL_UNICODE_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL 45 | * \defgroup LWCELL_UNICODE Unicode manager 46 | * \brief Unicode support manager 47 | * \{ 48 | */ 49 | 50 | lwcellr_t lwcelli_unicode_decode(lwcell_unicode_t* uni, uint8_t ch); 51 | 52 | /** 53 | * \} 54 | */ 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif /* __cplusplus */ 59 | 60 | #endif /* LWCELL_UNICODE_HDR_H */ 61 | -------------------------------------------------------------------------------- /lwcell/src/include/lwcell/lwcell_ussd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_ussd.h 3 | * \brief Unstructured Supplementary Service Data 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_USSD_HDR_H 35 | #define LWCELL_USSD_HDR_H 36 | 37 | #include "lwcell/lwcell_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif /* __cplusplus */ 42 | 43 | /** 44 | * \ingroup LWCELL 45 | * \defgroup LWCELL_USSD Unstructured Supplementary Service Data 46 | * \brief Unstructured Supplementary Service Data 47 | * \{ 48 | */ 49 | 50 | lwcellr_t lwcell_ussd_run(const char* code, char* resp, size_t resp_len, const lwcell_api_cmd_evt_fn evt_fn, 51 | void* const evt_arg, const uint32_t blocking); 52 | 53 | /** 54 | * \} 55 | */ 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif /* __cplusplus */ 60 | 61 | #endif /* LWCELL_HDR_HTTP_H */ 62 | -------------------------------------------------------------------------------- /lwcell/src/include/system/port/cmsis_os/lwcell_sys_port.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_sys_port.h 3 | * \brief System dependent functions for CMSIS-OS based operating system 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_SYSTEM_PORT_HDR_H 35 | #define LWCELL_SYSTEM_PORT_HDR_H 36 | 37 | #include 38 | #include 39 | #include "cmsis_os.h" 40 | #include "lwcell/lwcell_opt.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif /* __cplusplus */ 45 | 46 | #if LWCELL_CFG_OS && !__DOXYGEN__ 47 | 48 | typedef osMutexId_t lwcell_sys_mutex_t; 49 | typedef osSemaphoreId_t lwcell_sys_sem_t; 50 | typedef osMessageQueueId_t lwcell_sys_mbox_t; 51 | typedef osThreadId_t lwcell_sys_thread_t; 52 | typedef osPriority_t lwcell_sys_thread_prio_t; 53 | 54 | #define LWCELL_SYS_MUTEX_NULL ((lwcell_sys_mutex_t)0) 55 | #define LWCELL_SYS_SEM_NULL ((lwcell_sys_sem_t)0) 56 | #define LWCELL_SYS_MBOX_NULL ((lwcell_sys_mbox_t)0) 57 | #define LWCELL_SYS_TIMEOUT ((uint32_t)osWaitForever) 58 | #define LWCELL_SYS_THREAD_PRIO (osPriorityNormal) 59 | #define LWCELL_SYS_THREAD_SS (512) 60 | 61 | #endif /* LWCELL_CFG_OS && !__DOXYGEN__ */ 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif /* __cplusplus */ 66 | 67 | #endif /* LWCELL_SYSTEM_PORT_HDR_H */ 68 | -------------------------------------------------------------------------------- /lwcell/src/include/system/port/threadx/lwcell_sys_port.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_sys_port.h 3 | * \brief ThreadX native port 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight GSM-AT parser library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_SYSTEM_PORT_HDR_H 35 | #define LWCELL_SYSTEM_PORT_HDR_H 36 | 37 | #include 38 | #include 39 | #include "lwcell/lwcell_opt.h" 40 | #include "tx_api.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif /* __cplusplus */ 45 | 46 | #if LWCELL_CFG_OS && !__DOXYGEN__ 47 | 48 | typedef TX_MUTEX lwcell_sys_mutex_t; 49 | typedef TX_SEMAPHORE lwcell_sys_sem_t; 50 | typedef TX_QUEUE lwcell_sys_mbox_t; 51 | typedef TX_THREAD lwcell_sys_thread_t; 52 | typedef UINT lwcell_sys_thread_prio_t; 53 | 54 | #define LWCELL_SYS_TIMEOUT TX_WAIT_FOREVER 55 | #define LWCELL_SYS_THREAD_PRIO (TX_MAX_PRIORITIES - 1) 56 | #define LWCELL_SYS_THREAD_SS 1024 57 | 58 | #endif /* LWCELL_CFG_OS && !__DOXYGEN__ */ 59 | 60 | void lwcell_sys_preinit_threadx_set_bytepool_handle(TX_BYTE_POOL* bp); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif /* __cplusplus */ 65 | 66 | #endif /* LWCELL_SYSTEM_PORT_HDR_H */ 67 | -------------------------------------------------------------------------------- /lwcell/src/include/system/port/win32/lwcell_sys_port.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_sys_port.h 3 | * \brief WIN32 based system file implementation 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #ifndef LWCELL_SYSTEM_PORT_HDR_H 35 | #define LWCELL_SYSTEM_PORT_HDR_H 36 | 37 | #include 38 | #include 39 | #include "lwcell/lwcell_opt.h" 40 | #include "windows.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif /* __cplusplus */ 45 | 46 | #if LWCELL_CFG_OS && !__DOXYGEN__ 47 | 48 | typedef HANDLE lwcell_sys_mutex_t; 49 | typedef HANDLE lwcell_sys_sem_t; 50 | typedef HANDLE lwcell_sys_mbox_t; 51 | typedef HANDLE lwcell_sys_thread_t; 52 | typedef int lwcell_sys_thread_prio_t; 53 | 54 | #define LWCELL_SYS_MUTEX_NULL ((HANDLE)0) 55 | #define LWCELL_SYS_SEM_NULL ((HANDLE)0) 56 | #define LWCELL_SYS_MBOX_NULL ((HANDLE)0) 57 | #define LWCELL_SYS_TIMEOUT (INFINITE) 58 | #define LWCELL_SYS_THREAD_PRIO (0) 59 | #define LWCELL_SYS_THREAD_SS (4096) 60 | 61 | #endif /* LWCELL_CFG_OS && !__DOXYGEN__ */ 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif /* __cplusplus */ 66 | 67 | #endif /* LWCELL_SYSTEM_PORT_HDR_H */ 68 | -------------------------------------------------------------------------------- /lwcell/src/lwcell/lwcell_debug.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_debug.c 3 | * \brief Debugging inside GSM stack 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #include "lwcell/lwcell_debug.h" 35 | #include "lwcell/lwcell_private.h" 36 | 37 | #if LWCELL_CFG_DBG || __DOXYGEN__ 38 | 39 | const char* 40 | lwcelli_dbg_msg_to_string(lwcell_cmd_t cmd) { 41 | static char tmp_arr[100]; 42 | if (cmd) { 43 | sprintf(tmp_arr, "%d", (int)cmd); 44 | return tmp_arr; 45 | } 46 | return ""; 47 | } 48 | 49 | #endif /* LWCELL_CFG_DBG || __DOXYGEN__ */ 50 | -------------------------------------------------------------------------------- /lwcell/src/lwcell/lwcell_ftp.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_ftp.c 3 | * \brief FTP API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #include "lwcell/lwcell_ftp.h" 35 | #include "lwcell/lwcell_private.h" 36 | 37 | #if LWCELL_CFG_FTP || __DOXYGEN__ 38 | 39 | #endif /* LWCELL_CFG_FTP || __DOXYGEN__ */ 40 | -------------------------------------------------------------------------------- /lwcell/src/lwcell/lwcell_http.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_http.c 3 | * \brief HTTP API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #include "lwcell/lwcell_http.h" 35 | #include "lwcell/lwcell_private.h" 36 | 37 | #if LWCELL_CFG_HTTP || __DOXYGEN__ 38 | 39 | #endif /* LWCELL_CFG_HTTP || __DOXYGEN__ */ 40 | -------------------------------------------------------------------------------- /lwcell/src/lwcell/lwcell_ping.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_ping.c 3 | * \brief PING API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #include "lwcell/lwcell_ping.h" 35 | #include "lwcell/lwcell_private.h" 36 | 37 | #if LWCELL_CFG_PING || __DOXYGEN__ 38 | 39 | #endif /* LWCELL_CFG_PING || __DOXYGEN__ */ 40 | -------------------------------------------------------------------------------- /lwcell/src/system/lwcell_mem_lwmem.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_mem_lwmem.c 3 | * \brief Dynamic memory manager implemented with LwMEM 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight cellular modem AT library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #include "lwcell/lwcell_types.h" 35 | 36 | /* See lwcell_mem.c file for function documentation on parameters and return values */ 37 | 38 | #if LWCELL_CFG_MEM_CUSTOM && !__DOXYGEN__ 39 | 40 | /* 41 | * Before this driver can be used, user must: 42 | * 43 | * - Configure LwMEM for thread-safety mode by enabling operating system features 44 | * - Set memory regions during start of application 45 | */ 46 | 47 | #include "lwmem/lwmem.h" 48 | 49 | void* 50 | lwcell_mem_malloc(size_t size) { 51 | return lwmem_malloc(size); 52 | } 53 | 54 | void* 55 | lwcell_mem_realloc(void* ptr, size_t size) { 56 | return lwmem_realloc(ptr, size); 57 | } 58 | 59 | void* 60 | lwcell_mem_calloc(size_t num, size_t size) { 61 | return lwmem_calloc(num, size); 62 | } 63 | 64 | void 65 | lwcell_mem_free(void* ptr) { 66 | lwmem_free(ptr); 67 | } 68 | 69 | #endif /* LWCELL_CFG_MEM_CUSTOM && !__DOXYGEN__ */ -------------------------------------------------------------------------------- /lwcell/src/system/lwcell_mem_threadx.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file lwcell_mem_lwmem.c 3 | * \brief Dynamic memory manager implemented with LwMEM 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2024 Tilen MAJERLE 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without restriction, 12 | * including without limitation the rights to use, copy, modify, merge, 13 | * publish, distribute, sublicense, and/or sell copies of the Software, 14 | * and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be 18 | * included in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 23 | * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | * OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * This file is part of LwCELL - Lightweight GSM-AT parser library. 30 | * 31 | * Author: Tilen MAJERLE 32 | * Version: v0.1.1 33 | */ 34 | #include "lwcell/lwcell_types.h" 35 | #include "tx_api.h" 36 | 37 | #if !__DOXYGEN__ 38 | 39 | /* Byte pool is defined externally, in the lwcell_sys_threadx.c file */ 40 | extern TX_BYTE_POOL* lwcell_threadx_byte_pool; 41 | 42 | void* 43 | lwcell_mem_malloc(size_t size) { 44 | void* pointer; 45 | return tx_byte_allocate(lwcell_threadx_byte_pool, &pointer, size, TX_NO_WAIT) == TX_SUCCESS ? pointer : NULL; 46 | } 47 | 48 | void* 49 | lwcell_mem_realloc(void* ptr, size_t size) { 50 | /* No need to support it */ 51 | return NULL; 52 | } 53 | 54 | void* 55 | lwcell_mem_calloc(size_t num, size_t size) { 56 | size_t total = num * size; 57 | void* pointer = lwcell_mem_malloc(total); 58 | TX_MEMSET(pointer, 0, total); 59 | return pointer; 60 | } 61 | 62 | void 63 | lwcell_mem_free(void* ptr) { 64 | (VOID) tx_byte_release(ptr); 65 | } 66 | 67 | #endif /* !__DOXYGEN__ */ 68 | -------------------------------------------------------------------------------- /snippets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.22) 2 | 3 | # Setup generic source files 4 | set(lwcell_snippets_SRCS 5 | ${CMAKE_CURRENT_LIST_DIR}/call.c 6 | ${CMAKE_CURRENT_LIST_DIR}/call_sms.c 7 | ${CMAKE_CURRENT_LIST_DIR}/client.c 8 | ${CMAKE_CURRENT_LIST_DIR}/device_info.c 9 | ${CMAKE_CURRENT_LIST_DIR}/mqtt_client_api.c 10 | ${CMAKE_CURRENT_LIST_DIR}/netconn_client.c 11 | ${CMAKE_CURRENT_LIST_DIR}/network_utils.c 12 | ${CMAKE_CURRENT_LIST_DIR}/sim_manager.c 13 | ${CMAKE_CURRENT_LIST_DIR}/sms_send_receive.c 14 | ${CMAKE_CURRENT_LIST_DIR}/sms_send_receive_thread.c 15 | ) 16 | 17 | # Setup include directories 18 | set(lwcell_snippets_include_DIRS 19 | ${CMAKE_CURRENT_LIST_DIR}/include 20 | ) 21 | 22 | # Register library to the system 23 | add_library(lwcell_snippets INTERFACE) 24 | target_sources(lwcell_snippets PUBLIC ${lwcell_snippets_SRCS}) 25 | target_include_directories(lwcell_snippets INTERFACE ${lwcell_snippets_include_DIRS}) 26 | -------------------------------------------------------------------------------- /snippets/call.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Receive call and answer to it example 3 | */ 4 | #include "call.h" 5 | #include "lwcell/lwcell.h" 6 | 7 | #if !LWCELL_CFG_CALL 8 | #error "CALL must be enabled to run this example" 9 | #endif /* !LWCELL_CFG_CALL */ 10 | 11 | static lwcellr_t call_evt_func(lwcell_evt_t* evt); 12 | 13 | /** 14 | * \brief Start CALL example 15 | */ 16 | void 17 | call_start(void) { 18 | /* Add custom callback */ 19 | lwcell_evt_register(call_evt_func); 20 | 21 | /* Enable calls */ 22 | if (lwcell_call_enable(NULL, NULL, 1) == lwcellOK) { 23 | printf("Calls enabled. You may take your phone and call GSM device number.\r\n"); 24 | } else { 25 | printf("Could not enable call functionality!\r\n"); 26 | } 27 | } 28 | 29 | /** 30 | * \brief Event function for calls 31 | * \param[in] evt: GSM event 32 | * \return \ref lwcellOK on success, member of \ref lwcellr_t otherwise 33 | */ 34 | static lwcellr_t 35 | call_evt_func(lwcell_evt_t* evt) { 36 | switch (lwcell_evt_get_type(evt)) { 37 | case LWCELL_EVT_CALL_CHANGED: { 38 | const lwcell_call_t* call = lwcell_evt_call_changed_get_call(evt); 39 | if (call->state == LWCELL_CALL_STATE_ACTIVE) { 40 | printf("Call is active!\r\n"); 41 | 42 | /* In case of mobile originated direction */ 43 | if (call->dir == LWCELL_CALL_DIR_MO) { 44 | lwcell_call_hangup(NULL, NULL, 0); /* Manually hangup call */ 45 | } 46 | } else if (call->state == LWCELL_CALL_STATE_INCOMING) { 47 | printf("Incoming call received! Phone number: %s\r\n", call->number); 48 | lwcell_call_answer(NULL, NULL, 0); /* Answer to a call */ 49 | } else if (call->state == LWCELL_CALL_STATE_DIALING) { 50 | printf("Call is dialing!\r\n"); 51 | } else if (call->state == LWCELL_CALL_STATE_DISCONNECT) { 52 | printf("Call ended!\r\n"); 53 | } 54 | break; 55 | } 56 | default: 57 | break; 58 | } 59 | return lwcellOK; 60 | } 61 | -------------------------------------------------------------------------------- /snippets/device_info.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Read device information 3 | */ 4 | #include "lwcell/lwcell.h" 5 | 6 | /** 7 | * \brief Device info string array 8 | */ 9 | static char dev_str[20]; 10 | 11 | /** 12 | * \brief Start SMS send receive procedure 13 | */ 14 | void 15 | read_device_info(void) { 16 | /* Read information */ 17 | 18 | /* Read device manufacturer */ 19 | lwcell_device_get_manufacturer(dev_str, sizeof(dev_str), NULL, NULL, 1); 20 | printf("Manuf: %s\r\n", dev_str); 21 | 22 | /* Read device model */ 23 | lwcell_device_get_model(dev_str, sizeof(dev_str), NULL, NULL, 1); 24 | printf("Model: %s\r\n", dev_str); 25 | 26 | /* Read device serial number */ 27 | lwcell_device_get_serial_number(dev_str, sizeof(dev_str), NULL, NULL, 1); 28 | printf("Serial: %s\r\n", dev_str); 29 | 30 | /* Read device revision */ 31 | lwcell_device_get_revision(dev_str, sizeof(dev_str), NULL, NULL, 1); 32 | printf("Revision: %s\r\n", dev_str); 33 | } 34 | -------------------------------------------------------------------------------- /snippets/examples_common_lwcell_callback_func.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "examples_common_lwcell_callback_func.h" 3 | #include "network_utils.h" 4 | #include "lwcell/lwcell.h" 5 | 6 | /** 7 | * \brief Core LwCELL callback function for all examples in the repository. 8 | * 9 | * This reduces redundancy of the same code being written multiple times. 10 | * 11 | * \param[in] evt: Event data 12 | * \return \ref lwcellOK on success, member of \ref lwcellr_t otherwise 13 | */ 14 | lwcellr_t 15 | examples_common_lwcell_callback_func(lwcell_evt_t* evt) { 16 | switch (lwcell_evt_get_type(evt)) { 17 | case LWCELL_EVT_INIT_FINISH: { 18 | printf("Library initialized!\r\n"); 19 | break; 20 | } 21 | 22 | /* Process and print registration change */ 23 | case LWCELL_EVT_NETWORK_REG_CHANGED: { 24 | network_utils_process_reg_change(evt); 25 | break; 26 | } 27 | 28 | /* Process current network operator */ 29 | case LWCELL_EVT_NETWORK_OPERATOR_CURRENT: { 30 | network_utils_process_curr_operator(evt); 31 | break; 32 | } 33 | 34 | /* Process signal strength */ 35 | case LWCELL_EVT_SIGNAL_STRENGTH: { 36 | network_utils_process_rssi(evt); 37 | break; 38 | } 39 | 40 | /* Other user events here... */ 41 | default: break; 42 | } 43 | return lwcellOK; 44 | } 45 | -------------------------------------------------------------------------------- /snippets/include/call.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_CALL_H 2 | #define SNIPPET_HDR_CALL_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | void call_start(void); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif /* __cplusplus */ 13 | 14 | #endif /* SNIPPET_HDR_CALL_H */ 15 | -------------------------------------------------------------------------------- /snippets/include/call_sms.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_CALL_SMS_H 2 | #define SNIPPET_HDR_CALL_SMS_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | void call_sms_start(void); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif /* __cplusplus */ 13 | 14 | #endif /* SNIPPET_HDR_CALL_SMS_H */ 15 | -------------------------------------------------------------------------------- /snippets/include/client.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_CLIENT_H 2 | #define SNIPPET_HDR_CLIENT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | void client_connect(void); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif /* __cplusplus */ 13 | 14 | #endif /* SNIPPET_HDR_CLIENT_H */ 15 | -------------------------------------------------------------------------------- /snippets/include/device_info.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_DEVICE_INFO_H 2 | #define SNIPPET_HDR_DEVICE_INFO_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | void read_device_info(void); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif /* __cplusplus */ 13 | 14 | #endif /* SNIPPET_HDR_DEVICE_INFO_H */ 15 | -------------------------------------------------------------------------------- /snippets/include/examples_common_lwcell_callback_func.h: -------------------------------------------------------------------------------- 1 | #ifndef EXAMPLES_COMMON_LWCELL_CALLBACK_FUNC 2 | #define EXAMPLES_COMMON_LWCELL_CALLBACK_FUNC 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | #include "lwcell/lwcell.h" 9 | 10 | lwcellr_t examples_common_lwcell_callback_func(lwcell_evt_t* evt); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif /* __cplusplus */ 15 | 16 | #endif /* EXAMPLES_COMMON_LWCELL_CALLBACK_FUNC */ 17 | -------------------------------------------------------------------------------- /snippets/include/mqtt_client_api.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_MQTT_CLIENT_API_H 2 | #define SNIPPET_HDR_MQTT_CLIENT_API_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | void lwcell_mqtt_client_api_thread(void const* arg); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif /* __cplusplus */ 13 | 14 | #endif /* SNIPPET_HDR_MQTT_CLIENT_API_H */ 15 | -------------------------------------------------------------------------------- /snippets/include/netconn_client.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_NETCONN_CLIENT_H 2 | #define SNIPPET_HDR_NETCONN_CLIENT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | void netconn_client_thread(void const* arg); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif /* __cplusplus */ 13 | 14 | #endif /* SNIPPET_HDR_NETCONN_CLIENT_H */ 15 | -------------------------------------------------------------------------------- /snippets/include/network_apn_settings.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_NETWORK_APN_SETTINGS_H 2 | #define SNIPPET_HDR_NETWORK_APN_SETTINGS_H 3 | 4 | #include "lwcell/lwcell_network_api.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif /* __cplusplus */ 9 | 10 | /* APN settings to attach to network */ 11 | #define NETWORK_APN "internet" 12 | #define NETWORK_APN_USER "" 13 | #define NETWORK_APN_PASS "" 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif /* __cplusplus */ 18 | 19 | #endif /* SNIPPET_HDR_NETWORK_APN_SETTINGS_H */ 20 | -------------------------------------------------------------------------------- /snippets/include/network_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_NETWORK_UTILS_H 2 | #define SNIPPET_HDR_NETWORK_UTILS_H 3 | 4 | #include 5 | #include "lwcell/lwcell.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif /* __cplusplus */ 10 | 11 | void network_utils_process_reg_change(lwcell_evt_t* evt); 12 | void network_utils_process_curr_operator(lwcell_evt_t* evt); 13 | void network_utils_process_rssi(lwcell_evt_t* evt); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif /* __cplusplus */ 18 | 19 | #endif /* SNIPPET_HDR_NETWORK_UTILS_H */ 20 | -------------------------------------------------------------------------------- /snippets/include/sim_manager.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_SIM_MANAGER_H 2 | #define SNIPPET_HDR_SIM_MANAGER_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif /* __cplusplus */ 9 | 10 | uint8_t configure_sim_card(void); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif /* __cplusplus */ 15 | 16 | #endif /* SNIPPET_HDR_SIM_MANAGER_H */ 17 | -------------------------------------------------------------------------------- /snippets/include/sms_send_receive.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_SMS_SEND_RECEIVE_H 2 | #define SNIPPET_HDR_SMS_SEND_RECEIVE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | void sms_send_receive_start(void); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif /* __cplusplus */ 13 | 14 | #endif /* SNIPPET_HDR_SMS_SEND_RECEIVE_H */ 15 | -------------------------------------------------------------------------------- /snippets/include/sms_send_receive_thread.h: -------------------------------------------------------------------------------- 1 | #ifndef SNIPPET_HDR_SMS_SEND_RECEIVE_THREAD_H 2 | #define SNIPPET_HDR_SMS_SEND_RECEIVE_THREAD_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif /* __cplusplus */ 7 | 8 | void sms_send_receive_thread(void const* arg); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif /* __cplusplus */ 13 | 14 | #endif /* SNIPPET_HDR_SMS_SEND_RECEIVE_THREAD_H */ 15 | -------------------------------------------------------------------------------- /snippets/network_utils.c: -------------------------------------------------------------------------------- 1 | #include "network_utils.h" 2 | #include "lwcell/lwcell.h" 3 | 4 | /** 5 | * \brief RSSI state on network 6 | */ 7 | static int16_t 8 | rssi; 9 | 10 | /** 11 | * \brief Process and print network registration status update 12 | * \param[in] evt: GSM event data 13 | */ 14 | void 15 | network_utils_process_reg_change(lwcell_evt_t* evt) { 16 | lwcell_network_reg_status_t stat; 17 | 18 | stat = lwcell_network_get_reg_status(); /* Get network status */ 19 | 20 | /* Print to console */ 21 | printf("Network registration status changed. New status is: "); 22 | switch (stat) { 23 | case LWCELL_NETWORK_REG_STATUS_CONNECTED: 24 | printf("Connected to home network!\r\n"); 25 | break; 26 | case LWCELL_NETWORK_REG_STATUS_CONNECTED_ROAMING: 27 | printf("Connected to network and roaming!\r\n"); 28 | break; 29 | case LWCELL_NETWORK_REG_STATUS_SEARCHING: 30 | printf("Searching for network!\r\n"); 31 | break; 32 | case LWCELL_NETWORK_REG_STATUS_SIM_ERR: 33 | printf("SIM CARD ERROR!\r\n"); 34 | break; 35 | default: 36 | printf("Other\r\n"); 37 | } 38 | 39 | LWCELL_UNUSED(evt); 40 | } 41 | 42 | /** 43 | * \brief Process and print network current operator status 44 | * \param[in] evt: GSM event data 45 | */ 46 | void 47 | network_utils_process_curr_operator(lwcell_evt_t* evt) { 48 | const lwcell_operator_curr_t* o; 49 | if ((o = lwcell_evt_network_operator_get_current(evt)) != NULL) { 50 | switch (o->format) { 51 | case LWCELL_OPERATOR_FORMAT_LONG_NAME: 52 | printf("Operator long name: %s\r\n", o->data.long_name); 53 | break; 54 | case LWCELL_OPERATOR_FORMAT_SHORT_NAME: 55 | printf("Operator short name: %s\r\n", o->data.short_name); 56 | break; 57 | case LWCELL_OPERATOR_FORMAT_NUMBER: 58 | printf("Operator number: %d\r\n", (int)o->data.num); 59 | break; 60 | default: 61 | break; 62 | } 63 | } 64 | /* Start RSSI info */ 65 | lwcell_network_rssi(&rssi, NULL, NULL, 0); 66 | } 67 | 68 | /** 69 | * \brief Process and print RSSI info 70 | * \param[in] evt: GSM event data 71 | */ 72 | void 73 | network_utils_process_rssi(lwcell_evt_t* evt) { 74 | int16_t rssi; 75 | 76 | /* Get RSSi from event */ 77 | rssi = lwcell_evt_signal_strength_get_rssi(evt); 78 | 79 | /* Print message to screen */ 80 | printf("Network operator RSSI: %d dBm\r\n", (int)rssi); 81 | } 82 | -------------------------------------------------------------------------------- /snippets/sim_manager.c: -------------------------------------------------------------------------------- 1 | #include "sim_manager.h" 2 | #include "lwcell/lwcell.h" 3 | 4 | /** 5 | * \brief SIM card pin code 6 | */ 7 | static const char* pin_code = "7958"; 8 | 9 | /** 10 | * \brief SIM card puk code 11 | */ 12 | static const char* puk_code = "10663647"; 13 | 14 | /** 15 | * \brief Configure and enable SIM card 16 | * \return `1` on success, `0` otherwise 17 | */ 18 | uint8_t 19 | configure_sim_card(void) { 20 | LWCELL_UNUSED(puk_code); 21 | if (pin_code != NULL && strlen(pin_code)) { 22 | if (lwcell_sim_pin_enter(pin_code, NULL, NULL, 1) == lwcellOK) { 23 | return 1; 24 | } 25 | return 0; 26 | } 27 | return 1; 28 | } 29 | --------------------------------------------------------------------------------