{"id":13576878,"url":"https://github.com/RealTimeLogic/BAS","last_synced_at":"2025-04-05T09:30:28.171Z","repository":{"id":149533824,"uuid":"433969507","full_name":"RealTimeLogic/BAS","owner":"RealTimeLogic","description":"Embedded Web Server Library with Integrated Scripting Engine","archived":false,"fork":false,"pushed_at":"2025-01-20T20:41:54.000Z","size":14921,"stargazers_count":65,"open_issues_count":0,"forks_count":14,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-01-20T21:38:25.868Z","etag":null,"topics":["embedded","embedded-web-server","embedded-webserver","http","iot","lua","mqtt","web-server","webdav","websocket"],"latest_commit_sha":null,"homepage":"https://realtimelogic.com/products/barracuda-application-server/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RealTimeLogic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-01T20:08:00.000Z","updated_at":"2025-01-20T20:41:58.000Z","dependencies_parsed_at":"2024-04-20T15:41:34.669Z","dependency_job_id":"5d0ed5bd-a8e0-4330-b2bb-7fc936bdb122","html_url":"https://github.com/RealTimeLogic/BAS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealTimeLogic%2FBAS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealTimeLogic%2FBAS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealTimeLogic%2FBAS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealTimeLogic%2FBAS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RealTimeLogic","download_url":"https://codeload.github.com/RealTimeLogic/BAS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247317824,"owners_count":20919444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","embedded-web-server","embedded-webserver","http","iot","lua","mqtt","web-server","webdav","websocket"],"created_at":"2024-08-01T15:01:15.363Z","updated_at":"2025-04-05T09:30:28.154Z","avatar_url":"https://github.com/RealTimeLogic.png","language":"C","readme":"# BWS and BAS Amalgamated\r\n## Embedded Web Server and IoT Toolkit C Code Libraries\r\n- **[BAS and BWS License](#license)**\r\n- **BWS:** [Barracuda Embedded Web Server C library](https://realtimelogic.com/products/barracuda-web-server/)\r\n- **BAS:** [Barracuda Embedded App Server C library](https://realtimelogic.com/products/barracuda-application-server/)\r\n\r\n\u003cimg align=\"left\" width=\"200\" height=\"200\" alt=\"Barracuda App Server Logo\" src=\"https://realtimelogic.com/ba/doc/logo.svg\"\u003e\r\n\r\nThe BWS and BAS C code libraries support the following platforms: Embedded Linux, Zephyr, FreeRTOS+TCP or lwIP, VxWorks, QNX, INTEGRITY, Windows \u0026 Win CE, Azure RTOS, Nucleus RTOS, embOS, RTXC, SMX, MQX, RTOS-32, Mac, and UNIX/POSIX.\r\n\r\nRTL has crafted the two amalgamated libraries from the full BAS SDK; **Amalgamated** indicates that we have combined all separate C files into one file, simplifying the compilation and integration process into your build. The products run on anything from tiny FPGA's to online cloud servers.\r\n\r\nBoth BWS and BAS are application servers that share the same porting layer modules, making their integration process almost identical. BAS includes all the C APIs available in BWS, but it goes a step further by focusing on the Lua language. This makes BAS handy for rapid development and offers an easier entry point for secure web and IoT app development. Check out the tutorial [Embedded Web Server vs. Embedded Application Server](https://realtimelogic.com/products/web-server-vs-application-server/) if you are new to application server technology.\r\n\r\n## BWS\r\n\r\nThe Barracuda Embedded Web Server is a small embedded HTTP(S) and WebSocket C source code library pre-integrated with the SharkSSL TLS stack. The source code is optimized for compact, deeply embedded devices.\r\n\r\n[![Barracuda Embedded Web Server](https://realtimelogic.com/GZ/images/BarracudaWebServer.svg)](https://realtimelogic.com/products/barracuda-web-server/)\r\n\r\n- [Barracuda Embedded Web Server Product Page](https://realtimelogic.com/products/barracuda-web-server/)\r\n\r\n## BAS\r\n\r\nThe Barracuda App Server, powered by BWS, is a powerful IoT toolkit that equips engineers with the necessary tools to create secure and efficient web and IoT products. While you can develop applications using C/C++ on BAS, it also features the powerful Lua engine. This engine is designed for ease of use, enabling developers to construct up to 80% of their embedded applications in Lua without compromising on efficiency.\r\n\r\n[![Barracuda App Server Product Page](https://realtimelogic.com/GZ/images/BarracudaAppServerBLK.svg)](https://realtimelogic.com/products/barracuda-application-server/)\r\n\r\n- [Barracuda App Server Product Page](https://realtimelogic.com/products/barracuda-application-server/)\r\n\r\nWhen learning a new framework, it's not mastering the language that's time-consuming - it's understanding the API. The Lua IoT and Web APIs are considerably simpler and more intuitive than their lower-level C counterparts. For this reason, opting for Lua can significantly reduce your development time. Using Lua instead of C for network-enabled applications offers several compelling advantages:\r\n\r\n- **Ease of Use:** Lua is renowned for its simplicity and elegance, significantly reducing the learning curve for new developers and speeding up the development process.\r\n- **Flexibility:** Lua's lightweight and flexible nature makes it ideal for scripting customizable behaviors in network applications without the complexity often associated with C.\r\n- **Rapid Prototyping:** Lua enables faster prototyping and iteration, which is crucial in IoT development.\r\n- **Enhanced Security:** Lua provides a higher-level approach that abstracts many low-level operations, reducing the risk of security flaws that are more prevalent in direct system-level coding with C.\r\n- **Efficiency:** Although Lua is an interpreted language, it runs efficiently on embedded systems, thanks to its well-optimized engine and the ability to offload performance-critical tasks back to C modules if necessary.\r\n- [Lua Server Pages](https://realtimelogic.com/products/lua-server-pages/) (LSP for short) is a [Lua](https://www.lua.org/about.html) API that includes a compact and efficient Lua web framework, non-blocking asynchronous sockets, and many (I)IoT protocols.\r\n\r\n### Are you already using Lua? Not a problem!\r\n\r\nThe Lua source code is included in BAS.c, but you can exclude this code by compiling with -DUSE_BA_LUA=0. You can compile and link BAS.c with your Lua version by excluding our version.\r\n\r\n\r\n\r\n## C Code Components\r\n\r\nInclude the following in your build:\r\n\r\n* Amalgamated C code library (amalgamation of many files); one of:\r\n  - BWS.c: The Barracuda Web Server\r\n  - BAS.c: The Barracuda App Server\r\n* ThreadLib.c: Kernel porting layer\r\n* SoDisp.c: TCP/IP porting layer (the socket dispatcher)\r\n* BaFile.c: File system porting layer (optional)\r\n\r\n## Who Can Use BAS Amalgamated\r\n\r\nBAS Amalgamated runs efficiently on a Cortex M4 running @100Mhz and up; however, most microcontrollers will need external memory. See the Memory section in the [Porting Barracuda to an Embedded System](https://realtimelogic.com/ba/doc/en/introduction.html#porting) for details.\r\n\r\n## Before Downloading the Source Code\r\n\r\nThe Barracuda App Server is a feature-rich product. To ease into its diverse options, you might find it helpful to start by downloading one of the [pre-compiled binaries with included Lua tutorials](https://realtimelogic.com/downloads/bas/), which are complemented with handy Lua tutorials, prior to accessing the source code.\r\n\r\n## How To Compile\r\n\r\nTo compile BAS, include BAS.c, src/arch/XXX/ThreadLib.c, src/arch/NET/XXX/SoDisp.c, and optionally src/DiskIo/XXX/BaFile.c, where XXX is the required porting layer. In addition, the compiler's include path must include inc/arch/XXX, inc/arch/NET/XXX, and optionally inc/DiskIo/XXX\r\n\r\nBAS is extremely flexible and can, for example, be used as follows:\r\n* Compiled and integrated with RTOS powered monolithic firmware\r\n* Compiled and run as a process on a High Level Operating System (HLOS) such as embedded Linux\r\n* Compiled and integrated with a standard (desktop) application\r\n\r\nBAS Amalgamated is very easy to compile and several command line compilation examples are shown below. You can add the code to any IDE and Makefile system.\r\n\r\n## Examples\r\n\r\nBAS and BWS are versatile C libraries designed for seamless integration into a wide range of devices and programs, from small ASIC-powered gadgets to Windows applications. To help you get started with the libraries, we provide three ready-to-use reference builds:\r\n\r\n- The [Mako Server](#mako-server-hlos) (BAS)\r\n- The [Xedge](#xedge-rtos) (BAS)\r\n- The [C++ WebSocket Server Example](examples/C-WebSockets/README.md) (BWS)\r\n\r\n* **BAS Examples:** The Mako Server is designed for HLOS, and Xedge is designed for RTOS. Both examples provide a [Lua foundation](https://realtimelogic.com/products/lua-server-pages/) enabling rapid interactive development of web, IoT, and business logic (high level logic).\r\n* **BWS Example:** The C++ WebSocket Server Example shows how to implement everything using C code.\r\n\r\n### Mako Server (HLOS)\r\n\r\nThe [Mako Server Example](https://realtimelogic.com/ba/doc/en/Mako.html) can be compiled for High Level Operating Systems (HLOS) such as Windows, (embedded) Linux, QNX, and [VxWorks](#vxworks).\r\n\r\n![Mako Server Build Process](https://realtimelogic.com/ba/doc/en/examples/MakoServer/Build-Mako-Diagram.svg)\r\n\r\n\r\n#### Windows:\r\n\r\nUse the Visual Studio project file found in: BAS/examples/MakoServer/VcMake; however, make sure to download SQLite or disable the SQLite build in the project file. \r\n\r\n#### Linux:\r\n\r\nSee the tutorial [Embedded Linux Web Interface Design](https://makoserver.net/articles/Expedite-Your-Embedded-Linux-Web-Interface-Design) for details; however, the server can be downloaded and compiled for Linux as follows:\r\n\r\n```\r\nbash \u003c(wget -O - https://raw.githubusercontent.com/RealTimeLogic/BAS/main/LinuxBuild.sh)\r\n```\r\nFor a more **robust compilation option**, use the [included Ansible script](Ansible.md).\r\n\r\nDownload and cross-compile the code for (embedded) Linux as follows:\r\n\r\n```\r\nexport CC=/opt/gcc-linaro-7.1.1-2017.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc\r\nbash \u003c(wget -O - https://raw.githubusercontent.com/RealTimeLogic/BAS/main/LinuxBuild.sh)\r\nChange the above CC environment variable to your cross-compiler.\r\n```\r\n\r\nDownload and cross-compile the code, including [Lua GPIO bindings](https://github.com/vsergeev/lua-periphery), for embedded Linux as follows:\r\n\r\n```\r\nexport CROSS_COMPILE=/opt/gcc-linaro-7.1.1-2017.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-\r\nbash \u003c(wget -O - https://raw.githubusercontent.com/RealTimeLogic/BAS/main/RaspberryPiBuild.sh)\r\n```\r\n\r\n\r\n#### Details:\r\n\r\nThe following example builds the Mako Server without SQLite for HLOS. You can copy and paste the command into a Linux shell. Note that you can also download pre-compiled Mako Server versions for many operating systems on the [Mako Server Web Site](https://makoserver.net/).\r\n\r\n```\r\ngcc -o examples/MakoServer/mako -fmerge-all-constants -O3 -Os\\\r\n    -DUSE_EMBEDDED_ZIP=0 -DBA_FILESIZE64 -DLUA_USE_LINUX -DMAKO -DUSE_SQL=0\\\r\n    -Iinc -Iinc/arch/Posix -Iinc/arch/NET/Posix\\\r\n    src/BAS.c\\\r\n    src/arch/Posix/ThreadLib.c src/arch/NET/generic/SoDisp.c src/DiskIo/posix/BaFile.c\\\r\n    examples/MakoServer/src/MakoMain.c\\\r\n    -lpthread -lm -ldl\r\n```\r\n\r\nThe above command works for any HLOS with a GCC compiler (and derivatives), including cross compiling for embedded Linux, compiling for QNX, and compiling for VxWorks 7. Simply replace 'gcc' with the applicable compiler. Note that VxWorks is a cross between HLOS and RTOS; thus, you may consider using Xedge instead (details below). BAS supports VxWorks 5 and up.\r\n\r\nSee the [Mako Server's Build Documentation](https://realtimelogic.com/ba/examples/MakoServer/readme.html) for details on macros and other important information, but note that the amalgamated version in the standard SDK works differently.\r\n\r\nAfter running the above compilation command and after [building mako.zip using the mako script](https://github.com/RealTimeLogic/BAS-Resources/tree/main/build), start the server as follows:\r\n```\r\n$examples/MakoServer/mako\r\n\r\nMako Server. Version 3.7\r\nBAS lib 4920. Build date: Dec  2 2021\r\nCopyright (c) Real Time Logic.\r\n\r\nMounting /tmp/BAS/examples/MakoServer/mako.zip\r\nServer listening on IPv6 port 9357\r\nServer listening on IPv4 port 9357\r\nLoading certificate MakoServer\r\nSharkSSL server listening on IPv6 port 9443\r\nSharkSSL server listening on IPv4 port 9443\r\n```\r\n\r\n**Compiling for Windows**\r\n\r\nThe following example compiles and links the server as a 64 bit Windows application using the Visual Studio command line compiler (cl). Note that we include two additional C files. These two C files make it possible to run the server as a Windows service. Note that the [pre-compiled Mako Server for Windows](https://makoserver.net/download/windows/) is compiled as a 32 bit application.\r\n\r\n```\r\ncl /O2^\r\n /DUSE_EMBEDDED_ZIP=0 /DBA_FILESIZE64 /DMAKO /DUSE_SQL=0^\r\n /Iinc /Iinc/arch/Windows /Iinc/arch/NET/Windows^\r\n src/BAS.c^\r\n src/arch/Windows/ThreadLib.c src/arch/NET/generic/SoDisp.c src/DiskIo/windows/BaFile.c^\r\n examples/MakoServer/src/MakoMain.c^\r\n examples/MakoServer/src/Windows/MakoWinMain.c examples/MakoServer/src/Windows/servutil.c^\r\n ws2_32.lib kernel32.lib User32.lib Gdi32.lib advapi32.lib ole32.lib oleaut32.lib shell32.lib^\r\n /link /machine:X64 /OUT:examples/MakoServer/mako.exe\r\n```\r\n\r\nThe above command requires setting up the [command line for 64 bit compilation](https://docs.microsoft.com/en-us/cpp/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line?view=msvc-170). The above can be copied and pasted \"as is\" into a command window.\r\n\r\n**Including SQLite in the Build**\r\n\r\nThe Mako Server can optionally be linked with the SQLite database engine. The following command shows how to include SQLite and activate the [Lua SQLite bindings](https://realtimelogic.com/ba/doc/en/lua/luasql.html). However, before running the compilation command, [download SQLite](https://www.sqlite.org/download.html) and copy sqlite3.c and sqlite3.h to the BAS/src directory.\r\n\r\n```\r\ngcc -o examples/MakoServer/mako -fmerge-all-constants -O3 -Os\\\r\n    -DUSE_EMBEDDED_ZIP=0 -DBA_FILESIZE64 -DLUA_USE_LINUX -DMAKO\\\r\n    -Iinc -Iinc/arch/Posix -Iinc/arch/NET/Posix\\\r\n    src/BAS.c\\\r\n    src/arch/Posix/ThreadLib.c src/arch/NET/generic/SoDisp.c src/DiskIo/posix/BaFile.c\\\r\n    examples/MakoServer/src/MakoMain.c\\\r\n    src/ls_sqlite3.c src/luasql.c src/sqlite3.c\\\r\n    -lpthread -lm -ldl\r\n```\r\n\r\n### Xedge (RTOS)\r\n\r\nThe Xedge is designed as a Lua foundation and an interactive development environment that enables the development of Lua code directly on an embedded device. When you are done with the development, the code enables several options for producing a release (final product). In the following instructions, we cover how to build the tool. See the [online Xedge documentation](https://realtimelogic.com/ba/doc/en/Xedge.html) for details on how to use this tool.\r\n\r\n[![Xedge](https://realtimelogic.com/images/xedge/v1/Xedge.png)](https://simplemq.com/videos/Xedge-IDE-intro.mp4)\r\n\r\n#### Compiling and Integrating Xedge\r\n\r\nThe Xedge IDE tool comprises a Single-Page Web Application (SPA) and supporting server-side code. These resources are crucial and must be included in the build.\r\n\r\n![Xedge Build Process](https://realtimelogic.com/ba/doc/en/examples/xedge/Build-Xedge-Diagram.svg)\r\n\r\n\u003e Please note that the above compilation process is just an example  - the Barracuda App Server platform is flexible and can support any deployment strategy you require. For a quick overview of compiling Xedge, check out the tutorial [Rapid Firmware Development with the Barracuda App Server](https://realtimelogic.com/articles/Rapid-Firmware-Development-with-the-Barracuda-App-Server). This tutorial also shows how to replace the integrated IDE with a custom IoT application. While it uses an ESP32, the same method applies to any CPU.\r\n\r\nFetch the repos and build the resource ZIP file:\r\n\r\n```\r\n# Fetch the Barracuda App Server\r\ngit clone https://github.com/RealTimeLogic/BAS.git\r\n# Fetch the Barracuda App Server's resources\r\ngit clone https://github.com/RealTimeLogic/BAS-Resources.git\r\n# Go to the build directory\r\ncd BAS-Resources/build/\r\n# Run the build script. If on Windows, use Xedge.cmd\r\n# When prompted, initially select n for OPC-UA, s for small cacert.shark,\r\n# and n for compressing the files\r\n. Xedge.sh\r\n# The ZIP file is converted to a C array by the build script;\r\n# copy this to the Xedge directory\r\ncp XedgeZip.c ../../BAS/examples/xedge/\r\ncd ../../BAS\r\n```\r\n\r\nThe file **XedgeZip.c** embodies Xedge's resources, transformed into a C file. You can uncover this file's resources and detailed build instructions in the [BAS-Resources Repository](https://github.com/RealTimeLogic/BAS-Resources/tree/main/build).\r\n\r\nTo compile Xedge, include BAS.c as previously explained. In the following example, we use Linux as an example and compile the server into a standalone product. For an embedded device, include the files in your build.\r\n\r\n```\r\ngcc -o examples/xedge/xedge -Iinc -Iinc/arch/Posix -Iinc/arch/NET/Posix\\\r\n    src/BAS.c\\\r\n    examples/HostInit/Main.c examples/HostInit/HostInit.c\\\r\n    src/arch/Posix/ThreadLib.c src/arch/NET/generic/SoDisp.c src/DiskIo/posix/BaFile.c\\\r\n    examples/xedge/src/xedge.c examples/xedge/src/led.c\\\r\n    examples/xedge/XedgeZip.c -lpthread -lm\r\n```\r\n\r\n- The above produces a warning when compiled on Linux. You can remove the warning by specifying a POSIX environment by adding -DLUA_USE_POSIX.\r\n\r\n- The files Main.c and HostInit.c are designed for a non-embedded host build. You need to study those two files and set up similar code for your RTOS environment. At a minimum, you need a dedicated thread to run the function barracuda(void), which does not return, with stack size BA_STACKSZ.\r\n\r\n- The file xedge.c is the Xedge's C startup code.\r\n\r\n- The file led.c includes example [Lua bindings](https://realtimelogic.com/ba/doc/en/GettingStarted.html#UsingLSP). You can remove this from your build by defining -DNO_XEDGE_AUX or simply removing the function call in xedge.c\r\n\r\n- For embedded, a recommendation is to initially tests the server without file system support. Remove the file BaFile.c from your build and compile with -DNO_BAIO_DISK, a macro used by xedge.c\r\n\r\n- If you get a link error that includes dlmalloc, include src/dlmalloc.c in your build and initialize the allocator as shown in the file examples/HostInit/Main.c.\r\n\r\n- **Note:** The Xedge build instructions provided above are an excerpt from the [Xedge full SDK build guide](https://realtimelogic.com/ba/examples/xedge/readme.html), which includes additional details such as creating a release build. Please note that there are minor differences in file locations between the two.\r\n\r\n**Cross Compiling Xedge for Embedded Systems**\r\n\r\nInclude the files as instructed above in your IDE or Makefile. Most embedded systems require an efficient allocator, which is included. See, for example, the [FreeRTOS Readme File](src/arch/FreeRTOS/README.txt) for how to set up all required components. Most embedded RTOSs require the same setup.\r\n\r\n**Pre-compiled binaries:** Try running the server on an ESP32 using FreeRTOS and lwIP, even if you plan to use a different RTOS or device. The ESP32 is user-friendly and great for learning about RTOS. Use the [pre-compiled ESP32 Xedge binaries](https://realtimelogic.com/downloads/bas/ESP32/) for this purpose.\r\n\r\n\r\n## Enabling and Disabling Features\r\n\r\nBAS Amalgamated (BAS.c) includes features that are by default not compiled. These features can be enabled by the following macros. The macros can be enabled on any platform, including RTOS, unless stated otherwise.\r\n\r\n* USE_DBGMON=1: Include [Lua Debugger Support](https://makoserver.net/articles/Lua-and-LSP-Debugging).\r\n* USE_REVCON=1: Enable the reverse connection if you plan on using the connection bridge feature in [SharkTrustX](https://realtimelogic.com/products/SharkTrustX/). Note that both Xedge and the Mako Server include the [Let's Encrypt plugins acmebot and acmedns](https://realtimelogic.com/ba/doc/en/Mako.html#acmebot).\r\n* USE_OPCUA=1: The OPC-UA stack is implemented in Lua and can be found in mako.zip/.lua/opcua. The OPC-UA stack requires a C module. Enable this flag when compiling BAS if you plan on using OPC-UA.\r\n* USE_FORKPTY=1: Enable the [advanced process management API](https://realtimelogic.com/ba/doc/en/lua/auxlua.html#forkptylib), which is available for Linux and QNX. This API is required if you plan on using the [CGI plugin](https://github.com/RealTimeLogic/LSP-Examples/tree/master/CGI) or the [web shell](https://makoserver.net/articles/Linux-Web-Shell).\r\n* USE_REDIRECTOR=1: Enable the [Reverse Proxy](https://realtimelogic.com/ba/doc/en/lua/auxlua.html#reverseproxy)\r\n* USE_UBJSON=1: Enable [Universal Binary JSON](https://realtimelogic.com/ba/doc/en/lua/auxlua.html#ubjson)\r\n\r\n* LUA_NUMBER_INTEGER=1\r\n    * Makes Lua use integer only and excludes floating point numbers. To re-enable floating point, compile the code with:\r\n\r\n* LUA_NUMBER_INTEGER=0\r\n  * See inc/arch/XXX/luaconf.h for details.\r\n\r\n* NO_LDEBUG\r\n  * Exclude the Lua \"debug\" module\r\n\r\n* Mako Server Specifics:\r\n  * NO_SHARKTRUST\r\n    * Do no include tokengen.c; disable built-in SharkTrustX key\r\n  * USE_LUAINTF\r\n    * This macro enables loading [external Lua modules](https://makoserver.net/documentation/c-modules/). When not using a pre-built Mako Server and when using the source code you can instead choose to integrate additional [Lua bindings](https://realtimelogic.info/swig/) directly with your build.\r\n\r\n* Xedge Specifics:\r\n  * NO_SHARKTRUST\r\n  * NO_ENCRYPTIONKEY\r\n    * Do not include NewEncryptionKey.h; disable soft TPM\r\n  * NO_XEDGE_AUX\r\n    * Do not call xedgeOpenAUX() (your own Lua bindings)\r\n\r\n\r\n# Porting Layers\r\n\r\n[Contact Real Time Logic](https://realtimelogic.com/contactus/) should you have a problem with the porting layer when used with your version of the target APIs.\r\n\r\n| OS+TCP | include | source |\r\n| ----------- | ----------- | ----------- |\r\n| Digi | inc/arch/Digi | src/arch/Digi/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n| embOS | inc/arch/NET/embOSIP inc/arch/embOS | src/arch/embOS/ThreadLib.c src/arch/NET/embOSIP/SoDisp.c |\r\n| FreeRTOS+lwIP | inc/arch/NET/LwIP inc/arch/FreeRTOS | src/arch/FreeRTOS/ThreadLib.c src/arch/NET/LwIP/SoDisp.c |\r\n| FreeRTOS+TCP | inc/arch/FreeRTOS | src/arch/FreeRTOS/ThreadLib.c src/arch/FreeRTOS/SoDisp.c |\r\n| INTEGRITY | inc/arch/NET/Posix inc/arch/INTEGRITY | src/arch/INTEGRITY/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n| INtime | inc/arch/NET/INtime inc/arch/INtime | src/arch/INtime/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n| Linux+epoll | inc/arch/NET/epoll inc/arch/Posix | src/arch/Posix/ThreadLib.c src/arch/NET/epoll/SoDisp.c |\r\n| MQX | inc/arch/NET/MQX inc/arch/MQX | src/arch/MQX/ThreadLib.c src/arch/NET/MQX/SoDisp.c |\r\n| NuttX | inc/arch/NET/Posix inc/arch/Posix | src/arch/Posix/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n| Nucleus | inc/arch/NET/Nucleus inc/arch/Nucleus | src/arch/Nucleus/ThreadLib.c src/arch/NET/Nucleus/SoDisp.c |\r\n| Posix (Linux, Mac, QNX) | inc/arch/NET/Posix inc/arch/Posix | src/arch/Posix/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n| Quadros | inc/arch/Quadros | src/arch/Quadros/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n| SMX | inc/arch/NET/SMX-NET inc/arch/SMX | src/arch/SMX/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n| Azure RTOS | inc/arch/ThreadX | src/arch/ThreadX/ThreadLib.c src/arch/ThreadX/SoDisp.c |\r\n| VxWorks | inc/arch/VxWorks | src/arch/VxWorks/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n| Windows | inc/arch/NET/Windows inc/arch/Windows | src/arch/Windows/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n| Windows CE | inc/arch/NET/CE inc/arch/Windows | src/arch/Windows/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n| Zephyr | inc/arch/Zephyr | src/arch/Zephyr/ThreadLib.c src/arch/NET/generic/SoDisp.c |\r\n\r\nThe generic directory 'inc' must also be in the include path.\r\n\r\n# Additional Build Examples\r\n\r\n## INTEGRITY\r\n\r\nThe following example shows how to compile Xedge for Green Hills INTEGRITY. You can also [download a ready-to-run Xedge GHS Multi IDE project](https://realtimelogic.com/downloads/bas/xedge-ghs-build.zip).\r\n\r\n```\r\nccintarm -G -c99 -os_dir C:/ghs/int1144 -bsp simarm -o xedge\\\r\n    -non_shared -DMAXTHREADS=3\\\r\n    -Iinc -Iinc/arch/INTEGRITY -Iinc/arch/NET/Posix\\\r\n    --diag_suppress=111,188,550,549,546,223\\\r\n    src/BAS.c\\\r\n    src/arch/NET/generic/SoDisp.c\\\r\n    src/arch/INTEGRITY/ThreadLib.c\\\r\n    src/DiskIo/posix/BaFile.c\\\r\n    examples/HostInit/Main.c examples/HostInit/HostInit.c\\\r\n    examples/xedge/src/xedge.c\\\r\n    examples/xedge/XedgeZip.c\\\r\n    examples/xedge/src/xedgeInitDiskIo.c\\\r\n    examples/xedge/src/led.c\\\r\n    -lnet -livfs -lsocket\\\r\n```\r\n\r\n\r\n\r\n## VxWorks\r\n\r\nWe recommend [Xedge](#xedge-rtos) for VxWorks; however, The following example shows how to compile the Mako Server for VxWorks. See the [Barracuda App Server VxWorks Build Page](https://realtimelogic.com/downloads/bas/VxWorks/) for details.\r\n\r\n```\r\nwr-cc -o examples/MakoServer/mako -static -fmerge-all-constants -O3 -Os\\\r\n    -DUSE_EMBEDDED_ZIP=0 -DBA_FILESIZE64 -DBA_HAS_ANSI_IO -DMAKO -DUSE_SQL=0\\\r\n    -DLUA_NUMBER_INTEGER=0\\\r\n    -Iinc -Iinc/arch/VxWorks -Iinc/arch/NET/Posix\\\r\n    src/BAS.c\\\r\n    src/arch/VxWorks/ThreadLib.c src/arch/NET/generic/SoDisp.c src/DiskIo/posix/BaFile.c\\\r\n    examples/MakoServer/src/MakoMain.c\\\r\n    -lnet\r\n```\r\n\r\n## Azure RTOS using IAR\r\n\r\nThe following example shows how to compile the generic BAS library for Azure RTOS using IAR for ARM. We have the following directories tx (ThreadX), nx (NetX), and BAS.\r\n\r\n```\r\niccarm -e -c^\r\n  -Itx -Inx^\r\n  -IBAS/inc -IBAS/inc/arch/ThreadX^\r\n  BAS/src/BAS.c\r\n```\r\n\r\nUsing the above compilation settings, you would also need to include src/arch/ThreadX/ThreadLib.c, src/arch/ThreadX/SoDisp.c, and optionally src/DiskIo/FileX/BaFile.c.\r\n\r\n## FreeRTOS\r\n\r\n#### i.MX RT1020\r\n[Download](https://realtimelogic.com/downloads/bas/?target=RT1020) a ready to compile and run project for [i.MX RT1020](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt1020-evaluation-kit:MIMXRT1020-EVK).\r\n\r\n#### ESP32\r\n\r\n![Xedge32](https://realtimelogic.com/images/xedge/finger-icon.png)\r\n\r\n[Xedge32](https://github.com/RealTimeLogic/Xedge32) is an Xedge version for the ESP32 and ESP32-S3 microcontrollers.\r\n\r\n\r\n# Barracuda App Server Tutorials\r\n\r\n* [What is an Embedded Application Server?](https://realtimelogic.com/articles/What-is-an-Embedded-Application-Server)\r\n* [Using Lua for IoT and Web Application Development](https://realtimelogic.com/articles/Lua-FastTracks-Embedded-Web-Application-Development)\r\n* [Online Interactive Lua and LSP Tutorials](https://tutorial.realtimelogic.com/)\r\n* [Modern Approach to Embedding a Web Server in a Device](https://realtimelogic.com/articles/Modern-Approach-to-Embedding-a-Web-Server-in-a-Device)\r\n* [The Ultimate Guide to Embedded Web Server Technology](https://realtimelogic.com/articles/Embedded-Web-Server-Tutorials)\r\n* [A Large List of Mako/BAS Tutorials](https://makoserver.net/tutorials/)\r\n* [Ready To Run Examples (GitHub)](https://github.com/RealTimeLogic/LSP-Examples)\r\n\r\n\r\n## Online Documentation\r\n\r\n* [Introduction](https://realtimelogic.com/ba/doc/)\r\n* [Lua APIs](https://realtimelogic.com/ba/doc/en/lua/lua.html)\r\n* [BAS/BWS C/C++ API](https://realtimelogic.com/ba/doc/en/C/reference/html/index.html)\r\n* [SharkSSL TLS Stack C/C++ API](https://realtimelogic.com/ba/doc/en/C/shark/index.html)\r\n\r\n## License\r\n\r\nBAS and BWS Amalgamated are licensed for use under the GPLv2 or a\r\nstandard commercial license.  For our users who cannot use BAS and BWS\r\nAmalgamated under GPLv2,\r\n[a commercial license is available](https://realtimelogic.com/contactus/license/).\r\nA free commercial license for small companies is available.  See the\r\nstartup license page for details:\r\nhttps://realtimelogic.com/startuplic/\r\n\r\nGPLv2 details:\r\n\r\nThe following clarification is for users who choose to use GPLv2 and\r\nto distribute derivative work. The GPLv2 license applies to all BAS and BWS APIs\r\nincluding, but not limited to the BAS and BWS C APIs, BAS Lua APIs, and web\r\ncontent hosted by a BAS and BWS derivative product. Web content hosted by the\r\nserver is considered part of the application as a whole.\r\n\r\nGPLv2: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html\r\n\r\n## Export restrictions\r\n\r\nThis distribution includes cryptographic software. The country in \r\nwhich you currently reside may have restrictions on the import, \r\npossession, use, and/or re-export to another country, of \r\nencryption software.  BEFORE using any encryption software, please \r\ncheck your country's laws, regulations and policies concerning the\r\nimport, possession, or use, and re-export of encryption software, to \r\nsee if this is permitted.  See http://www.wassenaar.org/ for more\r\ninformation.\r\n\r\nThe U.S. Government Department of Commerce, Bureau of Industry and\r\nSecurity (BIS), has classified this software as Export Commodity\r\nControl Number (ECCN) 5D002.C.1, which includes information security\r\nsoftware using or performing cryptographic functions with asymmetric\r\nalgorithms. The form and manner of this distribution makes it\r\neligible for export under the License Exception ENC Technology\r\nSoftware Unrestricted (TSU) exception (see the BIS Export\r\nAdministration Regulations, Section 740.13) for both object code and\r\nsource code.\r\n\r\nThe following page provides details on the included cryptographic\r\nsoftware: https://github.com/RealTimeLogic/SharkSSL\r\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRealTimeLogic%2FBAS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRealTimeLogic%2FBAS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRealTimeLogic%2FBAS/lists"}