Blob: mesh-api.txt
Blob id: 6abf3cb8f0eef0556b87a607181c492bd9d44118
Size: 42.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 | BlueZ D-Bus Mesh API description
********************************
Mesh Network Hierarchy
======================
Service org.bluez.mesh
Interface org.bluez.mesh.Network1
Object path /org/bluez/mesh
Methods:
void Join(object app_root, array{byte}[16] uuid)
This is the first method that an application has to call to
become a provisioned node on a mesh network. The call will
initiate broadcasting of Unprovisioned Device Beacon.
The app_root parameter is a D-Bus object root path of
the application that implements org.bluez.mesh.Application1
interface. The application represents a node where child mesh
elements have their own objects that implement
org.bluez.mesh.Element1 interface. The application hierarchy
also contains a provision agent object that implements
org.bluez.mesh.ProvisionAgent1 interface. The standard
DBus.ObjectManager interface must be available on the
app_root path.
The uuid parameter is a 16-byte array that contains Device UUID.
This UUID must be unique (at least from the daemon perspective),
therefore attempting to call this function using already
registered UUID results in an error. The composition of the UUID
octets must be in compliance with RFC 4122.
When provisioning finishes, the daemon will call either
JoinComplete or JoinFailed method on object implementing
org.bluez.mesh.Application1 interface.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.AlreadyExists,
void Cancel(void)
Cancels an outstanding provisioning request initiated by Join()
method.
object node, array{byte, array{(uint16, dict)}} configuration
Attach(object app_root, uint64 token)
This is the first method that an application must call to get
access to mesh node functionalities.
The app_root parameter is a D-Bus object root path of
the application that implements org.bluez.mesh.Application1
interface. The application represents a node where child mesh
elements have their own objects that implement
org.bluez.mesh.Element1 interface. The standard
DBus.ObjectManager interface must be available on the
app_root path.
The token parameter is a 64-bit number that has been assigned to
the application when it first got provisioned/joined mesh
network, i.e. upon receiving JoinComplete() method. The daemon
uses the token to verify whether the application is authorized
to assume the mesh node identity.
In case of success, the method call returns mesh node object
(see Mesh Node Hierarchy section) and current configuration
settings. The return value of configuration parameter is an
array, where each entry is a structure that contains element
configuration. The element configuration structure is organized
as follows:
byte
Element index, identifies the element to which this
configuration entry pertains.
array{struct}
Models array where each entry is a structure with the
following members:
uint16
Either a SIG Model Identifier or, if Vendor key
is present in model configuration dictionary, a
16-bit vendor-assigned Model Identifier
dict
A dictionary that contains model configuration
with the following keys defined:
array{uint16} Bindings
Indices of application keys bound to the
model
uint32 PublicationPeriod
Model publication period in milliseconds
uint16 Vendor
A 16-bit Company ID as defined by the
Bluetooth SIG
array{variant} Subscriptions
Addresses the model is subscribed to.
Each address is provided either as
uint16 for group addresses, or
as array{byte} for virtual labels.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.NotFound,
org.bluez.mesh.Error.AlreadyExists,
org.bluez.mesh.Error.Busy,
org.bluez.mesh.Error.Failed
void Leave(uint64 token)
This removes the configuration information about the mesh node
identified by the 64-bit token parameter. The token parameter
has been obtained as a result of successful Join() method call.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.NotFound
org.bluez.mesh.Error.Busy
void CreateNetwork(object app_root, array{byte}[16] uuid)
This is the first method that an application calls to become
a Provisioner node, and a Configuration Client on a newly
created Mesh Network.
The app_root parameter is a D-Bus object root path of the
application that implements org.bluez.mesh.Application1
interface, and a org.bluez.mesh.Provisioner1 interface. The
application represents a node where child mesh elements have
their own objects that implement org.bluez.mesh.Element1
interface. The application hierarchy also contains a provision
agent object that implements org.bluez.mesh.ProvisionAgent1
interface. The standard DBus.ObjectManager interface must be
available on the app_root path.
The uuid parameter is a 16-byte array that contains Device UUID.
This UUID must be unique (at least from the daemon perspective),
therefore attempting to call this function using already
registered UUID results in an error. The composition of the UUID
octets must be in compliance with RFC 4122.
The other information the bluetooth-meshd daemon will preserve
about the initial node, is to give it the initial primary
unicast address (0x0001), and create and assign a net_key as the
primary network net_index (0x000).
Upon successful processing of Create() method, the daemon
will call JoinComplete method on object implementing
org.bluez.mesh.Application1.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.AlreadyExists,
void Import(object app_root, array{byte}[16] uuid,
array{byte}[16] dev_key,
array{byte}[16] net_key, uint16 net_index,
dict flags, uint32 iv_index, uint16 unicast)
This method creates a local mesh node based on node
configuration that has been generated outside bluetooth-meshd.
The app_root parameter is a D-Bus object root path of the
application that implements org.bluez.mesh.Application1
interface.
The uuid parameter is a 16-byte array that contains Device UUID.
This UUID must be unique (at least from the daemon perspective),
therefore attempting to call this function using already
registered UUID results in an error. The composition of the UUID
octets must be in compliance with RFC 4122.
The dev_key parameter is the 16-byte value of the dev key of
the imported mesh node.
Remaining parameters correspond to provisioning data:
The net_key and net_index parameters describe the network (or a
subnet, if net_index is not 0) the imported mesh node belongs
to.
The flags parameter is a dictionary containing provisioning
flags. Supported values are:
boolean IvUpdate
When true, indicates that the network is in the
middle of IV Index Update procedure.
boolean KeyRefresh
When true, indicates that the specified net key
is in the middle of a key refresh procedure.
The iv_index parameter is the current IV Index value used by
the network. This value is known by the provisioner.
The unicast parameter is the primary unicast address of the
imported node.
Upon successful processing of Import() method, the daemon will
call JoinComplete method on object implementing
org.bluez.mesh.Application1 interface.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments,
org.bluez.mesh.Error.AlreadyExists,
org.bluez.mesh.Error.NotSupported,
org.bluez.mesh.Error.Failed
Mesh Node Hierarchy
===================
Service org.bluez.mesh
Interface org.bluez.mesh.Node1
Object path /org/bluez/mesh/node<uuid>
where <uuid> is the Device UUID passed to Join(),
CreateNetwork() or Import()
Methods:
void Send(object element_path, uint16 destination, uint16 key_index,
dict options, array{byte} data)
This method is used to send a message originated by a local
model.
The element_path parameter is the object path of an element from
a collection of the application elements (see Mesh Application
Hierarchy section).
The destination parameter contains the destination address. This
destination must be a uint16 to a unicast address, or a well
known group address.
The key_index parameter determines which application key to use
for encrypting the message. The key_index must be valid for that
element, i.e., the application key must be bound to a model on
this element. Otherwise, org.bluez.mesh.Error.NotAuthorized will
be returned.
The options parameter is a dictionary with the following keys
defined:
bool ForceSegmented
Specifies whether to force sending of a short
message as one-segment payload. If not present,
the default setting is "false".
The data parameter is an outgoing message to be encrypted by the
bluetooth-meshd daemon and sent on.
Possible errors:
org.bluez.mesh.Error.NotAuthorized
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.NotFound
void DevKeySend(object element_path, uint16 destination, boolean remote,
uint16 net_index, dict options, array{byte} data)
This method is used to send a message originated by a local
model encoded with the device key of the remote node.
The element_path parameter is the object path of an element from
a collection of the application elements (see Mesh Application
Hierarchy section).
The destination parameter contains the destination address. This
destination must be a uint16 to a unicast address, or a well
known group address.
The remote parameter, if true, looks up the device key by the
destination address in the key database to encrypt the message.
If remote is true, but requested key does not exist, a NotFound
error will be returned. If set to false, the local node's
device key is used.
The net_index parameter is the subnet index of the network on
which the message is to be sent.
The options parameter is a dictionary with the following keys
defined:
bool ForceSegmented
Specifies whether to force sending of a short
message as one-segment payload. If not present,
the default setting is "false".
The data parameter is an outgoing message to be encrypted by the
meshd daemon and sent on.
Possible errors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.NotFound
void AddNetKey(object element_path, uint16 destination,
uint16 subnet_index, uint16 net_index, boolean update)
This method is used to send add or update network key originated
by the local configuration client to a remote configuration
server.
The element_path parameter is the object path of an element from
a collection of the application elements (see Mesh Application
Hierarchy section).
The destination parameter contains the destination address. This
destination must be a uint16 to a nodes primary unicast address.
The subnet_index parameter refers to the subnet index of the
network that is being added or updated. This key must exist in
the local key database.
The net_index parameter is the subnet index of the network on
which the message is to be sent.
The update parameter indicates if this is an addition or an
update. If true, the subnet key must be in the phase 1 state of
the key update procedure.
Possible errors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.NotFound
void AddAppKey(object element_path, uint16 destination,
uint16 app_index, uint16 net_index, boolean update)
This method is used to send add or update network key originated
by the local configuration client to a remote configuration
server.
The element_path parameter is the object path of an element from
a collection of the application elements (see Mesh Application
Hierarchy section).
The destination parameter contains the destination address. This
destination must be a uint16 to a nodes primary unicast address.
The app_index parameter refers to the application key which is
being added or updated. This key must exist in the local key
database.
The net_index parameter is the subnet index of the network on
which the message is to be sent.
The update parameter indicates if this is an addition or an
update. If true, the subnet key must be in the phase 1 state of
the key update procedure.
Possible errors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.NotFound
void Publish(object element_path, uint16 model, dict options,
array{byte} data)
This method is used to send a publication originated by a local
model. If the model does not exist, or it has no publication
record, the method returns org.bluez.mesh.Error.DoesNotExist
error.
The element_path parameter is the object path of an element from
a collection of the application elements (see Mesh Application
Hierarchy section).
The model parameter contains a model ID, as defined by the
Bluetooth SIG. If the options dictionary contains a "Vendor"
key, then this ID is defined by the specified vendor.
The options parameter is a dictionary with the following keys
defined:
bool ForceSegmented
Specifies whether to force sending of a short
message as one-segment payload. If not present,
the default setting is "false".
uint16 Vendor
A 16-bit Company ID as defined by the
Bluetooth SIG. This key should only exist when
publishing on a Vendor defined model.
The data parameter is an outgoing message to be encrypted by the
meshd daemon and sent on.
Since only one Publish record may exist per element-model, the
destination and key_index are obtained from the Publication
record cached by the daemon.
Possible errors:
org.bluez.mesh.Error.DoesNotExist
org.bluez.mesh.Error.InvalidArguments
Properties:
dict Features [read-only]
The dictionary that contains information about feature support.
The following keys are defined:
boolean Friend
Indicates the ability to establish a friendship with a
Low Power node
boolean LowPower
Indicates support for operating in Low Power node mode
boolean Proxy
Indicates support for GATT proxy
boolean Relay
Indicates support for relaying messages
If a key is absent from the dictionary, the feature is not supported.
Otherwise, true means that the feature is enabled and false means that
the feature is disabled.
boolean Beacon [read-only]
This property indicates whether the periodic beaconing is
enabled (true) or disabled (false).
boolean IvUpdate [read-only]
When true, indicates that the network is in the middle of IV
Index Update procedure. This information is only useful for
provisioning.
uint32 IvIndex [read-only]
This property may be read at any time to determine the IV_Index
that the current network is on. This information is only useful
for provisioning.
uint32 SecondsSinceLastHeard [read-only]
This property may be read at any time to determine the number of
seconds since mesh network layer traffic was last detected on
this node's network.
array{uint16} Addresses [read-only]
This property contains unicast addresses of node's elements.
uint32 SequenceNumber [read-only]
This property may be read at any time to determine the
sequence number.
Mesh Provisioning Hierarchy
============================
Service org.bluez.mesh
Interface org.bluez.mesh.Management1
Object path /org/bluez/mesh/node<uuid>
where <uuid> is the Device UUID passed to Join(),
CreateNetwork() or Import()
Methods:
void UnprovisionedScan(dict options)
This method is used by the application that supports
org.bluez.mesh.Provisioner1 interface to start listening
(scanning) for unprovisioned devices in the area.
The options parameter is a dictionary with the following keys
defined:
uint16 Seconds
Specifies number of seconds for scanning to be active.
If set to 0 or if this key is not present, then the
scanning will continue until UnprovisionedScanCancel()
or AddNode() methods are called. If not present, and a
remote server is specified, the default timeout will be
60 seconds.
uint16 Server
Specifies a remote server on which to perform scanning.
If not present, scanning will be local. If present,
the timeout must be between 1 and 60 seconds.
uint16 Subnet
Specifies a subnet for the remote server. If not
present, primary subnet will be used. If Server not
present, the Subnet will be ignored.
array{byte}[16] Filter
Specifies a specific UUID to search for. If not
present, all found UUIDs will be returned.
uint8 array Extended
Specifies variable number of Bluetooth AD types to
return with scan result. Only valid if a Filter has been
specified.
Each time a unique unprovisioned beacon is heard, the
ScanResult() method on the app will be called with the result.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.NotAuthorized
org.bluez.mesh.Error.Busy
void UnprovisionedScanCancel(void)
This method is used by the application that supports
org.bluez.mesh.Provisioner1 interface to stop listening
(scanning) for unprovisioned devices in the area.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.NotAuthorized
void AddNode(array{byte}[16] uuid, dict options)
This method is used by the application that supports
org.bluez.mesh.Provisioner1 interface to add the
unprovisioned device specified by uuid, to the Network.
The uuid parameter is a 16-byte array that contains Device UUID
of the unprovisioned device to be added to the network.
The options parameter is a dictionary that may contain
additional optional configuration info:
uint16 Server
Specifies a remote server to perform provisioning on. If
not present, provisioning will be done locally.
uint16 Subnet
Specifies a subnet for the remote server. If not
present, primary subnet will be used. If Server not
present Subnet will be ignored.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.NotAuthorized
void Reprovision(uint16 unicast, dict options)
This method is used by the application that supports
org.bluez.mesh.Provisioner1 interface to perform one of the
Node Provisioning Protocol Interface procedures with a remote
node to refresh its device key, unicast address, and
composition. Remote node being reprovisioned must have the
Remote Provisioning Server model.
The unicast parameter is the 16-bit primary node address of
the remote node being reprovisioned.
The options parameter is a dictionary that may contain
additional optional configuration info:
uint8 NPPI
Specifies the Node Provisioning Protocol Interface
procedure, as defined in the Mesh Profile Specification:
0 - Device Key Refresh Only
1 - Node Address Refresh
2 - Node Composition Refresh
If not present, procedure 0 will be used.
uint16 Subnet
Specifies the subnet remote node is on. If not
present, primary subnet will be tried.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.NotAuthorized
void CreateSubnet(uint16 net_index)
This method is used by the application to generate and add a new
network subnet key.
The net_index parameter is a 12-bit value (0x001-0xFFF)
specifying which net key to add.
This call affects the local bluetooth-meshd key database only.
PossibleErrors:
org.bluez.mesh.Error.Failed
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.AlreadyExists
void ImportSubnet(uint16 net_index, array{byte}[16] net_key)
This method is used by the application to add a network subnet
key, that was originally generated by a remote Config Client.
The net_index parameter is a 12-bit value (0x000-0xFFF)
specifying which net key to add.
The net_key parameter is the 16-byte value of the net key being
imported.
This call affects the local bluetooth-meshd key database only.
PossibleErrors:
org.bluez.mesh.Error.Failed
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.AlreadyExists
void UpdateSubnet(uint16 net_index)
This method is used by the application to generate a new network
subnet key, and set it's key refresh state to Phase 1.
The net_index parameter is a 12-bit value (0x000-0xFFF)
specifying which net key to update. Note that the subnet must
exist prior to updating.
This call affects the local bluetooth-meshd key database only.
PossibleErrors:
org.bluez.mesh.Error.Failed
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.DoesNotExist
org.bluez.mesh.Error.Busy
void DeleteSubnet(uint16 net_index)
This method is used by the application that to delete a subnet.
The net_index parameter is a 12-bit value (0x001-0xFFF)
specifying which net key to delete. The primary net key (0x000)
may not be deleted.
This call affects the local bluetooth-meshd key database only.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
void SetKeyPhase(uint16 net_index, uint8 phase)
This method is used to set the flooding key update phase of the
given subnet. When finalizing the procedure, it is important
to CompleteAppKeyUpdate() on all app keys that have been
updated during the procedure prior to setting phase 3.
The net_index parameter is a 12-bit value (0x000-0xFFF)
specifying which subnet phase to set.
The phase parameter is used to cycle the local key database
through the phases as defined by the Mesh Profile Specification.
Allowed values:
0 - Cancel Key Refresh (May only be called from Phase 1,
and should never be called once the new key has
started propagating)
1 - Invalid Argument (see NetKeyUpdate method)
2 - Go to Phase 2 (May only be called from Phase 1)
3 - Complete Key Refresh procedure (May only be called
from Phase 2)
This call affects the local bluetooth-meshd key database only.
It is the responsibility of the application to maintain the key
refresh phases per the Mesh Profile Specification.
PossibleErrors:
org.bluez.mesh.Error.Failed
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.DoesNotExist
void CreateAppKey(uint16 net_index, uint16 app_index)
This method is used by the application to generate and add a new
application key.
The net_index parameter is a 12-bit value (0x000-0xFFF)
specifying which net key to bind the application key to.
The app_index parameter is a 12-bit value (0x000-0xFFF)
specifying which app key to add.
This call affects the local bluetooth-meshd key database only.
PossibleErrors:
org.bluez.mesh.Error.Failed
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.AlreadyExists
org.bluez.mesh.Error.DoesNotExist
void ImportAppKey(uint16 net_index, uint16 app_index,
array{byte}[16] app_key)
This method is used by the application to add an application
key, that was originally generated by a remote Config Client.
The net_index parameter is a 12-bit value (0x000-0xFFF)
specifying which net key to bind the application key to.
The app_index parameter is a 12-bit value (0x000-0xFFF)
specifying which app key to import.
The app_key parameter is the 16-byte value of the key being
imported.
This call affects the local bluetooth-meshd key database only.
PossibleErrors:
org.bluez.mesh.Error.Failed
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.AlreadyExists
org.bluez.mesh.Error.DoesNotExist
void UpdateAppKey(uint16 app_index)
This method is used by the application to generate a new
application key.
The app_index parameter is a 12-bit value (0x000-0xFFF)
specifying which app key to update. Note that the subnet that
the key is bound to must exist and be in Phase 1.
This call affects the local bluetooth-meshd key database only.
PossibleErrors:
org.bluez.mesh.Error.Failed
org.bluez.mesh.Error.InvalidArguments
org.bluez.mesh.Error.DoesNotExist
org.bluez.mesh.Error.InProgress
void DeleteAppKey(uint16 app_index)
This method is used by the application to delete an application
key.
The app_index parameter is a 12-bit value (0x000-0xFFF)
specifying which app key to delete.
This call affects the local bluetooth-meshd key database only.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
void ImportRemoteNode(uint16 primary, uint8 count,
array{byte}[16] device_key)
This method is used by the application to import a remote node
that has been provisioned by an external process.
The primary parameter specifies the unicast address of the
the node being imported.
The count parameter specifies the number of elements that are
assigned to this remote node.
The device_key parameter is the access layer key that will be
used to decrypt privileged messages from this remote node.
This call affects the local bluetooth-meshd key database only.
It is an error to call this with address range overlapping
with local element addresses.
PossibleErrors:
org.bluez.mesh.Error.Failed
org.bluez.mesh.Error.InvalidArguments
void DeleteRemoteNode(uint16 primary, uint8 count)
This method is used by the application to delete a remote node
from the local device key database.
The primary parameter specifies the unicast address of the
the node being deleted.
The count parameter specifies the number of elements that were
assigned to the remote node.
This call affects the local bluetooth-meshd key database only.
It is an error to call this with address range overlapping
with local element addresses.
PossibleErrors:
org.bluez.mesh.Error.InvalidArguments
dict ExportKeys(void)
This method is used by the application to export information
about network keys, application keys and device keys present
in the local key database.
dict
A dictionary that contains information for the keys
stored in the keyring with the following keys defined:
NetKeys:
array{struct} net_keys:
uint16 index
Subnet index
array{byte}[16] key
dict:
A dictionary that contains optional
key info with the following keys
defined:
uint8 Phase
Key Refresh phase of the subnet
array{byte}[16] OldKey
array{struct} AppKeys:
uint16 index
Application key index
array{byte}[16] key
dict:
A dictionary of optional
key info with the
following keys defined:
array{byte}[16] OldKey
DevKeys:
array{struct} dev_keys:
Device Key information for known remote
nodes in the configured Mesh network
uint16 unicast
Unicast address of the node's primary
element
array{byte}[16] key
Mesh Application Hierarchy
==========================
Service unique name
Interface org.bluez.mesh.Application1
Object path <app_root>
An application is a collection of elements that host SIG defined and vendor
specific models. It is expected that an application implements
org.freedesktop.DBus.ObjectManager interface at app_root path.
An example mesh application hierarchy may look like this:
-> /com/example
| - org.freedesktop.DBus.ObjectManager
|
-> /com/example/application
| - org.bluez.mesh.Application1
| - org.bluez.mesh.Attention1 (optional)
| - org.bluez.mesh.Provisioner1 (optional,Provisioner)
|
-> /com/example/agent
| - org.bluez.mesh.ProvisionAgent1
|
-> /com/example/ele00
| - org.bluez.mesh.Element1
|
-> /com/example/ele01
| - org.bluez.mesh.Element1
|
...
-> /com/example/elexx
- org.bluez.mesh.Element1
Methods:
void JoinComplete(uint64 token)
This method is called when the node provisioning initiated
by a Join() method call successfully completed.
The token parameter serves as a unique identifier of the
particular node. The token must be preserved by the application
in order to authenticate itself to the mesh daemon and attach to
the network as a mesh node by calling Attach() method or
permanently remove the identity of the mesh node by calling
Leave() method.
If this method returns an error, the daemon will assume that the
application failed to preserve the token, and will remove the
freshly created node.
void JoinFailed(string reason)
This method is called when the node provisioning initiated by
Join() has failed.
The reason parameter identifies the reason for provisioning
failure. The defined values are: "timeout", "bad-pdu",
"confirmation-failed", "out-of-resources", "decryption-error",
"unexpected-error", "cannot-assign-addresses".
Properties:
uint16 CompanyID [read-only]
A 16-bit Bluetooth-assigned Company Identifier of the vendor as
defined by Bluetooth SIG
uint16 ProductID [read-only]
A 16-bit vendor-assigned product identifier
uint16 VersionID [read-only]
A 16-bit vendor-assigned product version identifier
uint16 CRPL [read-only, optional]
A 16-bit minimum number of replay protection list entries
Mesh Element Hierarchy
======================
Service unique name
Interface org.bluez.mesh.Element1
Object path <app_defined_element_path>
Methods:
void MessageReceived(uint16 source, uint16 key_index,
variant destination, array{byte} data)
This method is called by bluetooth-meshd daemon when a message
arrives addressed to the application.
The source parameter is unicast address of the remote
node-element that sent the message.
The key_index parameter indicates which application key has been
used to decode the incoming message. The same key_index should
be used by the application when sending a response to this
message (in case a response is expected).
The destination parameter contains the destination address of
received message. Underlying variant types are:
uint16
Destination is an unicast address, or a well known
group address
array{byte}
Destination is a virtual address label
The data parameter is the incoming message.
void DevKeyMessageReceived(uint16 source, boolean remote,
uint16 net_index, array{byte} data)
This method is called by meshd daemon when a message arrives
addressed to the application, which was sent with the remote
node's device key.
The source parameter is unicast address of the remote
node-element that sent the message.
The remote parameter if true indicates that the device key
used to decrypt the message was from the sender. False
indicates that the local nodes device key was used, and the
message has permissions to modify local states.
The net_index parameter indicates what subnet the message was
received on, and if a response is required, the same subnet
must be used to send the response.
The data parameter is the incoming message.
void UpdateModelConfiguration(uint16 model_id, dict config)
This method is called by bluetooth-meshd daemon when a model's
configuration is updated.
The model_id parameter contains BT SIG Model Identifier or, if
Vendor key is present in config dictionary, a 16-bit
vendor-assigned Model Identifier.
The config parameter is a dictionary with the following keys
defined:
array{uint16} Bindings
Indices of application keys bound to the model
uint32 PublicationPeriod
Model publication period in milliseconds
uint16 Vendor
A 16-bit Bluetooth-assigned Company Identifier of the
vendor as defined by Bluetooth SIG
array{variant} Subscriptions
Addresses the model is subscribed to.
Each address is provided either as uint16 for group
addresses, or as array{byte} for virtual labels.
Properties:
uint8 Index [read-only]
Element index. It is required that the application follows
sequential numbering scheme for the elements, starting with 0.
array{(uint16 id, dict options)} Models [read-only]
An array of SIG Models:
id - SIG Model Identifier
options - a dictionary that may contain additional model
info. The following keys are defined:
boolean Publish - indicates whether the model
supports publication mechanism. If not
present, publication is enabled.
boolean Subscribe - indicates whether the model
supports subscription mechanism. If not
present, subscriptons are enabled.
The array may be empty.
array{(uint16 vendor, uint16 id, dict options)} VendorModels [read-only]
An array of Vendor Models:
vendor - a 16-bit Bluetooth-assigned Company ID as
defined by Bluetooth SIG.
id - a 16-bit vendor-assigned Model Identifier
options - a dictionary that may contain additional model
info. The following keys are defined:
boolean Publish - indicates whether the model
supports publication mechanism
boolean Subscribe - indicates whether the model
supports subscription mechanism
The array may be empty.
uint16 Location [read-only, optional]
Location descriptor as defined in the GATT Bluetooth Namespace
Descriptors section of the Bluetooth SIG Assigned Numbers
Mesh Attention Hierarchy
========================
Service unique name
Interface org.bluez.mesh.Attention1
Object path freely definable
This is an optional interface that implements health attention timer.
Methods:
void SetTimer(uint8 element_index, uint16 time)
The element_index parameter is the element's index within the
node where the health server model is hosted.
The time parameter indicates how many seconds the attention
state shall be on.
PossibleErrors:
org.bluez.mesh.Error.NotSupported
uint16 GetTimer(uint16 element)
The element parameter is the unicast address within the node
where the health server model is hosted.
Returns the number of seconds for how long the attention action
remains staying on.
PossibleErrors:
org.bluez.mesh.Error.NotSupported
Mesh Provisioner Hierarchy
============================
Service unique name
Interface org.bluez.mesh.Provisioner1
Object path freely definable
void ScanResult(int16 rssi, array{byte} data, dict options)
The method is called from the bluetooth-meshd daemon when a
unique UUID has been seen during UnprovisionedScan() for
unprovsioned devices.
The rssi parameter is a signed, normalized measurement of the
signal strength of the received unprovisioned beacon.
The data parameter is a variable length byte array, that may
have 1, 2 or 3 distinct fields contained in it including the 16
byte remote device UUID (always), a 16 bit mask of OOB
authentication flags (optional), and a 32 bit URI hash (if URI
bit set in OOB mask). Whether these fields exist or not is a
decision of the unprovisioned device.
The options parameter is a dictionary that may contain
additional optional configuration info:
uint16 Server
Specifies the remote server that received the
Unprovisioned beacon. If not present, beacon was
received locally.
uint8 array ExtendedData
If Extended data was requested during scanning, any
received data will be returned here.
If a beacon with a UUID that has already been reported is
received by the daemon, it will be silently discarded unless it
was received at a higher rssi power level.
uint16 net_index, uint16 unicast RequestProvData(uint8 count)
This method is implemented by a Provisioner capable application
and is called when the remote device has been fully
authenticated and confirmed.
The count parameter is the number of consecutive unicast
addresses the remote device is requesting.
Return Parameters are from the Mesh Profile Spec:
net_index - Subnet index of the net_key
unicast - Primary Unicast address of the new node
PossibleErrors:
org.bluez.mesh.Error.Abort
uint16 unicast RequestReprovData(uint16 original, uint8 count)
This method is implemented by a Provisioner capable application
and is called when the remote node being reprovisioned has been
fully authenticated and confirmed. This method will only be
called if the NPPI-1 procedure (Node Address Refresh) is being
performed.
The original parameter is the current unicast address of the
node being reprovisioned.
The count parameter is the number of consecutive unicast
addresses the remote node is requesting.
Return Parameter:
unicast - Primary Unicast address of the new node
PossibleErrors:
org.bluez.mesh.Error.Abort
void AddNodeComplete(array{byte}[16] uuid, uint16 unicast, uint8 count)
This method is called when the node provisioning initiated
by an AddNode() method call successfully completed.
The unicast parameter is the primary address that has been
assigned to the new node, and the address of it's config server.
The count parameter is the number of unicast addresses assigned
to the new node.
The new node may now be sent messages using the credentials
supplied by the RequestProvData method.
void ReprovComplete(uint16 original, uint8 nppi, uint16 unicast,
uint8 count)
This method is called when the node Reprovisioning initiated
by a Reprovision() method call successfully completed.
The original parameter is the former primary address of the
node that has been reprovisioned.
The nppi parameter indicates which NPPI procedure was performed.
If procedure 1 or 2 was performed, the node is materially
different than it was before reprovisioning, and Composition,
Bindings, Publication and Subscription settings should be
refreshed.
The unicast parameter is the new primary address that has been
assigned to the node, If NPPI procedure 1 was performed this
value may be different from the original. If procedure 0 or 2
was performed, the original and new primary address should be
the same.
The count parameter is the number of unicast addresses assigned
to the node.
The node may now be sent messages using the credentials
supplied by the RequestReprovData method.
void AddNodeFailed(array{byte}[16] uuid, string reason)
This method is called when the node provisioning initiated by
AddNode() has failed. Depending on how far Provisioning
proceeded before failing, some cleanup of cached data may be
required.
The reason parameter identifies the reason for provisioning
failure. The defined values are: "aborted", "timeout",
"bad-pdu", "confirmation-failed", "out-of-resources",
"decryption-error", "unexpected-error",
"cannot-assign-addresses".
void ReprovFailed(uint16 unicast, string reason)
This method is called when node reprovisioning initiated by
Reprovision() has failed. If reprovisioning has failed, the
prior credentials of the remote node may still be valid.
The reason parameter identifies the reason for provisioning
failure. The defined values are: "aborted", "timeout",
"bad-pdu", "confirmation-failed", "out-of-resources",
"decryption-error", "unexpected-error",
"cannot-assign-addresses".
Provisioning Agent Hierarchy
============================
Service unique name
Interface org.bluez.mesh.ProvisionAgent1
Object path freely definable
Methods:
array{byte} PrivateKey()
This method is called during provisioning if the Provisioner
has requested Out-Of-Band ECC key exchange. The Private key is
returned to the Daemon, and the Public Key is delivered to the
remote Provisioner using a method that does not involve the
Bluetooth Mesh system. The Private Key returned must be 32
octets in size, or the Provisioning procedure will fail and be
canceled.
This function will only be called if the Provisioner has
requested pre-determined keys to be exchanged Out-of-Band, and
the local role is Unprovisioned device.
array{byte} PublicKey()
This method is called during provisioning if the local device is
the Provisioner, and is requestng Out-Of-Band ECC key exchange.
The Public key is returned to the Daemon that is the matched
pair of the Private key of the remote device. The Public Key
returned must be 64 octets in size, or the Provisioning
procedure will fail and be canceled.
This function will only be called if the Provisioner has
requested pre-determined keys to be exchanged Out-of-Band, and
the local role is Provisioner.
void DisplayString(string value)
This method is called when the Daemon has something important
for the Agent to Display, but does not require any additional
input locally. For instance: "Enter "ABCDE" on remote device".
void DisplayNumeric(string type, uint32 number)
This method is called when the Daemon has something important
for the Agent to Display, but does not require any additional
input locally. For instance: "Enter 14939264 on remote device".
The type parameter indicates the display method. Allowed values
are:
"blink" - Locally blink LED
"beep" - Locally make a noise
"vibrate" - Locally vibrate
"out-numeric" - Display value to enter remotely
"push" - Request pushes on remote button
"twist" - Request twists on remote knob
The number parameter is the specific value represented by the
Prompt.
uint32 PromptNumeric(string type)
This method is called when the Daemon requests the user to
enter a decimal value between 1-99999999.
The type parameter indicates the input method. Allowed values
are:
"blink" - Enter times remote LED blinked
"beep" - Enter times remote device beeped
"vibrate" - Enter times remote device vibrated
"in-numeric" - Enter remotely displayed value
"push" - Push local button remotely requested times
"twist" - Twist local knob remotely requested times
This agent should prompt the user for specific input. For
instance: "Enter value being displayed by remote device".
array{byte}[16] PromptStatic(string type)
This method is called when the Daemon requires a 16 octet byte
array, as an Out-of-Band authentication.
The type parameter indicates the input method. Allowed values
are:
"static-oob" - return 16 octet array
"in-alpha" - return 16 octet alpha array
The Static data returned must be 16 octets in size, or the
Provisioning procedure will fail and be canceled. If input type
is "in-alpha", the printable characters should be
left-justified, with trailing 0x00 octets filling the remaining
bytes.
void Cancel()
This method gets called by the daemon to cancel any existing
Agent Requests. When called, any pending user input should be
canceled, and any display requests removed.
Properties:
array{string} Capabilities [read-only]
An array of strings with the following allowed values:
"blink"
"beep"
"vibrate"
"out-numeric"
"out-alpha"
"push"
"twist"
"in-numeric"
"in-alpha"
"static-oob"
"public-oob"
array{string} OutOfBandInfo [read-only, optional]
Indicates availability of OOB data. An array of strings with the
following allowed values:
"other"
"uri"
"machine-code-2d"
"bar-code"
"nfc"
"number"
"string"
"on-box"
"in-box"
"on-paper",
"in-manual"
"on-device"
string URI [read-only, optional]
Uniform Resource Identifier points to out-of-band (OOB)
information (e.g., a public key)
|