Class BaseMeshMessageHandler
java.lang.Object
org.openremote.agent.protocol.bluetooth.mesh.transport.BaseMeshMessageHandler
- All Implemented Interfaces:
InternalMeshMsgHandlerCallbacks,MeshMessageHandlerApi
public abstract class BaseMeshMessageHandler
extends Object
implements MeshMessageHandlerApi, InternalMeshMsgHandlerCallbacks
Abstract class that handles mesh messages
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Loggerprotected final InternalTransportCallbacksprotected MeshStatusCallbacks -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseMeshMessageHandler(InternalTransportCallbacks internalTransportCallbacks, NetworkLayerCallbacks networkLayerCallbacks, UpperTransportLayerCallbacks upperTransportLayerCallbacks) Constructs BaseMessageHandler -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateMeshMessage(int src, int dst, UUID label, MeshMessage meshMessage) Sends a mesh message specified within theMeshMessageobjectprotected org.openremote.agent.protocol.bluetooth.mesh.transport.MeshMessageStategetState(int address) Returns the existing state or a new state if nothing exists for a nodefinal voidonIncompleteTimerExpired(int address) Callback to notify the incomplete timer has expiredprotected voidparseMeshPduNotifications(byte[] pdu, MeshNetwork network) Parse the mesh network/proxy pdusvoidresetState(int address) Resets the state and transport for a given node addressprotected abstract voidsetMeshStatusCallbacks(MeshStatusCallbacks statusCallbacks) Sets the mesh status callbacks.
-
Field Details
-
LOG
-
mInternalTransportCallbacks
-
mStatusCallbacks
-
-
Constructor Details
-
BaseMeshMessageHandler
protected BaseMeshMessageHandler(InternalTransportCallbacks internalTransportCallbacks, NetworkLayerCallbacks networkLayerCallbacks, UpperTransportLayerCallbacks upperTransportLayerCallbacks) Constructs BaseMessageHandler- Parameters:
internalTransportCallbacks-InternalTransportCallbacksCallbacksnetworkLayerCallbacks-NetworkLayerCallbacksnetwork layer callbacksupperTransportLayerCallbacks-UpperTransportLayerCallbacksupper transport layer callbacks
-
-
Method Details
-
setMeshStatusCallbacks
Sets the mesh status callbacks.- Parameters:
statusCallbacks-MeshStatusCallbackscallbacks
-
parseMeshPduNotifications
protected void parseMeshPduNotifications(byte[] pdu, MeshNetwork network) throws ExtendedInvalidCipherTextException Parse the mesh network/proxy pdusThis method will try to network layer de-obfuscation and decryption using the available network keys
- Parameters:
pdu- mesh pdu that was sentnetwork-MeshNetwork- Throws:
ExtendedInvalidCipherTextException
-
onIncompleteTimerExpired
public final void onIncompleteTimerExpired(int address) Description copied from interface:InternalMeshMsgHandlerCallbacksCallback to notify the incomplete timer has expired- Specified by:
onIncompleteTimerExpiredin interfaceInternalMeshMsgHandlerCallbacks- Parameters:
address- address of the message
-
getState
protected org.openremote.agent.protocol.bluetooth.mesh.transport.MeshMessageState getState(int address) Returns the existing state or a new state if nothing exists for a node- Parameters:
address- address of the node
-
resetState
public void resetState(int address) Resets the state and transport for a given node address- Parameters:
address- unicast address of the node
-
createMeshMessage
Description copied from interface:MeshMessageHandlerApiSends a mesh message specified within theMeshMessageobject- Specified by:
createMeshMessagein interfaceMeshMessageHandlerApilabel- Label UUID for destination addressmeshMessage-MeshMessageMesh message containing the message opcode and message parameters
-