Package jpigpio.packet
Class Protocol
java.lang.Object
jpigpio.packet.Protocol
public class Protocol
extends java.lang.Object
Class defining properties of RF communication signaling.
-
Field Summary
Fields Modifier and Type Field Description intDATA_SIZEdatagram data size (in bytes)booleanDGRM_KEEP_ON_ENCODING_ERRORSet this to False to discard datagrams where encoding error was detected.intDGRM_LENGTHdatagram length in bytes (always double of DATA_SIZE because datagrams are constructed out of nibbles (4bit))intDGRM_REPEATintDGRM_REPEAT_RXreport this many same datagrams as a single datagram (eliminate duplicates)intDGRM_REPEAT_TXrepeat transmission of each datagram this many times to make sure at least one got throughintDGRM_RX_TIMEOUTintRX_PULSE_MSGGAPgap between datagrams (microsec)intRX_PULSE_ONEshort pulse = 1 (one) (microsec)intRX_PULSE_TOOSHORTpulse too short to be considered meaningful (microsec)intRX_PULSE_ZEROlong pulse = 0 (zero) (microsec)int[]SYMBOLintTX_PULSE_HIGHduration of high pulse (microsec)intTX_PULSE_LOWduration of low pulse (microsec)intTX_PULSE_MSGGAPgap between two datagrams (microsec) -
Constructor Summary
Constructors Constructor Description Protocol() -
Method Summary
Modifier and Type Method Description intnibble2sym(int nibble)voidsetDataSize(int size)Set maximum transmitted datagram size in bytes.voidsetRepeatCount(int repeatCount)Set transmission repeat count.voidsetRxRepeatCount(int rxRepeatCount)voidsetTxRepeatCount(int txRepeatCount)intsym2nibble(int symbol)
-
Field Details
-
DATA_SIZE
public int DATA_SIZEdatagram data size (in bytes) -
DGRM_LENGTH
public int DGRM_LENGTHdatagram length in bytes (always double of DATA_SIZE because datagrams are constructed out of nibbles (4bit)) -
DGRM_REPEAT
public int DGRM_REPEAT -
DGRM_REPEAT_TX
public int DGRM_REPEAT_TXrepeat transmission of each datagram this many times to make sure at least one got through -
DGRM_REPEAT_RX
public int DGRM_REPEAT_RXreport this many same datagrams as a single datagram (eliminate duplicates) -
DGRM_RX_TIMEOUT
public int DGRM_RX_TIMEOUT -
DGRM_KEEP_ON_ENCODING_ERROR
public boolean DGRM_KEEP_ON_ENCODING_ERRORSet this to False to discard datagrams where encoding error was detected. Under normal operation it makes no sense to keep such datagrams. -
TX_PULSE_MSGGAP
public int TX_PULSE_MSGGAPgap between two datagrams (microsec) -
TX_PULSE_HIGH
public int TX_PULSE_HIGHduration of high pulse (microsec) -
TX_PULSE_LOW
public int TX_PULSE_LOWduration of low pulse (microsec) -
RX_PULSE_TOOSHORT
public int RX_PULSE_TOOSHORTpulse too short to be considered meaningful (microsec) -
RX_PULSE_ONE
public int RX_PULSE_ONEshort pulse = 1 (one) (microsec) -
RX_PULSE_ZERO
public int RX_PULSE_ZEROlong pulse = 0 (zero) (microsec) -
RX_PULSE_MSGGAP
public int RX_PULSE_MSGGAPgap between datagrams (microsec) -
SYMBOL
public int[] SYMBOL
-
-
Constructor Details
-
Protocol
public Protocol()
-
-
Method Details
-
sym2nibble
public int sym2nibble(int symbol) -
nibble2sym
public int nibble2sym(int nibble) -
setDataSize
public void setDataSize(int size)Set maximum transmitted datagram size in bytes.- Parameters:
size- size in bytes
-
setRepeatCount
public void setRepeatCount(int repeatCount)Set transmission repeat count. By repeating transmission multiple times you are increasing probability to receive data on the other end. This also sets receiver repeat count - eliminating duplicate datagrams caused by repetitive transmissions.- Parameters:
repeatCount- Count how many times datagram is going to be transmitted.
-
setRxRepeatCount
public void setRxRepeatCount(int rxRepeatCount) -
setTxRepeatCount
public void setTxRepeatCount(int txRepeatCount)
-