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 Logger
protected final InternalTransportCallbacks
protected MeshStatusCallbacks
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseMeshMessageHandler
(InternalTransportCallbacks internalTransportCallbacks, NetworkLayerCallbacks networkLayerCallbacks, UpperTransportLayerCallbacks upperTransportLayerCallbacks) Constructs BaseMessageHandler -
Method Summary
Modifier and TypeMethodDescriptionvoid
createMeshMessage
(int src, int dst, UUID label, MeshMessage meshMessage) Sends a mesh message specified within theMeshMessage
objectprotected org.openremote.agent.protocol.bluetooth.mesh.transport.MeshMessageState
getState
(int address) Returns the existing state or a new state if nothing exists for a nodefinal void
onIncompleteTimerExpired
(int address) Callback to notify the incomplete timer has expiredprotected void
parseMeshPduNotifications
(byte[] pdu, MeshNetwork network) Parse the mesh network/proxy pdusvoid
resetState
(int address) Resets the state and transport for a given node addressprotected abstract void
setMeshStatusCallbacks
(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
-InternalTransportCallbacks
CallbacksnetworkLayerCallbacks
-NetworkLayerCallbacks
network layer callbacksupperTransportLayerCallbacks
-UpperTransportLayerCallbacks
upper transport layer callbacks
-
-
Method Details
-
setMeshStatusCallbacks
Sets the mesh status callbacks.- Parameters:
statusCallbacks
-MeshStatusCallbacks
callbacks
-
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:InternalMeshMsgHandlerCallbacks
Callback to notify the incomplete timer has expired- Specified by:
onIncompleteTimerExpired
in 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:MeshMessageHandlerApi
Sends a mesh message specified within theMeshMessage
object- Specified by:
createMeshMessage
in interfaceMeshMessageHandlerApi
- Parameters:
label
- Label UUID for destination addressmeshMessage
-MeshMessage
Mesh message containing the message opcode and message parameters
-