baltimore sigada rational rose real time presentation

95
Baltimore SIGAda • Rational Rose Real Time Presentation

Upload: tyra-dowdell

Post on 02-Apr-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Rational Rose Real Time Presentation

Page 2: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Real-Time System Design Concepts

Page 3: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Characteristics of Real-Time Systems– Responsiveness– Timeliness– Concurrency– Dynamic structure and behaviour– Distribution– Reliability

Page 4: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Hard Real-Time Systems– Deterministic system behaviour

• Soft Real-Time Systems

• System combinations of Soft and Hard Real-Time Systems

Page 5: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Hard Real-Time Systems are often designed with an additional component that is not part of the UML Standard – Timing Diagrams.

Hard Real-Time Systems are often designed to interact with sensors and activators on the equipment that the system is communicating with.

Page 6: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Hard real-time systems that are safety-critical may contain within the architecture a watchdog timer implementation.

• Watchdog timers may be built into a microprocessor card and are typically driven by a periodic reset signal from the primary processor. If the reset signal fails to reset the watchdog timer within that time, the watchdog timer restarts the main processor.

Page 7: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Real-time systems may make use of a technique called “interrupts”.

Interrupts may be disabled and the result is a portion of code that is “atomic”. Some portions of a real-time system to operate correctly are labelled “critical sections” are must be atomic for the system to operate properly.

Page 8: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Modeling Real-Time Systems

Page 9: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Concurrency support from operating systems and programming languages is limited.

• Many complex real-time systems are state-based. The behaviour of these systems may be difficult to design and understand.

Page 10: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• In order to model states with concurrency one needs a notation, a process and a tool.

• This pyramid of building blocks is represented by the Unified Modeling Language, the Rational Unified Process and the Rational Rose Real-Time Modeling tool.

Page 11: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• UML and Rose Realtime handle concurrency with the capsule. The capsule provides this capability to model concurrency.

• To support concurrency a passive object must exercise control over “critical” or “atomic” sections of code where variable could be accessed simultaneously. An example of the problem is the Shared Data Bug.

Page 12: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Active Objects and Finite State Machines– State – condition in which an active object

persists and behaves in a predetermined way for some time

– Transition -- path connecting two states – Trigger – an event which fires a transition– Action – work performed by action code when

transition is fired by the triggering event

Page 13: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Capsule enforce the O-O concept of encapsulation.

• Capsules interact via asynchronous message passing.

• Capsules encapsulate the finite state machine behaviour, an execution thread, and the properties of the capsule.

Page 14: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Capsules may be concurrent or distributed.• Capsules may be tested independently.• Demonstrate use of a capsule in a concurrent

architecture.• In a Class Diagram identify the UML notation for a

capsule. – Attributes– Operations– Ports– Finite State Machine– Structure Diagram

Page 15: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• UML Models– Use Case Model – similar to requirements– Design Model – realized by class diagrams– Implementation Model – collection of

components– Test Model – test cases and procedures

Page 16: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Rose Real-Time Views– Use-Case View – use-case diagrams; interaction diagrams –

sequence and collaboration diagrams; – Logical View – class diagrams; structure diagrams; state

diagrams; collaboration diagrams; sequence diagrams;– Implementation (Component) View – executables, C++

Libraries; C++ External Libraries – Deployment View – software components are mapped to

hardware deployment configuration– See Rational Training Course DEV160 Modeling Behaviour

with UML– Demonstrate the views to the working group.

Page 17: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Use-Case View diagrams consist of use-case and interaction diagrams

• Use Case Diagrams consist of actors and use cases

• Actors are outside of the system and interact with the system

• Use cases are actions performed by the system

Page 18: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Interaction Diagrams consist of collaboration diagrams– Framework for sequence diagrams

Page 19: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Sequence Diagrams are interactions between elements as a time ordered set of messages.

• Contain instances of capsules.

Page 20: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Logical View contains Class Diagrams, Structure Diagrams, State Diagrams, Collaboration Diagrams and Sequence Diagrams.

Page 21: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Class Diagrams depict static view of Packages, Capsules, Classes, Protocols and Relationships

Page 22: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Structure Diagrams are a specialized Collaboration Diagram.

• Contain Capsule roles, Ports and Connectors.

• Structure diagrams are contained within a capsule.

Page 23: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• State Diagrams depict high level behaviour of a capsule in a finite state machine

• Contain States, substates and transitions

Page 24: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Component View describes organization of static software modules

• The software is built in this view (i.e. compiled)

• Contains executables and C and C++ Libraries

Page 25: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Deployment View is where software components are mapped onto hardware

• Contains processors and component instances– Processors describe on what processor the built

component is run on– Component instances are executable

components

Page 26: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Socket Interface Presentation• The purpose of this presentation is to describe how a Socket Interface may be implemented using Rational Rose.

Page 27: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• This demo uses the following Architecture:

Page 28: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• This is the Class Diagram for the server (ReceiverSameThread) and client (SenderSameThread) capsules. They represent the top-level capsules for the ping/pong example. The IPC and TCP capsules are incarnated by the top-level capsules onto a physical thread configured with the RTCustomController implementation class.

Page 29: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The Class Diagram depicts a composition relationship between the top-level capsules and the IPC and TCP capsules. The next two slides describe a composition relationship.

Page 30: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Server Side Socket Connection

Description

Page 31: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The IPCReceiver capsule is incarnated by the top-level capsules onto a physical thread configured with the RTCustomController implementation class i.e. a RTCustomController thread.

• The frame service in Rose Real-Time is used to incarnate an IPCReceiver capsule role.

Page 32: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• An example of how the frame service is used below to incarnate (i.e. create or instanstiate) capsule roles, destroy capsule roles, plug in capsule roles (i.e. import) or unplug capsule roles (i.e. deport)

• id = frame.incarnate(iPCReceiver, IPCReceiver, EmptyObject, CustomIPCThread );

Page 33: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda The frame service call is action code contained within the transition Labelled initialize. This is a state diagram for the capsule ReceiverSameThread.

Page 34: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The incarnated TCPServer and TCPClient architecture

Page 35: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Here is structure diagram which contains a capsule role labelled iPCReceiver.

Page 36: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The previous slides shows a structure diagram for ReceiverSameThread which contains a capsule role labelled IPCReceiver. This capsule role has a symbol in the lower right corner that indicates that there is a nested capsule role within this capsule role.

Page 37: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The structure diagram for IPCReceiver capsule contains a capsule role labelled customIPCLayer of class TCPServer.

Page 38: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• iPCReceiver refers to the optional Capsule Role

• IPCReceiver is the address to myData

• EmptyObject is an optional piece of data that is delivered to the capsule in its initial transition.

• CustomIPCThread refers to the logical thread in which the capsule runs on.

Page 39: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The IPCReceiver capsule controls the number of messages exchanged with the TCPclient capsule through the contained optional capsule 'customIPCLayer'.

Page 40: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The capsule role labelled customIPCLayer of class TCPServer is connected via a connector to a port labelled talkRemote.

• The talkRemote port is a conjugated, wired, protected, end port in the structure diagram for IPCReceiver.

Page 41: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• In the previous slide, the rounded rectangle attached to the end port refers to the state machine of the associated capsule. So messages coming in on this port are delivered to, and are processed by the associated capsule’s state machine. The connected boxes inside the rounded rectangle refer to a connection. Ports that have the connected boxes in it are wired ports.

Page 42: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• This is the state diagram for the IPCReceiver capsule.

Page 43: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The following slide depicts how action code contained within the transition labelled Initialize will incarnate a TCPServer.

Page 44: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• An example of how the frame service is used below to incarnate (i.e. create or instanstiate) capsule roles, destroy capsule roles, plug in capsule roles (i.e. import) or unplug capsule roles (i.e. deport)

• id = frame.incarnate(customIPCLayer,

TCPServer, EmptyObject, CustomIPCThread );

Page 45: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The action code in the transition labelled ping uses the talkRemote port to send the pong signal. The format for sending data in Rose Real-Time is port_name.signal(data).send();

• The pong signal is defined in a protocol class and optionally may have data associated with them. Action code is below.

• talkRemote.pong().send();

Page 46: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• This is the state diagram for the TCPServer capsule.

Page 47: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The transition for internalSetup sets a variable called internalFd which will be used by 'wakeup' calls to unblock the RTCustomController.

• internalFD is a internal UDP socket descriptor.

• UDP sockets are connectionless and have no protocol. There are suitable to use for the purpose of local host (board) communication.

• internalFd = makeUdpConnection();

Page 48: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• A connectionless service is one in which transmissions take place without a pre-established path between the source and destination. Because packets may arrive by different paths and in random sequences, there is no way to guarantee delivery of a message in a connectionless service. Because it can not guarantee delivery, a connectionless service is described as a best effort service.

Page 49: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The Action Code for the choice point labelled internalOK checks the value of internalFd [which is an internal socket descriptor] to see if if it has been set to a value other than -1 which it was initialized to.

• Action code is on next slide.

Page 50: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• if( internalFd < 0 )• return 0; // not OK• // Follow the FALSE path

• // of the Choice Point

• ioMonitor.add( internalFd, RTIOMonitor::CanRead );

• return 1; // OK• // Follow the TRUE path

• // of the Choice Point

Page 51: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• TCPServer side transition action code for externalSetUp on next three slides

• create an variable labelled listener of type RTTcpSocket class

• RTTcpSocket listener;

Page 52: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• use the RoseRT log service to output a message

without a carriage return and the integer value of the listening port.

• LISTENING_PORT is a constant in the TCPIP_Proxies package and its value is set to 31736

• log.show("Listening to: "); log.log( (int)LISTENING_PORT );

Page 53: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• ioMonitor of class RTIOmonitor is used to monitor the external socket channel 'c_socket'

• registerWith is a public function which returns a void which is contained within header file RTTcpSocket.h

• c_socket.registerWith( &ioMonitor );

Page 54: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Action Code for Choice Point labelled external OK

• The function int RTTcpSocket::state() returns 'Established‘ if the socket file descriptor is usable

• return ( c_socket.state() == RTTcpSocket::Established );

Page 55: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• if the state() function returns Established then the socket file descriptor is usable then take the TRUE path of the choice point which in this case is registerWithController

• if the state() function does not return Established then the socket file descriptor is not usable then take the FALSE path of the choice point which in this case is giveUP

Page 56: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Action Code for transition labelled giveUp

• Use the Rational Rose RT System Service called the Log Service to output a message without a carriage return

• log.show("IPC channel initialization failed\n");

• Close the external socket channel c_socket

• c_socket.close();

Page 57: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• Action Code for transition labelled registerWithController

• The macro REGISTER_LAYER takes three arguments which are pointers to the 'waitfunc', 'wakeupFunc', and 'processFunc‘ functions to be called by the RTCustomController.

• If any of these are null pointers the default values are used.

• The waitForEvents function is called when the when the RTCustomController does not have any messages left to deliver.

Page 58: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• REGISTER_LAYER( waitForEvents, wakeup, 0);

• Use the Rational Rose RT System Service called the Log Service to output a message with a carriage return

• log.log("Connected");• set the length of the buffer to the integer value of the constant BUFFLEN which is in this 100

• buffLen = (int)BUFF_LEN;

Page 59: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• State Diagram for substate labelled Operational

Page 60: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Action Code for transition labelled ‘pong’

• int RTTcpSocket::write() - writes on a socket file descriptor using the system call write

• The incoming buffer needs to be of size buffLen which is 100

• if( c_socket.write( incomingBuffer, buffLen ) != buffLen )

Page 61: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

Use the Rational Rose RT System Servic called the Log Service to output a message without a carriage return

• log.show( "TCPServer: incomplete write\n" );

• the incoming Buffer was not of length buffLen

Page 62: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• This is the structure diagram for the TCPServer capsule.

Page 63: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The port labelled talkRemote is an public, unconjugated, wired end port.

Page 64: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Client Side Socket Description

Page 65: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The incarnated TCPServer and TCPClient architecture

Page 66: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The IPCSender capsule is incarnated by the top-level capsules onto a physical thread configured with the RTCustomController implementation class i.e. a RTCustomController thread.

• The frame service in Rose Real-Time is used to incarnate an IPCSender capsule role.

Page 67: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• An example of how the frame service is used below to incarnate (i.e. create or instanstiate) capsule roles, destroy capsule roles, plug in capsule roles (i.e. import) or unplug capsule roles (i.e. deport)

• id = frame.incarnate(iPCSender, IPCSender, EmptyObject, CustomIPCThread );

Page 68: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda The frame service call is action code contained within the transition Labelled initialize.

Page 69: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Here is a structure diagram which contains a capsule role labelled iPCSender.

Page 70: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The previous slides shows a structure diagram for SenderSameThread which contains a capsule role labelled IPCSender. This capsule role has a symbol in the lower right corner that indicates that there is a nested capsule role within this capsule role.

Page 71: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The structure diagram for IPCSender capsule contains a capsule role labelled customIPCLayer of class TCPClient.

Page 72: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• iPCSender refers to the optional Capsule Role

• IPCSender is the address to myData • EmptyObject is an optional piece of data that is delivered to the capsule in its initial transition.

• CustomIPCThread refers to the logical thread in which the capsule runs on.

Page 73: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The IPCSender capsule controls the number of messages exchanged with the TCPServer capsule through the contained optional capsule 'customIPCLayer'.

Page 74: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The capsule role labelled customIPCLayer of class TCPServer is connected via a connector to a port labelled talkRemote.

• The talkRemote port is an unconjugated, wired, protected, end port in the structure diagram for IPCSender.

Page 75: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• In the previous slide, the rounded rectangle attached to the end port refers to the state machine of the associated capsule. So messages coming in on this port are delivered to, and are processed by the associated capsule’s state machine. The connected boxes inside the rounded rectangle refer to a connection. Ports that have the connected boxes in it are wired ports.

Page 76: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• This is the state diagram for the IPCSender capsule.

Page 77: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The following slide depicts how action code contained within the transition labelled Initialize will incarnate a TCPClient.

Page 78: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• An example of how the frame service is used below to incarnate (i.e. create or instanstiate) capsule roles, destroy capsule roles, plug in capsule roles (i.e. import) or unplug capsule roles (i.e. deport)

• id = frame.incarnate(customIPCLayer,

TCPClient, EmptyObject, CustomIPCThread );

Page 79: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The action code in the transition labelled pong uses the talkRemote port to send the ping signal. The format for sending data in Rose Real-Time is port_name.signal(data).send();

• The ping signal is defined in a protocol class and optionally may have data associated with them. Action code is below.

• talkRemote.ping().send();

Page 80: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• This is the state diagram for the TCPClient capsule.

Page 81: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The transition for internalSetup sets a variable called internalFd which will be used by 'wakeup' calls to unblock the RTCustomController.

• internalFD is a internal UDP socket descriptor.

• UDP sockets are connectionless and have no protocol. There are suitable to use for the purpose of local host (board) communication.

• internalFd = makeUdpConnection();

Page 82: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• A connectionless service is one in which transmissions take place without a pre-established path between the source and destination. Because packets may arrive by different paths and in random sequences, there is no way to guarantee delivery of a message in a connectionless service. Because it can not guarantee delivery, a connectionless service is described as a best effort service.

Page 83: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The Action Code for the choice point labelled internalOK checks the value of internalFd [which is an internal socket descriptor] to see if if it has been set to a value other than -1 which it was initialized to.

• Action code is on next slide.

Page 84: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• if( internalFd < 0 )• return 0; // not OK• // Follow the FALSE path

• // of the Choice Point

• ioMonitor.add( internalFd, RTIOMonitor::CanRead );

• return 1; // OK• // Follow the TRUE path

• // of the Choice Point

Page 85: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• TCPClient side transition action code for externalSetUp on next three slides

• The client will form connections actively to the TCPServer.

• The value of listening port has been set to 31736. This is the port number value of the NASAServer on this machine.

• The type of listening port is short int.

Page 86: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The RoseRT call to the log service will display the

• port number of the NASAServer• log.show("Connecting to: "); log.show( (int)LISTENING_PORT );

Page 87: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

If running on an embedded target, run either the server or client down on the embedded board. Run the other on your host machine. Modify the ip address defined in the TCPIP_Proxies::CONSTANTS to that of either the host or target. If both the server and client run on the same workstation the ip address can remain at 127.0.0.1.

• For the purposes of this demo MASTER_HOST is set to 127.0.0.1 because the client and server are running on the same microprocessor

Page 88: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• if( c_socket.create() &&• c_socket.connect( (const char *)MASTER_HOST, (int)LISTENING_PORT ) )

• while( c_socket.state() == RTTcpSocket::SynSent )

• ioMonitor.wait( &RTTimespec::zero );

Page 89: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Action Code for Choice Point labelled external OK

• The function int RTTcpSocket::state() returns 'Established‘ if the socket file descriptor is usable

• return ( c_socket.state() == RTTcpSocket::Established );

Page 90: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• if the state() function returns Established then the socket file descriptor is usable then take the TRUE path of the choice point which in this case is registerWithController

• if the state() function does not return Established then the socket file descriptor is not usable then take the FALSE path of the choice point which in this case is giveUP

Page 91: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• Action Code for transition labelled giveUp

• Use the Rational Rose RT System Service called the Log Service to output a message without a carriage return

• log.show("IPC channel initialization failed\n");

• Close the external socket channel c_socket

• c_socket.close();

Page 92: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda• Action Code for transition labeled registerWithController

• The macro REGISTER_LAYER takes three arguments which are pointers to the 'waitfunc', 'wakeupFunc', and 'processFunc‘ functions to be called by the RTCustomController.

• If any of these are null pointers the default values are used.

• The waitForEvents function is called when the when the RTCustomController does not have any messages left to deliver.

Page 93: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• REGISTER_LAYER( waitForEvents, wakeup, 0);

• Use the Rational Rose RT System Service called the Log Service to output a message with a carriage return

• log.log("Connected");• set the length of the buffer to the integer value of the constant BUFFLEN which is in this 100

• buffLen = (int)BUFF_LEN;• talkRemote.recall();

Page 94: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• This is the structure diagram for the TCPClient capsule.

Page 95: Baltimore SIGAda Rational Rose Real Time Presentation

Baltimore SIGAda

• The port labeled talkRemote is an public, conjugated, wired end port.

• Rational RoseReal-Time is a product of IBM Rational Software Corp.