From e89cad57371584dbb098149f2e1c01cc619c4d5b Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 14 Jun 2019 11:28:32 +0200 Subject: [PATCH] mesh: add mesh_proxy --- test/mesh/CMakeLists.txt | 2 +- test/mesh/Makefile | 2 +- test/mesh/mesh_proxy.c | 40 +++++++++++++++++++++++++++++++ test/mesh/mesh_proxy.h | 52 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 test/mesh/mesh_proxy.c create mode 100644 test/mesh/mesh_proxy.h diff --git a/test/mesh/CMakeLists.txt b/test/mesh/CMakeLists.txt index 466804491..ad472150a 100644 --- a/test/mesh/CMakeLists.txt +++ b/test/mesh/CMakeLists.txt @@ -28,7 +28,7 @@ file(GLOB SOURCES_LIBUSB "../../platform/libusb/*.c" "../../platform/ file(GLOB SOURCES_OFF "../../src/ble/le_device_db_memory.c" "../../src/ble/le_device_db_memory.h" "../../src/ble/le_device_db_tlv.c" "../../src/ble/le_device_db_tlv.h") list(REMOVE_ITEM SOURCES_BLE ${SOURCES_OFF}) -set(SOURCES_MESH_NEW main.c mesh_access.c mesh_access.h mesh_configuration_server.c mesh_transport.c mesh_transport.h mesh_foundation.c mesh_foundation.h mesh_keys.c mesh_keys.h mesh_virtual_addresses.c mesh_virtual_addresses.h mesh_peer.c mesh_peer.h provisioner.c provisioning.c provisioning.h provisioning_device.c provisioning_device.h provisioning_provisioner.c provisioning_provisioner.h ) +set(SOURCES_MESH_NEW main.c mesh_access.c mesh_access.h mesh_configuration_server.c mesh_transport.c mesh_transport.h mesh_foundation.c mesh_foundation.h mesh_keys.c mesh_keys.h mesh_virtual_addresses.c mesh_virtual_addresses.h mesh_peer.c mesh_peer.h mesh_proxy.h mesh_proxy.c provisioner.c provisioning.c provisioning.h provisioning_device.c provisioning_device.h provisioning_provisioner.c provisioning_provisioner.h mesh_generic_server.h mesh_generic_server.c) set(SOURCES ${SOURCES_POSIX} diff --git a/test/mesh/Makefile b/test/mesh/Makefile index 450835c2c..8f6ebe33b 100644 --- a/test/mesh/Makefile +++ b/test/mesh/Makefile @@ -53,7 +53,7 @@ LDFLAGS += $(shell pkg-config libusb-1.0 --libs) LDFLAGS += -lCppUTest -lCppUTestExt -mesh: mesh.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} pb_adv.o pb_gatt.o mesh_foundation.o mesh_provisioning_service_server.o mesh_crypto.o provisioning_device.o mesh_network.o mesh_peer.o mesh_lower_transport.o mesh_transport.o mesh_virtual_addresses.o mesh_keys.o mesh_access.o mesh_configuration_server.o mesh_generic_server.o mesh.o +mesh: mesh.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} pb_adv.o pb_gatt.o mesh_foundation.o mesh_provisioning_service_server.o mesh_crypto.o provisioning_device.o mesh_network.o mesh_peer.o mesh_lower_transport.o mesh_transport.o mesh_virtual_addresses.o mesh_keys.o mesh_proxy.o mesh_access.o mesh_configuration_server.o mesh_generic_server.o mesh.o ${CC} $(filter-out mesh.h,$^) ${CFLAGS} ${LDFLAGS} -o $@ provisioner: ${CORE_OBJ} ${COMMON_OBJ} ${SM_OBJ} pb_adv.o mesh_crypto.o provisioning_provisioner.o provisioner.o diff --git a/test/mesh/mesh_proxy.c b/test/mesh/mesh_proxy.c new file mode 100644 index 000000000..7eb925249 --- /dev/null +++ b/test/mesh/mesh_proxy.c @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 BlueKitchen GmbH + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holders nor the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * 4. Any redistribution, use, or modification is done solely for + * personal benefit and not for any commercial purpose or for + * monetary gain. + * + * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS + * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Please inquire about commercial licensing options at + * contact@bluekitchen-gmbh.com + * + */ + +#define __BTSTACK_FILE__ "mesh_proxy.c" + +#include "mesh_proxy.h" diff --git a/test/mesh/mesh_proxy.h b/test/mesh/mesh_proxy.h new file mode 100644 index 000000000..d9ae12b09 --- /dev/null +++ b/test/mesh/mesh_proxy.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2018 BlueKitchen GmbH + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holders nor the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * 4. Any redistribution, use, or modification is done solely for + * personal benefit and not for any commercial purpose or for + * monetary gain. + * + * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS + * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Please inquire about commercial licensing options at + * contact@bluekitchen-gmbh.com + * + */ + +#ifndef __MESH_PROXY_H +#define __MESH_PROXY_H + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifdef __cplusplus +} /* end of extern "C" */ +#endif + +#endif