mesh: move mesh files to src/mesh, update includes

This commit is contained in:
Matthias Ringwald 2019-07-14 14:24:29 +02:00
parent cf862b3640
commit f4854a5efb
57 changed files with 343 additions and 237 deletions

View File

@ -134,23 +134,23 @@
#include "mesh/adv_bearer.h"
#include "mesh/beacon.h"
#include "mesh/gatt_bearer.h"
#include "mesh/mesh.h"
#include "mesh/mesh_access.h"
#include "mesh/mesh_configuration_server.h"
#include "mesh/mesh_crypto.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_generic_model.h"
#include "mesh/mesh_generic_server.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "mesh/mesh_lower_transport.h"
#include "mesh/mesh_peer.h"
#include "mesh/mesh_proxy.h"
#include "mesh/mesh_upper_transport.h"
#include "mesh/mesh_virtual_addresses.h"
#include "mesh/pb_adv.h"
#include "mesh/pb_gatt.h"
#include "mesh.h"
#include "mesh_access.h"
#include "mesh_configuration_server.h"
#include "mesh_foundation.h"
#include "mesh_generic_model.h"
#include "mesh_generic_server.h"
#include "mesh_iv_index_seq_number.h"
#include "mesh_peer.h"
#include "mesh_proxy.h"
#include "mesh_virtual_addresses.h"
#include "provisioning.h"
#include "provisioning_device.h"
#include "mesh/provisioning.h"
#include "mesh/provisioning_device.h"
#endif
#endif // __BTSTACK_H

View File

@ -40,6 +40,7 @@
#define __ADV_BEARER_H
#include <stdint.h>
#include "btstack_defines.h"
#include "bluetooth.h"

View File

@ -37,22 +37,24 @@
#define __BTSTACK_FILE__ "beacon.c"
#include "mesh/beacon.h"
#include <string.h>
#include "mesh/beacon.h"
#include "mesh/adv_bearer.h"
#include "mesh/gatt_bearer.h"
#include "mesh_foundation.h"
#include "ble/core.h"
#include "bluetooth.h"
#include "bluetooth_data_types.h"
#include "btstack_debug.h"
#include "btstack_util.h"
#include "btstack_run_loop.h"
#include "btstack_event.h"
#include "btstack_run_loop.h"
#include "btstack_util.h"
#include "gap.h"
#include "mesh_keys.h"
#include "mesh_iv_index_seq_number.h"
#include "mesh/adv_bearer.h"
#include "mesh/gatt_bearer.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "mesh/mesh_keys.h"
#define BEACON_TYPE_UNPROVISIONED_DEVICE 0
#define BEACON_TYPE_SECURE_NETWORK 1

View File

@ -40,8 +40,10 @@
#define __BEACON_H
#include <stdint.h>
#include "btstack_defines.h"
#include "mesh_keys.h"
#include "mesh/mesh_keys.h"
#include "mesh/mesh_network.h"
#if defined __cplusplus

View File

@ -40,6 +40,7 @@
#define __GATT_BEARER_H
#include <stdint.h>
#include "btstack_defines.h"
#if defined __cplusplus

View File

@ -40,7 +40,8 @@
#include <string.h>
#include <stdio.h>
#include "mesh.h"
#include "mesh/mesh.h"
#include "btstack_util.h"
#include "btstack_config.h"
#include "btstack_event.h"
@ -48,21 +49,21 @@
#include "mesh/adv_bearer.h"
#include "mesh/beacon.h"
#include "mesh/gatt_bearer.h"
#include "mesh/mesh_access.h"
#include "mesh/mesh_configuration_server.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_generic_model.h"
#include "mesh/mesh_generic_server.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "mesh/mesh_lower_transport.h"
#include "mesh/mesh_peer.h"
#include "mesh/mesh_proxy.h"
#include "mesh/mesh_upper_transport.h"
#include "mesh/mesh_virtual_addresses.h"
#include "mesh/pb_adv.h"
#include "mesh/pb_gatt.h"
#include "mesh_access.h"
#include "mesh_configuration_server.h"
#include "mesh_foundation.h"
#include "mesh_generic_model.h"
#include "mesh_generic_server.h"
#include "mesh_iv_index_seq_number.h"
#include "mesh_peer.h"
#include "mesh_proxy.h"
#include "mesh_virtual_addresses.h"
#include "provisioning.h"
#include "provisioning_device.h"
#include "mesh/provisioning.h"
#include "mesh/provisioning_device.h"
static btstack_packet_handler_t provisioning_device_packet_handler;
static btstack_packet_callback_registration_t hci_event_callback_registration;

View File

@ -40,16 +40,19 @@
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include "mesh/mesh_node.h"
#include "mesh/mesh_upper_transport.h"
#include "mesh/beacon.h"
#include "mesh_access.h"
#include "btstack_memory.h"
#include "mesh/mesh_access.h"
#include "btstack_debug.h"
#include "mesh_foundation.h"
#include "btstack_memory.h"
#include "btstack_tlv.h"
#include "mesh_iv_index_seq_number.h"
#include "mesh_proxy.h"
#include "mesh/beacon.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "mesh/mesh_node.h"
#include "mesh/mesh_proxy.h"
#include "mesh/mesh_upper_transport.h"
#define MEST_TRANSACTION_TIMEOUT_MS 6000

View File

@ -40,10 +40,12 @@
#include <stdint.h>
#include <stdarg.h>
#include "btstack_linked_list.h"
#include "mesh/mesh_lower_transport.h"
#include "mesh_keys.h"
#include "bluetooth_company_id.h"
#include "btstack_linked_list.h"
#include "mesh/mesh_lower_transport.h"
#include "mesh/mesh_keys.h"
#include "mesh/mesh_node.h"
#ifdef __cplusplus

View File

@ -39,24 +39,27 @@
#include <string.h>
#include <stdio.h>
#include "mesh/mesh_configuration_server.h"
#include "bluetooth_company_id.h"
#include "btstack_debug.h"
#include "btstack_memory.h"
#include "btstack_tlv.h"
#include "btstack_util.h"
#include "mesh/beacon.h"
#include "mesh/gatt_bearer.h"
#include "mesh/mesh_access.h"
#include "mesh/mesh_crypto.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "mesh/mesh_keys.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_node.h"
#include "mesh/mesh_proxy.h"
#include "mesh/mesh_upper_transport.h"
#include "mesh_access.h"
#include "mesh_configuration_server.h"
#include "mesh_foundation.h"
#include "mesh_iv_index_seq_number.h"
#include "mesh_keys.h"
#include "mesh_proxy.h"
#include "mesh_virtual_addresses.h"
#include "mesh/mesh_virtual_addresses.h"
#define MESH_HEARTBEAT_FEATURES_SUPPORTED_MASK 0x000f

View File

@ -39,7 +39,8 @@
#define __MESH_CONFIGURATION_SERVER_H
#include <stdint.h>
#include "mesh_access.h"
#include "mesh/mesh_access.h"
#ifdef __cplusplus
extern "C"

View File

@ -37,11 +37,12 @@
#define __BTSTACK_FILE__ "mesh_crypto.c"
#include <stdint.h>
#include <string.h>
#include "btstack_debug.h"
#include "btstack_util.h"
#include "mesh_crypto.h"
#include "mesh/mesh_crypto.h"
// mesh k1 - might get moved to btstack_crypto and all vars go into btstack_crypto_mesh_k1_t struct
static uint8_t mesh_k1_temp[16];

View File

@ -43,9 +43,11 @@
#define __MESH_CRYPTO_H
#include <stdint.h>
#include "btstack_defines.h"
#include "btstack_crypto.h"
#include "mesh_keys.h"
#include "mesh/mesh_keys.h"
#ifdef __cplusplus
extern "C"

View File

@ -37,9 +37,9 @@
#define __BTSTACK_FILE__ "mesh_foundation.c"
#include <stdint.h>
#include <stdio.h>
#include "mesh/mesh_foundation.h"
#define MESH_TTL_MAX 0x7f
#define MESH_FOUNDATION_STATE_NOT_SUPPORTED 2

View File

@ -40,15 +40,13 @@
#include <stdint.h>
#include "mesh/mesh_network.h"
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include "mesh/mesh_network.h"
#define MESH_TTL_MAX 0x7f
#define MESH_FOUNDATION_STATE_NOT_SUPPORTED 2

View File

@ -37,19 +37,22 @@
#define __BTSTACK_FILE__ "mesh_generic_client.c"
#include "mesh/mesh_generic_client.h"
#include <string.h>
#include <stdio.h>
#include "mesh_generic_client.h"
#include "bluetooth_company_id.h"
#include "btstack_debug.h"
#include "btstack_memory.h"
#include "btstack_util.h"
#include "mesh_generic_model.h"
#include "mesh/mesh_access.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_generic_model.h"
#include "mesh/mesh_keys.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_upper_transport.h"
#include "mesh_keys.h"
#include "mesh_access.h"
#include "mesh_foundation.h"
#include "bluetooth_company_id.h"
#include "btstack_memory.h"
#include "btstack_debug.h"
// Generic On Off Message

View File

@ -39,7 +39,8 @@
#define __MESH_GENERIC_CLIENT_H
#include <stdint.h>
#include "mesh_access.h"
#include "mesh/mesh_access.h"
#ifdef __cplusplus
extern "C"

View File

@ -39,17 +39,20 @@
#include <string.h>
#include <stdio.h>
#include "mesh_generic_client.h"
#include "btstack_util.h"
#include "mesh_generic_model.h"
#include "mesh/mesh_network.h"
#include "mesh_keys.h"
#include "mesh/mesh_upper_transport.h"
#include "mesh_access.h"
#include "mesh_foundation.h"
#include "mesh/mesh_generic_client.h"
#include "bluetooth_company_id.h"
#include "btstack_memory.h"
#include "btstack_debug.h"
#include "btstack_memory.h"
#include "btstack_util.h"
#include "mesh/mesh_access.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_generic_model.h"
#include "mesh/mesh_keys.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_upper_transport.h"
// Generic Level Messages

View File

@ -39,7 +39,8 @@
#define __MESH_GENERIC_LEVEL_CLIENT_H
#include <stdint.h>
#include "mesh_access.h"
#include "mesh/mesh_access.h"
#ifdef __cplusplus
extern "C"

View File

@ -39,17 +39,20 @@
#include <string.h>
#include <stdio.h>
#include "mesh_generic_level_server.h"
#include "mesh/mesh_generic_level_server.h"
#include "btstack_util.h"
#include "mesh_generic_model.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_upper_transport.h"
#include "mesh_keys.h"
#include "mesh_access.h"
#include "mesh_foundation.h"
#include "bluetooth_company_id.h"
#include "btstack_memory.h"
#include "btstack_debug.h"
#include "bluetooth_company_id.h"
#include "mesh/mesh_access.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_generic_model.h"
#include "mesh/mesh_keys.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_upper_transport.h"
static void generic_server_send_message(uint16_t src, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, mesh_pdu_t *pdu){

View File

@ -39,7 +39,8 @@
#define __MESH_GENERIC_LEVEL_SERVER_H
#include <stdint.h>
#include "mesh_access.h"
#include "mesh/mesh_access.h"
#ifdef __cplusplus
extern "C"

View File

@ -38,12 +38,13 @@
#ifndef __MESH_GENERIC_MODEL_H
#define __MESH_GENERIC_MODEL_H
#include "mesh/mesh_access.h"
#ifdef __cplusplus
extern "C"
{
#endif
#include "mesh_access.h"
#define MESH_GENERIC_ON_OFF_GET 0x8201u
#define MESH_GENERIC_ON_OFF_SET 0x8202u

View File

@ -39,17 +39,19 @@
#include <string.h>
#include <stdio.h>
#include "mesh_generic_server.h"
#include "bluetooth_company_id.h"
#include "btstack_debug.h"
#include "btstack_memory.h"
#include "btstack_util.h"
#include "mesh_generic_model.h"
#include "mesh/mesh_access.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_generic_model.h"
#include "mesh/mesh_generic_server.h"
#include "mesh/mesh_keys.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_upper_transport.h"
#include "mesh_keys.h"
#include "mesh_access.h"
#include "mesh_foundation.h"
#include "bluetooth_company_id.h"
#include "btstack_memory.h"
#include "btstack_debug.h"
static void mesh_server_transition_step_bool(mesh_transition_t * transition, transition_event_t event, uint32_t current_timestamp);

View File

@ -39,7 +39,8 @@
#define __MESH_GENERIC_SERVER_H
#include <stdint.h>
#include "mesh_access.h"
#include "mesh/mesh_access.h"
#ifdef __cplusplus
extern "C"

View File

@ -39,18 +39,21 @@
#include <string.h>
#include <stdio.h>
#include "mesh_generic_server.h"
#include "mesh_generic_model.h"
#include "mesh/mesh_health_server.h"
#include "bluetooth_company_id.h"
#include "btstack_debug.h"
#include "btstack_memory.h"
#include "btstack_util.h"
#include "mesh_health_server.h"
#include "mesh/mesh_access.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_generic_model.h"
#include "mesh/mesh_generic_server.h"
#include "mesh/mesh_keys.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_upper_transport.h"
#include "mesh_keys.h"
#include "mesh_access.h"
#include "mesh_foundation.h"
#include "bluetooth_company_id.h"
#include "btstack_memory.h"
#include "btstack_debug.h"
static void health_server_send_message(uint16_t src, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, mesh_pdu_t *pdu, uint32_t ack_opcode){
uint8_t ttl = mesh_foundation_default_ttl_get();

View File

@ -39,7 +39,8 @@
#define __MESH_HEALTH_SERVER_H
#include <stdint.h>
#include "mesh_access.h"
#include "mesh/mesh_access.h"
#ifdef __cplusplus
extern "C"

View File

@ -37,7 +37,8 @@
#define __BTSTACK_FILE__ "mesh_iv_index_seq_number.c"
#include "mesh_iv_index_seq_number.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "btstack_debug.h"
static uint32_t global_iv_index;

View File

@ -45,8 +45,6 @@ extern "C"
{
#endif
#include <stdint.h>
/**
* IV Index
*/

View File

@ -39,7 +39,9 @@
#include <string.h>
#include <stdio.h>
#include "mesh_keys.h"
#include "mesh/mesh_keys.h"
#include "btstack_util.h"
#include "btstack_memory.h"
#include "btstack_config.h"

View File

@ -41,6 +41,7 @@
#include <stdint.h>
#include "btstack_linked_list.h"
#include "mesh/adv_bearer.h"
#ifdef __cplusplus

View File

@ -40,13 +40,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btstack_util.h"
#include "btstack_memory.h"
#include "btstack_util.h"
#include "mesh/beacon.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "mesh/mesh_lower_transport.h"
#include "mesh/mesh_node.h"
#include "mesh_peer.h"
#include "mesh_lower_transport.h"
#include "mesh_iv_index_seq_number.h"
#include "mesh/mesh_peer.h"
static void (*higher_layer_handler)( mesh_transport_callback_type_t callback_type, mesh_transport_status_t status, mesh_pdu_t * pdu);

View File

@ -40,13 +40,13 @@
#include <stdint.h>
#include "mesh/mesh_network.h"
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include "mesh/mesh_network.h"
typedef enum {
MESH_TRANSPORT_OPCODE_ACK = 0,

View File

@ -37,21 +37,22 @@
#define __BTSTACK_FILE__ "mesh_network.c"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mesh/beacon.h"
#include "mesh/mesh_node.h"
#include "provisioning.h"
#include "provisioning_device.h"
#include "mesh_keys.h"
#include "mesh_foundation.h"
#include "btstack_util.h"
#include "btstack_debug.h"
#include "btstack_event.h"
#include "btstack_memory.h"
#include "mesh_iv_index_seq_number.h"
#include "btstack_util.h"
#include "mesh/beacon.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "mesh/mesh_keys.h"
#include "mesh/mesh_node.h"
#include "mesh/provisioning.h"
#include "mesh/provisioning_device.h"
#ifdef ENABLE_MESH_ADV_BEARER
#include "mesh/adv_bearer.h"

View File

@ -39,9 +39,10 @@
#define __MESH_NETWORK
#include "btstack_linked_list.h"
#include "provisioning.h"
#include "btstack_run_loop.h"
#include "mesh_keys.h"
#include "mesh/provisioning.h"
#include "mesh/mesh_keys.h"
#if defined __cplusplus
extern "C" {

View File

@ -37,11 +37,11 @@
#define __BTSTACK_FILE__ "mesh_node.c"
#include "mesh/mesh_node.h"
#include <stddef.h>
#include <string.h>
#include "mesh/mesh_node.h"
static uint16_t primary_element_address;
static mesh_element_t primary_element;

View File

@ -38,13 +38,14 @@
#ifndef __MESH_NODE_H
#define __MESH_NODE_H
#include <stdint.h>
#include "btstack_linked_list.h"
#if defined __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "btstack_linked_list.h"
typedef struct mesh_element {
// linked list item
btstack_linked_item_t item;

76
src/mesh/mesh_peer.c Normal file
View File

@ -0,0 +1,76 @@
/*
* 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
*
*/
#include "mesh/mesh_peer.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "btstack_memory.h"
#include "btstack_util.h"
#include "mesh/beacon.h"
#include "mesh/mesh_upper_transport.h"
#define MESH_NUM_PEERS 5
static mesh_peer_t mesh_peers[MESH_NUM_PEERS];
void mesh_seq_auth_reset(void){
int i;
for(i=0;i<MESH_NUM_PEERS;i++){
memset(&mesh_peers[i], 0, sizeof(mesh_peer_t));
}
}
mesh_peer_t * mesh_peer_for_addr(uint16_t address){
int i;
for (i=0;i<MESH_NUM_PEERS;i++){
if (mesh_peers[i].address == address){
return &mesh_peers[i];
}
}
for (i=0;i<MESH_NUM_PEERS;i++){
if (mesh_peers[i].address== MESH_ADDRESS_UNSASSIGNED){
memset(&mesh_peers[i], 0, sizeof(mesh_peer_t));
mesh_peers[i].address = address;
return &mesh_peers[i];
}
}
return NULL;
}

View File

@ -38,12 +38,12 @@
#ifndef __MESH_PEER_H
#define __MESH_PEER_H
#include "mesh/mesh_network.h"
#if defined __cplusplus
extern "C" {
#endif
#include "mesh/mesh_network.h"
// mesh seq auth validation
typedef struct {
// primary element address

View File

@ -37,26 +37,28 @@
#define __BTSTACK_FILE__ "mesh_proxy.c"
#include "mesh/mesh_proxy.h"
#include <string.h>
#include "mesh/adv_bearer.h"
#include "mesh/gatt_bearer.h"
#include "mesh/mesh_crypto.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_node.h"
#include "mesh/mesh_lower_transport.h"
#include "bluetooth_company_id.h"
#include "bluetooth_data_types.h"
#include "bluetooth_gatt.h"
#include "btstack_config.h"
#include "btstack_crypto.h"
#include "btstack_memory.h"
#include "btstack_debug.h"
#include "btstack_memory.h"
#include "btstack_run_loop.h"
#include "btstack_util.h"
#include "mesh_proxy.h"
#include "mesh_foundation.h"
#include "mesh_iv_index_seq_number.h"
#include "mesh/adv_bearer.h"
#include "mesh/gatt_bearer.h"
#include "mesh/mesh_crypto.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "mesh/mesh_lower_transport.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_node.h"
#ifdef ENABLE_MESH_PROXY_SERVER

View File

@ -40,12 +40,13 @@
#include <stdint.h>
#include "mesh/adv_bearer.h"
#ifdef __cplusplus
extern "C"
{
#endif
#include "mesh/adv_bearer.h"
typedef enum {
MESH_NODE_IDENTITY_STATE_ADVERTISING_STOPPED = 0,

View File

@ -35,20 +35,23 @@
*
*/
#define __BTSTACK_FILE__ "mesh_transport.c"
#define __BTSTACK_FILE__ "mesh_upper_transport.c"
#include "mesh/mesh_upper_transport.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mesh/beacon.h"
#include "mesh/mesh_lower_transport.h"
#include "mesh/mesh_upper_transport.h"
#include "btstack_util.h"
#include "btstack_memory.h"
#include "mesh_peer.h"
#include "mesh_keys.h"
#include "mesh_virtual_addresses.h"
#include "mesh_iv_index_seq_number.h"
#include "mesh/beacon.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "mesh/mesh_keys.h"
#include "mesh/mesh_lower_transport.h"
#include "mesh/mesh_peer.h"
#include "mesh/mesh_virtual_addresses.h"
static void (*higher_layer_handler)( mesh_transport_callback_type_t callback_type, mesh_transport_status_t status, mesh_pdu_t * pdu);

View File

@ -40,16 +40,14 @@
#include <stdint.h>
#include "mesh/mesh_network.h"
#include "mesh/mesh_lower_transport.h"
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include "mesh/mesh_network.h"
#include "mesh/mesh_lower_transport.h"
void mesh_upper_transport_init(void);
void mesh_upper_transport_message_processed_by_higher_layer(mesh_pdu_t * pdu);

View File

@ -37,12 +37,14 @@
#define __BTSTACK_FILE__ "mesh_virtual_addresses.c"
#include "mesh/mesh_virtual_addresses.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btstack_util.h"
#include "btstack_memory.h"
#include "mesh_virtual_addresses.h"
// virtual address management

View File

@ -39,6 +39,7 @@
#define __MESH_VIRTUAL_ADDRESSES_H
#include <stdint.h>
#include "btstack_linked_list.h"
#ifdef __cplusplus

View File

@ -37,17 +37,21 @@
#define __BTSTACK_FILE__ "pb_adv.c"
#include "pb_adv.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btstack_debug.h"
#include "btstack_event.h"
#include "btstack_util.h"
#include "mesh/adv_bearer.h"
#include "mesh/beacon.h"
#include "mesh/mesh_node.h"
#include "provisioning.h"
#include "btstack_util.h"
#include "btstack_debug.h"
#include "btstack_event.h"
#include "mesh/provisioning.h"
#define PB_ADV_LINK_OPEN_RETRANSMIT_MS 1000

View File

@ -40,6 +40,7 @@
#define __PB_ADV_H
#include <stdint.h>
#include "btstack_defines.h"
#include "btstack_config.h"

View File

@ -37,15 +37,19 @@
#define __BTSTACK_FILE__ "pb_gatt.c"
#include "mesh/pb_gatt.h"
#include <stdlib.h>
#include <string.h>
#include "btstack_util.h"
#include "ble/att_server.h"
#include "ble/gatt-service/mesh_provisioning_service_server.h"
#include "btstack_debug.h"
#include "btstack_event.h"
#include "mesh/pb_gatt.h"
#include "ble/gatt-service/mesh_provisioning_service_server.h"
#include "provisioning.h"
#include "ble/att_server.h"
#include "btstack_util.h"
#include "mesh/provisioning.h"
/************** PB GATT Mesh Provisioning ********************/

View File

@ -40,6 +40,7 @@
#define __PB_GATT_H
#include <stdint.h>
#include "btstack_defines.h"
#include "btstack_config.h"
#include "hci.h"

View File

@ -37,6 +37,7 @@
#define __BTSTACK_FILE__ "provisioning.c"
#include "mesh/provisioning.h"
#include <stdint.h>
#include <string.h>
#include "provisioning.h"

View File

@ -43,9 +43,11 @@
#define __PROVISIONING_H
#include <stdint.h>
#include "btstack_defines.h"
#include "btstack_crypto.h"
#include "mesh_keys.h"
#include "mesh/mesh_keys.h"
#ifdef __cplusplus
extern "C"

View File

@ -42,14 +42,14 @@
#include <stdlib.h>
#include <string.h>
#include "mesh/pb_adv.h"
#include "mesh/pb_gatt.h"
#include "btstack.h"
#include "btstack_memory.h"
#include "classic/rfcomm.h" // for crc8
#include "mesh/mesh_crypto.h"
#include "classic/rfcomm.h" // for crc8
#include "btstack.h"
#include "provisioning.h"
#include "mesh/pb_adv.h"
#include "mesh/pb_gatt.h"
#include "mesh/provisioning.h"
static void provisioning_attention_timer_set(void);
static void prov_key_generated(void * arg);

View File

@ -43,8 +43,10 @@
#define __PROVISIONING_DEVICE_H
#include <stdint.h>
#include "btstack_defines.h"
#include "mesh_keys.h"
#include "mesh/mesh_keys.h"
#ifdef __cplusplus
extern "C"

View File

@ -35,17 +35,20 @@
*
*/
#define __BTSTACK_FILE__ "provisioning_device.c"
#define __BTSTACK_FILE__ "provisioning_provisioner.c"
#include "mesh/provisioning_provisioner.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mesh/pb_adv.h"
#include "mesh/mesh_crypto.h"
#include "classic/rfcomm.h" // for crc8
#include "btstack.h"
#include "provisioning.h"
#include "classic/rfcomm.h" // for crc8
#include "mesh/mesh_crypto.h"
#include "mesh/pb_adv.h"
#include "mesh/provisioning.h"
static void provisioning_public_key_ready(void);

View File

@ -43,6 +43,7 @@
#define __PROVISIONING_PROVISIONER_H
#include <stdint.h>
#include "btstack_defines.h"
#ifdef __cplusplus
@ -85,7 +86,7 @@ uint8_t provisioning_provisioner_select_authentication_method(uint16_t pb_adv_ci
* @param public_key (64 bytes)
* @note Requires ability to transmit public key out-of-band
*/
void provisioning_provisioner_public_key_oob_received(uint16_t pb_adv_cid, const uint8_t * public_key);
uint8_t provisioning_provisioner_public_key_oob_received(uint16_t pb_adv_cid, const uint8_t * public_key);
/**
* @brief Set data for Static OOB Authentication

View File

@ -5,18 +5,18 @@
#include "bluetooth_data_types.h"
#include "bluetooth_gatt.h"
#include "mesh_peer.h"
#include "btstack_memory.h"
#include "btstack_util.h"
#include "mesh/adv_bearer.h"
#include "mesh/gatt_bearer.h"
#include "mesh/mesh_crypto.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_foundation.h"
#include "mesh/mesh_iv_index_seq_number.h"
#include "mesh/mesh_lower_transport.h"
#include "mesh/mesh_network.h"
#include "mesh/mesh_upper_transport.h"
#include "mesh_foundation.h"
#include "btstack_util.h"
#include "provisioning.h"
#include "btstack_memory.h"
#include "mesh_iv_index_seq_number.h"
#include "mesh/provisioning.h"
#include "mesh_peer.h"
extern "C" int mock_process_hci_cmd(void);

View File

@ -1,40 +0,0 @@
//
// Created by Matthias Ringwald on 2019-04-03.
//
#include "btstack_memory.h"
#include "btstack_util.h"
#include "mesh/beacon.h"
#include "mesh/mesh_upper_transport.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "mesh_peer.h"
#define MESH_NUM_PEERS 5
static mesh_peer_t mesh_peers[MESH_NUM_PEERS];
void mesh_seq_auth_reset(void){
int i;
for(i=0;i<MESH_NUM_PEERS;i++){
memset(&mesh_peers[i], 0, sizeof(mesh_peer_t));
}
}
mesh_peer_t * mesh_peer_for_addr(uint16_t address){
int i;
for (i=0;i<MESH_NUM_PEERS;i++){
if (mesh_peers[i].address == address){
return &mesh_peers[i];
}
}
for (i=0;i<MESH_NUM_PEERS;i++){
if (mesh_peers[i].address== MESH_ADDRESS_UNSASSIGNED){
memset(&mesh_peers[i], 0, sizeof(mesh_peer_t));
mesh_peers[i].address = address;
return &mesh_peers[i];
}
}
return NULL;
}

View File

@ -39,13 +39,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ble/gatt-service/mesh_provisioning_service_server.h"
#include "hci_dump.h"
#include "mesh/mesh_node.h"
#include "mesh/pb_adv.h"
#include "mesh/pb_gatt.h"
#include "mesh/mesh_node.h"
#include "ble/gatt-service/mesh_provisioning_service_server.h"
#include "provisioning.h"
#include "provisioning_device.h"
#include "hci_dump.h"
#include "mesh/provisioning.h"
#include "mesh/provisioning_device.h"
#include "CppUTest/TestHarness.h"
#include "CppUTest/CommandLineTestRunner.h"