hsmCommunicator::sendMessage

Send a message to the peer.

Since the protocol allows only one message to be outsanding, the machine dequeues and transmits a message only from the IDLE state, transitioning to the AWAITING_ACK state immediately thereafter.

In the AWAITNG_ACK state, incomming messages are parsed and, when an ACK is found, the machine checks the queue and transitions to the IDLE state. Checking the queue can return the SEND_MESSAGE event, which will be handled from the IDLE state, thus resulting in a transmission and return to the AWAITING_ACK state.

Number of events3
Events not handled0
Events handled in one state3
At least one event handled the same in all states?no
Number of states2
Number of states with entry functions0
Number of states with exit functions0
States handling no events0
States handling exactly one event1
States with no way in0
States with no way out0
  (hsmCommunicator::) SEND_MESSAGE (hsmCommunicator::) MESSAGE_RECEIVED ACK
IDLE sendMessage
returns:
  • noEvent

transition : AWAITING_ACK

Dequeue and transmit message to the peer.


transition : none

transition : none
AWAITING_ACK
transition : none
parseMessage
returns:
  • ACK
  • noEvent

transition : none
checkQueue
returns:
  • SEND_MESSAGE
  • noEvent

transition : IDLE

Check queue for messages; if found return SEND_MESSAGE; otherwise, return noEvent.

Events
Total number of events:3
Events with no handlers:0
Events with one handler:3
Average event state density:50%
(hsmCommunicator::) SEND_MESSAGE

Handled In 1 of 2 (50 %) States:

  • IDLE

Causes these actions to be taken:

  • sendMessage
(hsmCommunicator::) MESSAGE_RECEIVED

Handled In 1 of 2 (50 %) States:

  • AWAITING_ACK

Causes these actions to be taken:

  • parseMessage
ACK

Handled In 1 of 2 (50 %) States:

  • AWAITING_ACK

Causes these actions to be taken:

  • checkQueue
States
Total number of states:2
States with no events:0
States with one event:1
States with no way in:0
States with no way out:0
Average state event density:49%
IDLE

Inbound Transitions:

  • AWAITING_ACK

Outbound Transitions:

  • AWAITING_ACK

Events Handled (1 of 3 for 33%):

  • SEND_MESSAGE

Actions Taken:

  • sendMessage
AWAITING_ACK

Inbound Transitions:

  • IDLE

Outbound Transitions:

  • IDLE

Events Handled (2 of 3 for 66%):

  • ACK
  • MESSAGE_RECEIVED

Actions Taken:

  • checkQueue
  • parseMessage
Actions
sendMessage

Send a message to the peer.

Since the protocol allows only one message to be outsanding, the machine dequeues and transmits a message only from the IDLE state, transitioning to the AWAITING_ACK state immediately thereafter.

In the AWAITNG_ACK state, incomming messages are parsed and, when an ACK is found, the machine checks the queue and transitions to the IDLE state. Checking the queue can return the SEND_MESSAGE event, which will be handled from the IDLE state, thus resulting in a transmission and return to the AWAITING_ACK state.

Handles an event shared from hsmCommunicator



Returns:
  • noEvent

Matrices:

  • SEND_MESSAGE, IDLE transitions to state AWAITING_ACK
checkQueue

Returns:
  • SEND_MESSAGE
  • noEvent

Matrices:

  • ACK, AWAITING_ACK transitions to state IDLE
parseMessage

Handles an event shared from hsmCommunicator



Returns:
  • ACK
  • noEvent

Matrices:

  • MESSAGE_RECEIVED, AWAITING_ACK