[mynewt-mcumgr] 08/42: Zephyr support.

2018-02-12 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git

commit 9256a6adeb92c82809c97320c8d0de087abec18c
Author: Christopher Collins 
AuthorDate: Wed Jan 17 17:15:18 2018 -0800

Zephyr support.
---
 CMakeLists.txt |  12 ++
 Kconfig|  29 
 cmd/CMakeLists.txt |   3 +
 cmd/Kconfig|  24 +++
 cmd/fs_mgmt/CMakeLists.txt |   9 +
 cmd/fs_mgmt/Kconfig|  50 ++
 cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c   | 151 
 cmd/img_mgmt/CMakeLists.txt|  11 ++
 cmd/img_mgmt/Kconfig   |  38 +
 cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c | 227 +
 cmd/os_mgmt/CMakeLists.txt |   9 +
 cmd/os_mgmt/Kconfig|  35 
 cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c   |  85 +
 ext/CMakeLists.txt |   2 +
 14 files changed, 685 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 000..a88725a
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,12 @@
+add_library(MCUMGR INTERFACE)
+
+zephyr_library()
+add_subdirectory(cborattr)
+add_subdirectory(cmd)
+add_subdirectory(ext)
+add_subdirectory(mgmt)
+add_subdirectory(smp)
+
+zephyr_library_link_libraries(MCUMGR)
+
+target_link_libraries(MCUMGR INTERFACE zephyr_interface BASE64 TINYCBOR)
diff --git a/Kconfig b/Kconfig
new file mode 100644
index 000..fe04b1a
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,29 @@
+# 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.
+
+config MCUMGR
+bool
+prompt "mcumgr Support"
+select TINYCBOR
+default n
+help
+  This option enables the mcumgr management library.
+
+if MCUMGR
+source "ext/mcumgr/mgmt/port/zephyr/Kconfig"
+source "ext/mcumgr/cmd/Kconfig"
+endif
diff --git a/cmd/CMakeLists.txt b/cmd/CMakeLists.txt
new file mode 100644
index 000..bc91e2f
--- /dev/null
+++ b/cmd/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_subdirectory_ifdef(CONFIG_MCUMGR_CMD_FS_MGMT   fs_mgmt)
+add_subdirectory_ifdef(CONFIG_MCUMGR_CMD_IMG_MGMT  img_mgmt)
+add_subdirectory_ifdef(CONFIG_MCUMGR_CMD_OS_MGMT   os_mgmt)
diff --git a/cmd/Kconfig b/cmd/Kconfig
new file mode 100644
index 000..a0e2031
--- /dev/null
+++ b/cmd/Kconfig
@@ -0,0 +1,24 @@
+# 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.
+
+menu "Command handlers"
+
+source "ext/mcumgr/cmd/fs_mgmt/Kconfig"
+source "ext/mcumgr/cmd/img_mgmt/Kconfig"
+source "ext/mcumgr/cmd/os_mgmt/Kconfig"
+
+endmenu
diff --git a/cmd/fs_mgmt/CMakeLists.txt b/cmd/fs_mgmt/CMakeLists.txt
new file mode 100644
index 000..974d0a9
--- /dev/null
+++ b/cmd/fs_mgmt/CMakeLists.txt
@@ -0,0 +1,9 @@
+target_include_directories(MCUMGR INTERFACE 
+include
+)
+
+zephyr_library_sources(
+cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c
+cmd/fs_mgmt/src/fs_mgmt.c
+cmd/fs_mgmt/src/stubs.c
+)
diff --git a/cmd/fs_mgmt/Kconfig b/cmd/fs_mgmt/Kconfig
new file mode 100644
index 000..62602d6
--- /dev/null
+++ b/cmd/fs_mgmt/Kconfig
@@ -0,0 +1,50 @@
+# 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 o

[mynewt-mcumgr] 08/42: Zephyr support.

2018-02-12 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git

commit cfe132ea4f00ba519ed7f313d974ecbb3aa84987
Author: Christopher Collins 
AuthorDate: Wed Jan 17 17:15:18 2018 -0800

Zephyr support.
---
 CMakeLists.txt |  12 ++
 Kconfig|  29 
 cmd/CMakeLists.txt |   3 +
 cmd/Kconfig|  24 +++
 cmd/fs_mgmt/CMakeLists.txt |   9 +
 cmd/fs_mgmt/Kconfig|  50 ++
 cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c   | 151 
 cmd/img_mgmt/CMakeLists.txt|  11 ++
 cmd/img_mgmt/Kconfig   |  38 +
 cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c | 227 +
 cmd/os_mgmt/CMakeLists.txt |   9 +
 cmd/os_mgmt/Kconfig|  35 
 cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c   |  85 +
 ext/CMakeLists.txt |   2 +
 14 files changed, 685 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 000..a88725a
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,12 @@
+add_library(MCUMGR INTERFACE)
+
+zephyr_library()
+add_subdirectory(cborattr)
+add_subdirectory(cmd)
+add_subdirectory(ext)
+add_subdirectory(mgmt)
+add_subdirectory(smp)
+
+zephyr_library_link_libraries(MCUMGR)
+
+target_link_libraries(MCUMGR INTERFACE zephyr_interface BASE64 TINYCBOR)
diff --git a/Kconfig b/Kconfig
new file mode 100644
index 000..89de3ee
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,29 @@
+# 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.
+
+menuconfig MCUMGR
+bool
+prompt "mcumgr Support"
+select TINYCBOR
+default n
+help
+  This option enables the mcumgr management library.
+
+if MCUMGR
+source "ext/mcumgr/mgmt/port/zephyr/Kconfig"
+source "ext/mcumgr/cmd/Kconfig"
+endif
diff --git a/cmd/CMakeLists.txt b/cmd/CMakeLists.txt
new file mode 100644
index 000..bc91e2f
--- /dev/null
+++ b/cmd/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_subdirectory_ifdef(CONFIG_MCUMGR_CMD_FS_MGMT   fs_mgmt)
+add_subdirectory_ifdef(CONFIG_MCUMGR_CMD_IMG_MGMT  img_mgmt)
+add_subdirectory_ifdef(CONFIG_MCUMGR_CMD_OS_MGMT   os_mgmt)
diff --git a/cmd/Kconfig b/cmd/Kconfig
new file mode 100644
index 000..a0e2031
--- /dev/null
+++ b/cmd/Kconfig
@@ -0,0 +1,24 @@
+# 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.
+
+menu "Command handlers"
+
+source "ext/mcumgr/cmd/fs_mgmt/Kconfig"
+source "ext/mcumgr/cmd/img_mgmt/Kconfig"
+source "ext/mcumgr/cmd/os_mgmt/Kconfig"
+
+endmenu
diff --git a/cmd/fs_mgmt/CMakeLists.txt b/cmd/fs_mgmt/CMakeLists.txt
new file mode 100644
index 000..974d0a9
--- /dev/null
+++ b/cmd/fs_mgmt/CMakeLists.txt
@@ -0,0 +1,9 @@
+target_include_directories(MCUMGR INTERFACE 
+include
+)
+
+zephyr_library_sources(
+cmd/fs_mgmt/port/zephyr/src/zephyr_fs_mgmt.c
+cmd/fs_mgmt/src/fs_mgmt.c
+cmd/fs_mgmt/src/stubs.c
+)
diff --git a/cmd/fs_mgmt/Kconfig b/cmd/fs_mgmt/Kconfig
new file mode 100644
index 000..62602d6
--- /dev/null
+++ b/cmd/fs_mgmt/Kconfig
@@ -0,0 +1,50 @@
+# 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 copyrig