diff options
author | Inga Stotland <johan.hedberg@gmail.com> | 2018-06-21 23:32:00 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2018-07-06 13:03:33 +0200 |
commit | ef05f4957dce261ca4aa4def2d360015f8be6eed (patch) | |
tree | 9b50f62c2cfe1f61e359641e459772e800493a5a /mesh/node.h | |
parent | f0d0c48e82e485d79393bcd30091cfdc5ee201e7 (diff) | |
download | bluez-ef05f4957dce261ca4aa4def2d360015f8be6eed.tar.gz |
tools: Move meshctl sources under tools/mesh directory
This is a temporary location until the unified mesh solution is provided
Diffstat (limited to 'mesh/node.h')
-rw-r--r-- | mesh/node.h | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/mesh/node.h b/mesh/node.h deleted file mode 100644 index a5b5c7520..000000000 --- a/mesh/node.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2017 Intel Corporation. All rights reserved. - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -struct mesh_node; - -#define ACTION_ADD 1 -#define ACTION_UPDATE 2 -#define ACTION_DELETE 3 - -struct prov_svc_data { - uint16_t oob; - uint8_t dev_uuid[16]; -}; - -struct mesh_node_composition { - bool relay; - bool proxy; - bool lpn; - bool friend; - uint16_t cid; - uint16_t pid; - uint16_t vid; - uint16_t crpl; -}; - -struct mesh_publication { - uint16_t app_idx; - union { - uint16_t addr16; - uint8_t va_128[16]; - } u; - uint8_t ttl; - uint8_t credential; - uint8_t period; - uint8_t retransmit; -}; - -typedef bool (*node_model_recv_callback)(uint16_t src, uint8_t *data, - uint16_t len, void *user_data); -typedef int (*node_model_bind_callback)(uint16_t app_idx, int action); -typedef void (*node_model_pub_callback)(struct mesh_publication *pub); -typedef void (*node_model_sub_callback)(uint16_t sub_addr, int action); - -struct mesh_model_ops { - node_model_recv_callback recv; - node_model_bind_callback bind; - node_model_pub_callback pub; - node_model_sub_callback sub; -}; - -struct mesh_node *node_find_by_addr(uint16_t addr); -struct mesh_node *node_find_by_uuid(uint8_t uuid[16]); -struct mesh_node *node_create_new(struct prov_svc_data *prov); -struct mesh_node *node_new(void); -void node_free(struct mesh_node *node); -bool node_is_provisioned(struct mesh_node *node); -void *node_get_prov(struct mesh_node *node); -void node_set_prov(struct mesh_node *node, void *prov); -bool node_app_key_add(struct mesh_node *node, uint16_t idx); -bool node_net_key_add(struct mesh_node *node, uint16_t index); -bool node_app_key_delete(struct mesh_node *node, uint16_t net_idx, - uint16_t idx); -bool node_net_key_delete(struct mesh_node *node, uint16_t index); -void node_set_primary(struct mesh_node *node, uint16_t unicast); -uint16_t node_get_primary(struct mesh_node *node); -uint16_t node_get_primary_net_idx(struct mesh_node *node); -void node_set_device_key(struct mesh_node *node, uint8_t *key); -uint8_t *node_get_device_key(struct mesh_node *node); -void node_set_num_elements(struct mesh_node *node, uint8_t num_ele); -uint8_t node_get_num_elements(struct mesh_node *node); -bool node_parse_composition(struct mesh_node *node, uint8_t *buf, uint16_t len); -GList *node_get_net_keys(struct mesh_node *node); -GList *node_get_app_keys(struct mesh_node *node); -void node_cleanup(void); - -bool node_set_local_node(struct mesh_node *node); -struct mesh_node *node_get_local_node(void); -void node_local_data_handler(uint16_t src, uint32_t dst, - uint32_t iv_index, uint32_t seq_num, - uint16_t app_idx, uint8_t *data, uint16_t len); - -bool node_local_model_register(uint8_t element_idx, uint16_t model_id, - struct mesh_model_ops *ops, void *user_data); -bool node_local_vendor_model_register(uint8_t element_idx, uint32_t model_id, - struct mesh_model_ops *ops, void *user_data); - -bool node_set_element(struct mesh_node *node, uint8_t ele_idx); -bool node_set_model(struct mesh_node *node, uint8_t ele_idx, uint32_t id); -struct mesh_node_composition *node_get_composition(struct mesh_node *node); -bool node_set_composition(struct mesh_node *node, - struct mesh_node_composition *comp); -bool node_add_binding(struct mesh_node *node, uint8_t ele_idx, - uint32_t model_id, uint16_t app_idx); -bool node_add_subscription(struct mesh_node *node, uint8_t ele_idx, - uint32_t model_id, uint16_t addr); -uint8_t node_get_default_ttl(struct mesh_node *node); -bool node_set_default_ttl(struct mesh_node *node, uint8_t ttl); -bool node_set_sequence_number(struct mesh_node *node, uint32_t seq); -uint32_t node_get_sequence_number(struct mesh_node *node); -bool node_set_iv_index(struct mesh_node *node, uint32_t iv_index); -uint32_t node_get_iv_index(struct mesh_node *node); -bool node_model_pub_set(struct mesh_node *node, uint8_t ele, uint32_t model_id, - struct mesh_publication *pub); -struct mesh_publication *node_model_pub_get(struct mesh_node *node, uint8_t ele, - uint32_t model_id); |