diff options
author | Inga Stotland <inga.stotland@intel.com> | 2018-07-14 12:58:57 -0700 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2018-08-20 12:48:21 -0700 |
commit | 6fbc4c83e13470d669e16ea05cc1def297e71665 (patch) | |
tree | 2751482464af5aa95f8996d576f84e2ff7ed4354 /mesh/mesh-defs.h | |
parent | ef60219269c31f53ec438cb045956b75204b250d (diff) | |
download | bluez-6fbc4c83e13470d669e16ea05cc1def297e71665.tar.gz |
mesh: Header files for mesh access layer and utilities
This adds initial implementation of Mesh access layer functionality
Diffstat (limited to 'mesh/mesh-defs.h')
-rw-r--r-- | mesh/mesh-defs.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/mesh/mesh-defs.h b/mesh/mesh-defs.h new file mode 100644 index 000000000..d40fc43e8 --- /dev/null +++ b/mesh/mesh-defs.h @@ -0,0 +1,84 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2018 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. + * + * + */ + +#define MESH_AD_TYPE_PROVISION 0x29 +#define MESH_AD_TYPE_NETWORK 0x2A +#define MESH_AD_TYPE_BEACON 0x2B + +#define FEATURE_RELAY 1 +#define FEATURE_PROXY 2 +#define FEATURE_FRIEND 4 +#define FEATURE_LPN 8 + +#define MESH_MODE_DISABLED 0 +#define MESH_MODE_ENABLED 1 +#define MESH_MODE_UNSUPPORTED 2 + +#define KEY_REFRESH_PHASE_NONE 0x00 +#define KEY_REFRESH_PHASE_ONE 0x01 +#define KEY_REFRESH_PHASE_TWO 0x02 +#define KEY_REFRESH_PHASE_THREE 0x03 + +#define DEFAULT_TTL 0xff + +/* Supported algorithms for provisioning */ +#define ALG_FIPS_256_ECC 0x0001 + +/* Input OOB action bit flags */ +#define OOB_IN_PUSH 0x0001 +#define OOB_IN_TWIST 0x0002 +#define OOB_IN_NUMBER 0x0004 +#define OOB_IN_ALPHA 0x0008 + +/* Output OOB action bit flags */ +#define OOB_OUT_BLINK 0x0001 +#define OOB_OUT_BEEP 0x0002 +#define OOB_OUT_VIBRATE 0x0004 +#define OOB_OUT_NUMBER 0x0008 +#define OOB_OUT_ALPHA 0x0010 + +#define UNASSIGNED_ADDRESS 0x0000 +#define PROXIES_ADDRESS 0xfffc +#define FRIENDS_ADDRESS 0xfffd +#define RELAYS_ADDRESS 0xfffe +#define ALL_NODES_ADDRESS 0xffff +#define VIRTUAL_ADDRESS_LOW 0x8000 +#define VIRTUAL_ADDRESS_HIGH 0xbfff +#define GROUP_ADDRESS_LOW 0xc000 +#define GROUP_ADDRESS_HIGH 0xff00 + +#define NODE_IDENTITY_STOPPED 0x00 +#define NODE_IDENTITY_RUNNING 0x01 +#define NODE_IDENTITY_NOT_SUPPORTED 0x02 + +#define PRIMARY_ELE_IDX 0x00 + +#define VENDOR_ID_MASK 0xffff0000 + +#define MAX_KEY_IDX 0x0fff + +#define IS_UNASSIGNED(x) ((x) == UNASSIGNED_ADDRESS) +#define IS_UNICAST(x) (((x) > UNASSIGNED_ADDRESS) && \ + ((x) < VIRTUAL_ADDRESS_LOW)) +#define IS_VIRTUAL(x) (((x) >= VIRTUAL_ADDRESS_LOW) && \ + ((x) <= VIRTUAL_ADDRESS_HIGH)) +#define IS_GROUP(x) (((x) >= GROUP_ADDRESS_LOW) && \ + ((x) <= GROUP_ADDRESS_HIGH)) +#define IS_ALL_NODES(x) ((x) == ALL_NODES_ADDRESS) |