summaryrefslogtreecommitdiff
path: root/tags/host/0.8.1/src/org/reprap/comms/OutgoingMessage.java
blob: 2d67b65cd58b37f4023e4a51c9bebb96703cab3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package org.reprap.comms;

import org.reprap.Device;

/**
 *
 */
public abstract class OutgoingMessage {
		
	/**
	 * Fetch the binary payload corresponding to the completed message
	 * @return an array of bytes
	 */
	public abstract byte [] getBinary();
	
	/**
	 * Return an IncomingContext for a message in response to
	 * this message.  If necessary this can be overridden to
	 * include sequence numbers or other disambiguating
	 * information.
	 * @param communicator
	 * @return An IncomingContext object that can be used to
	 *   receive the reply to the message.
	 */
	public IncomingContext getReplyContext(Communicator communicator,
			Device device) {
		return new IncomingContext(communicator, device.getAddress());
	}
}