use of org.openremote.agent.protocol.bluetooth.mesh.provisionerstates.ProvisioningCompleteState in project openremote by openremote.
the class MeshProvisioningHandler method parseProvisioningState.
private void parseProvisioningState(final UnprovisionedMeshNode unprovisionedMeshNode, final byte[] data) {
isProvisioningPublicKeySent = false;
isProvisioneePublicKeyReceived = false;
if (data[1] == ProvisioningState.State.PROVISIONING_COMPLETE.getState()) {
provisioningState = new ProvisioningCompleteState(unprovisionedMeshNode);
// Generate the network id and store it in the mesh node, this is needed to reconnect to the device at a later stage.
final ProvisionedMeshNode provisionedMeshNode = new ProvisionedMeshNode(unprovisionedMeshNode);
mInternalMeshManagerCallbacks.onNodeProvisioned(provisionedMeshNode);
mStatusCallbacks.onProvisioningCompleted(provisionedMeshNode, ProvisioningState.States.PROVISIONING_COMPLETE, data);
} else {
final ProvisioningFailedState provisioningFailedState = new ProvisioningFailedState();
provisioningState = provisioningFailedState;
if (provisioningFailedState.parseData(data)) {
mStatusCallbacks.onProvisioningFailed(unprovisionedMeshNode, ProvisioningState.States.PROVISIONING_FAILED, data);
}
}
}
Aggregations