// 2006-08-31, Judi Romijn
// State tables for IEEE 1073 baseline environment with wLAN
// System timing constants
// The only hard figure given is alarmLimit which should equal 10 seconds
// So all constants are given in 10/alarmLimit seconds
const int minTO = 1; // min delay to deliver a message (Buffer)
const int maxTO = 2; // max delay to deliver a message (Buffer)
const int connTO = 1; // max delay to connect Manager, resp. Agent, after connecting Agent, resp. Manager (Environment)
const int tickTO = 1; // delay before sending a tick (alive) message (Manager/Agent)
const int mConfTO = 1; // maximum time that Manager hangs around in state stConfigured before proceeding to stOperational
const int aConfTO = 1; // maximum time that Agent hangs around in state stConfiguring before proceeding to stConfigured
const int aReconfTO = 1; // maximum time that Agent hangs around in state stReconfiguring before proceeding to stConfigured
const int msgTO = 2*maxTO; // timeout threshold to decide that a message is lost (internal or tick) (Manager/Agent)
const int alarmLimit = 20; // Imposed maximal delay according to [AAMI EC-13] standard (query)
const int alarmTO = alarmLimit-maxTO; // timeout threshold to raise alarm, patient may be in danger (Manager/Agent)
broadcast chan flush; /* network disconnect causes internal messages to be lost */
/* --- External event channels --- */
chan aConnect; /* (Agent) Line or network connect event */
chan mConnect; /* (Manager) Line or network connect event */
// chan aInternalReconfiguration; /* (Agent) Internal reconfiguration */
chan mTerminationIntention; /* (Manager) Termination intention indication by user */
chan aDisconnect; /* (Agent) Line or network disconnect event */
chan mDisconnect; /* (Manager) Line or network disconnect event */
// chan aUnrecoverableError; /* (Agent) Unrecoverable Error */
// chan mUnrecoverableError; /* (Manager) Unrecoverable Error */
chan syncCSER; /* synchronise on sending & confirmation of context scanner event reports (initiative Agent) */
chan syncMETS; /* synchronise on sending & confirmation of scanners enabled (initiative Manager) */
/* --- Internal events: an integer constant for each of these --- */
const int amConnectIndicationEvent = 0; /* Connect Indication Event from agent to manager */
const int maAssociationRequest = 1; /* Association requested by manager */
const int amAssociationAccept = 2; /* Association accepted by agent */
const int amAssociationReject = 3; /* Association rejected by agent */
const int amMdsCreateEvent = 4; /* MDS Create Event from agent to manager */
const int maMdsCreateEventResult = 5; /* MDS Create Event Result from manager to agent */
const int amMdsStateChangeNotification = 6; /* MDS State Change Notification to configured state, from agent to manager */
const int maMdsStateChangeEventResult = 7; /* MDS State Change Event Result from manager to agent */
const int amMdsStateChangeNotificationRe = 8; /* MDS State Change Notification to reconfiguring state, from agent to manager */
const int maContextScannerCreateRequest = 9; /* Context Scanner Create Request from manager to agent */
const int amContextScannerCreateResult = 10; /* Context Scanner Create Result from agent to manager */
const int maAssociationReleaseRequest = 11; /* Association Release Requested from manager to agent */
const int amAssociationReleaseResponse = 12; /* Association Release Response from agent to manager */
const int amAssociationAbort = 13; /* Association aborted by agent */
const int maAssociationAbort = 14; /* Association aborted by manager*/
const int maLifeTick = 15; /* Life tick message from manager to agent */
const int amLifeTick = 16; /* Life tick message from agent to manager */
const int NrOfMsgs = amLifeTick+1;
chan Bi[NrOfMsgs]; /* one input buffer channel per message, this facilitates (non-)deterministic selection */
chan Bo[NrOfMsgs]; /* one output buffer channel per message */
bool IgnMUnassociated(int Msg)
{ return ((Msg==amAssociationAccept)
or (Msg==amAssociationReject)
or (Msg==amMdsCreateEvent)
or (Msg==amMdsStateChangeNotification)
or (Msg==amMdsStateChangeNotificationRe)
or (Msg==amContextScannerCreateResult)
or (Msg==amAssociationReleaseResponse)
or (Msg==amLifeTick));
}
bool IgnMAssociating(int Msg)
{ return ((Msg==amConnectIndicationEvent)
or (Msg==amMdsCreateEvent)
or (Msg==amMdsStateChangeNotification)
or (Msg==amMdsStateChangeNotificationRe)
or (Msg==amContextScannerCreateResult)
or (Msg==amAssociationReleaseResponse)
or (Msg==amLifeTick));
}
bool IgnMAssociated(int Msg)
{ return ((Msg==amConnectIndicationEvent)
or (Msg==amAssociationAccept)
or (Msg==amAssociationReject)
or (Msg==amMdsStateChangeNotification)
or (Msg==amMdsStateChangeNotificationRe)
or (Msg==amContextScannerCreateResult)
or (Msg==amAssociationReleaseResponse)
or (Msg==amLifeTick));
}
bool IgnMCSCRConfiguring(int Msg)
{ return ((Msg==amConnectIndicationEvent)
or (Msg==amAssociationAccept)
or (Msg==amAssociationReject)
or (Msg==amMdsCreateEvent)
or (Msg==amMdsStateChangeNotification)
or (Msg==amMdsStateChangeNotificationRe)
or (Msg==amAssociationReleaseResponse)
or (Msg==amLifeTick));
}
bool IgnMConfiguring(int Msg)
{ return ((Msg==amConnectIndicationEvent)
or (Msg==amAssociationAccept)
or (Msg==amAssociationReject)
or (Msg==amMdsCreateEvent)
or (Msg==amMdsStateChangeNotificationRe)
or (Msg==amContextScannerCreateResult)
or (Msg==amAssociationReleaseResponse)
or (Msg==amLifeTick));
}
bool IgnMConfigured(int Msg)
{ return ((Msg==amConnectIndicationEvent)
or (Msg==amAssociationAccept)
or (Msg==amAssociationReject)
or (Msg==amMdsCreateEvent)
or (Msg==amMdsStateChangeNotification)
or (Msg==amMdsStateChangeNotificationRe)
or (Msg==amContextScannerCreateResult)
or (Msg==amAssociationReleaseResponse)
or (Msg==amLifeTick));
}
bool IgnMOperating(int Msg)
{ return ((Msg==amConnectIndicationEvent)
or (Msg==amAssociationAccept)
or (Msg==amAssociationReject)
or (Msg==amMdsCreateEvent)
or (Msg==amMdsStateChangeNotification)
or (Msg==amContextScannerCreateResult)
or (Msg==amAssociationReleaseResponse));
}
bool IgnMReconfiguring(int Msg)
{ return ((Msg==amConnectIndicationEvent)
or (Msg==amAssociationAccept)
or (Msg==amAssociationReject)
or (Msg==amMdsCreateEvent)
or (Msg==amMdsStateChangeNotificationRe) /* what to do with this one? ignore? */
or (Msg==amContextScannerCreateResult)
or (Msg==amAssociationReleaseResponse)
or (Msg==amLifeTick));
}
bool IgnMDisassociating(int Msg)
{ return ((Msg==amConnectIndicationEvent)
or (Msg==amAssociationAccept)
or (Msg==amAssociationReject)
or (Msg==amMdsCreateEvent)
or (Msg==amMdsStateChangeNotification)
or (Msg==amMdsStateChangeNotificationRe)
or (Msg==amContextScannerCreateResult)
or (Msg==amLifeTick));
}
bool IgnAUnassociated(int Msg)
{ return ((Msg==maMdsCreateEventResult)
or (Msg==maMdsStateChangeEventResult)
or (Msg==maContextScannerCreateRequest)
or (Msg==maLifeTick));
}
bool IgnAUnassociated2(int Msg)
{ return ((Msg==maAssociationRequest)
or (Msg==maMdsCreateEventResult)
or (Msg==maMdsStateChangeEventResult)
or (Msg==maContextScannerCreateRequest)
or (Msg==maAssociationReleaseRequest)
or (Msg==maLifeTick)
or (Msg==maAssociationAbort));
}
bool IgnAAssociating(int Msg)
{ return ((Msg==maAssociationRequest)
or (Msg==maMdsStateChangeEventResult)
or (Msg==maContextScannerCreateRequest)
or (Msg==maLifeTick));
}
bool IgnAAssociated(int Msg)
{ return ((Msg==maAssociationRequest)
or (Msg==maMdsCreateEventResult)
or (Msg==maMdsStateChangeEventResult)
or (Msg==maLifeTick));
}
bool IgnAConfiguring(int Msg)
{ return ((Msg==maAssociationRequest)
or (Msg==maMdsCreateEventResult)
or (Msg==maMdsStateChangeEventResult)
or (Msg==maContextScannerCreateRequest)
or (Msg==maLifeTick));
}
bool IgnAConfigured(int Msg)
{ return ((Msg==maAssociationRequest)
or (Msg==maMdsCreateEventResult)
or (Msg==maContextScannerCreateRequest)
or (Msg==maLifeTick));
}
bool IgnAOperating(int Msg)
{ return ((Msg==maAssociationRequest)
or (Msg==maMdsCreateEventResult)
or (Msg==maMdsStateChangeEventResult)
or (Msg==maContextScannerCreateRequest));
}
bool IgnAReconfiguring(int Msg)
{ return ((Msg==maAssociationRequest)
or (Msg==maMdsCreateEventResult)
or (Msg==maMdsStateChangeEventResult)
or (Msg==maContextScannerCreateRequest)
or (Msg==maLifeTick));
}
Managerclock LastMsg;
clock Waiting;stAlarmstDisassociatingstReconfiguringstOperatingstConfiguredstUnassociatedstCSCRConfiguringstConfiguringstAssociatedstAssociatingstDisconnectedAgentclock LastMsg;
clock Waiting;stUnassociatedstAlarmstReconfiguringstConfiguringstAssociatingstOperatingstConfiguredstAssociatedstUnassociated2stDisconnectedEnvironmentclock delay;disconnectingAMdisconnectingAdisconnectingMconAMdisA_conMconA_disMdisAMBuffer
clock deliver; /* keep track of delay */
int[0,15] mes; /* message contents */FullEmptyBuf1 = Buffer();
Buf2 = Buffer();
Buf3 = Buffer();
Buf4 = Buffer();
Buf5 = Buffer();
system Manager, Agent, Environment, Buf1, Buf2, Buf3, Buf4, Buf5;