From 9ce089fc1c2fdf1f7be4e6b9f7bcd9aa5e95340d Mon Sep 17 00:00:00 2001 From: idgay Date: Mon, 20 Aug 2007 23:50:04 +0000 Subject: [PATCH] reformat comment that got destroyed --- .../java/net/tinyos/packet/Packetizer.java | 52 ++++++++++++------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/support/sdk/java/net/tinyos/packet/Packetizer.java b/support/sdk/java/net/tinyos/packet/Packetizer.java index 0c5d4879..7c9d7e64 100644 --- a/support/sdk/java/net/tinyos/packet/Packetizer.java +++ b/support/sdk/java/net/tinyos/packet/Packetizer.java @@ -42,29 +42,43 @@ import java.nio.*; */ public class Packetizer extends AbstractSource implements Runnable { /* - * Protocol inspired by, but not identical to, RFC 1663. There is currently no - * protocol establishment phase, and a single byte ("packet type") to identify - * the kind/target/etc of each packet. + * Protocol inspired by, but not identical to, RFC 1663. There is + * currently no protocol establishment phase, and a single byte + * ("packet type") to identify the kind/target/etc of each packet. * * The protocol is really, really not aiming for high performance. * - * There is however a hook for future extensions: implementations are required - * to answer all unknown packet types with a P_UNKNOWN packet. + * There is however a hook for future extensions: implementations + * are required to answer all unknown packet types with a P_UNKNOWN + * packet. * - * To summarise the protocol: - the two sides (A & B) are connected by a - * (potentially unreliable) byte stream - the two sides exchange packets - * framed by 0x7e (SYNC_BYTE) bytes - each packet has the form - * <16-bit crc> where the crc (see net.tinyos.util.Crc) - * covers the packet type and bytes 1..n - bytes can be escaped by preceding - * them with 0x7d and their value xored with 0x20; 0x7d and 0x7e bytes must be - * escaped, 0x00 - 0x1f and 0x80-0x9f may be optionally escaped - There are - * currently 5 packet types: P_PACKET_NO_ACK: A user-packet, with no ack - * required P_PACKET_ACK: A user-packet with a prefix byte, ack required. The - * receiver must send a P_ACK packet with the prefix byte as its contents. - * P_ACK: ack for a previous P_PACKET_ACK packet P_UNKNOWN: unknown packet - * type received. On reception of an unknown packet type, the receicer must - * send a P_UNKNOWN packet, the first byte must be the unknown packet type. - - * Packets that are greater than a (private) MTU are silently dropped. + * To summarise the protocol: + * - the two sides (A & B) are connected by a (potentially + * unreliable) byte stream + * + * - the two sides exchange packets framed by 0x7e (SYNC_BYTE) bytes + * + * - each packet has the form + * <16-bit crc> + * where the crc (see net.tinyos.util.Crc) covers the packet type + * and bytes 1..n + * + * - bytes can be escaped by preceding them with 0x7d and their + * value xored with 0x20; 0x7d and 0x7e bytes must be escaped, + * 0x00 - 0x1f and 0x80-0x9f may be optionally escaped + * + * - There are currently 5 packet types: + * P_PACKET_NO_ACK: A user-packet, with no ack required + * P_PACKET_ACK: A user-packet with a prefix byte, ack + * required. The receiver must send a P_ACK packet with the + * prefix byte as its contents. + * P_ACK: ack for a previous P_PACKET_ACK packet + * P_UNKNOWN: unknown packet type received. On reception of an + * unknown packet type, the receicer must send a P_UNKNOWN packet, + * the first byte must be the unknown packet type. + * + * - Packets that are greater than a (private) MTU are silently + * dropped. */ final static boolean DEBUG = false; -- 2.39.2