-
Notifications
You must be signed in to change notification settings - Fork 606
Adding new example Xedge #3071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Adding new example Xedge #3071
Changes from all commits
055fcfc
919b7f1
68386cb
8e8c9a6
4b2fca1
f677413
13a3570
58e379b
b8f8b3b
b250869
00266e3
97c8768
60916b7
a19aeef
01b6d7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# | ||
# Xedge IoT Toolkit - NuttX Kconfig integration | ||
# | ||
# Xedge is an embedded software toolkit designed to enable high-level developers | ||
# (e.g., web and Lua programmers) to create sophisticated, secure IoT and industrial | ||
# device applications. It abstracts low-level embedded development through a lightweight | ||
# runtime built on top of the Barracuda App Server and Lua, giving developers direct access | ||
# to HTTP(S), WebSockets, MQTT, file system, and device I/O - all from high-level Lua scripts. | ||
# | ||
# This NuttX integration allows developers to compile and run Xedge as a user application, | ||
# bringing powerful device control capabilities and an embedded web server to NuttX-based | ||
# systems. | ||
# | ||
# Use this if you want to build smart, networked embedded devices with minimal C code, | ||
# and maximum productivity. | ||
# | ||
|
||
config EXAMPLES_XEDGE | ||
tristate "Xedge IoT Toolkit" | ||
depends on ALLOW_GPL_COMPONENTS | ||
default n | ||
---help--- | ||
Enable Xedge support in NuttX. Xedge is a high-level | ||
toolkit that lets you develop complete IoT device | ||
applications using Lua, backed by the Barracuda App | ||
Server. This application demonstrates a complete | ||
Xedge runtime integrated into NuttX. | ||
|
||
if EXAMPLES_XEDGE | ||
|
||
config EXAMPLES_XEDGE_PROGNAME | ||
string "Program name" | ||
default "xedge" | ||
---help--- | ||
This is the name of the ELF executable for the Xedge application in NSH. | ||
|
||
config EXAMPLES_XEDGE_PRIORITY | ||
int "Xedge task priority" | ||
default 100 | ||
---help--- | ||
Set the task priority for the Xedge runtime. | ||
|
||
config EXAMPLES_XEDGE_STACKSIZE | ||
int "Xedge stack size" | ||
default 20000 | ||
---help--- | ||
Set the stack size allocated to the Xedge Lua interpreter and application runtime. | ||
|
||
endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
############################################################################ | ||
# apps/examples/xedge/Make.defs | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. The | ||
# ASF licenses this file to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance with the | ||
# License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
############################################################################ | ||
|
||
ifneq ($(CONFIG_EXAMPLES_XEDGE),) | ||
CONFIGURED_APPS += $(APPDIR)/examples/xedge | ||
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/examples/xedge/BAS/inc ${INCDIR_PREFIX}$(APPDIR)/examples/xedge/BAS/inc/arch/Posix ${INCDIR_PREFIX}$(APPDIR)/examples/xedge/BAS/inc/arch/NET/Posix -DNO_INIT_DISK_IO -DUSE_DBGMON=1 -DUSE_IPV6 | ||
endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
############################################################################ | ||
# apps/examples/xedge/Make.defs | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. The | ||
# ASF licenses this file to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance with the | ||
# License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
############################################################################ | ||
|
||
include $(APPDIR)/Make.defs | ||
|
||
# Xedge, World! built-in application info | ||
|
||
PROGNAME = $(CONFIG_EXAMPLES_XEDGE_PROGNAME) | ||
PRIORITY = $(CONFIG_EXAMPLES_XEDGE_PRIORITY) | ||
STACKSIZE = $(CONFIG_EXAMPLES_XEDGE_STACKSIZE) | ||
MODULE = $(CONFIG_EXAMPLES_XEDGE) | ||
|
||
# Xedge: BAS Example | ||
|
||
MAINSRC = xedge_main.c BAS/src/BAS.c BAS/src/dlmalloc.c BAS/src/arch/Posix/ThreadLib.c BAS/src/arch/NET/generic/SoDisp.c BAS/src/DiskIo/posix/BaFile.c BAS/examples/xedge/src/xedge.c BAS/examples/xedge/ BAS/examples/xedge/XedgeZip.c | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please split your example and xedge package to different path. |
||
|
||
XEDGEZIP = BAS/examples/xedge/XedgeZip.c | ||
|
||
$(XEDGEZIP): | ||
. prepare.sh | ||
|
||
context:: $(XEDGEZIP) | ||
|
||
|
||
include $(APPDIR)/Application.mk |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# This script clones the required repos and builds the Xedge resource file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you need move the script to Makefile There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not recommend this. The user needs to understand the sequence. Please see: https://realtimelogic.com/ba/examples/xedge/readme.html#release There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's required by nuttx, if you don't follow, please close this pr since nobody can merge the patch which doesn't comply with the guide. |
||
|
||
# Clone BAS repo if not already present | ||
if [ ! -d "BAS" ]; then | ||
git clone https://github.com/RealTimeLogic/BAS.git | ||
fi | ||
|
||
# Clone BAS-Resources repo if not already present | ||
if [ ! -d "BAS-Resources" ]; then | ||
git clone https://github.com/RealTimeLogic/BAS-Resources.git | ||
fi | ||
|
||
# Build XedgeZip.c (Xedge resource file) only if it doesn't exist | ||
if [ ! -f "BAS/examples/xedge/XedgeZip.c" ]; then | ||
echo "Building XedgeZip.c" | ||
cd BAS-Resources/build/ || exit 1 | ||
printf "n\nl\nn\n" | bash Xedge.sh > /dev/null | ||
cp XedgeZip.c ../../BAS/examples/xedge/ || exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apps/examples/xedge/Make.defs -> apps/examples/xedge/Makefile