public static enum SerialComManager.PARITY extends Enum<SerialComManager.PARITY>
Pre-defined enum constants for enabling type of parity in a serial frame.
| Enum Constant and Description |
|---|
P_EVEN
The number of bits in the frame with the value one is even.
|
P_MARK
The parity bit is set to the mark signal condition (logical 1).
|
P_NONE
The uart frame does not contain any parity bit.
|
P_ODD
The number of bits in the frame with the value one is odd.
|
P_SPACE
The parity bit is set to the space signal condition (logical 0).
|
| Modifier and Type | Method and Description |
|---|---|
int |
getValue() |
static SerialComManager.PARITY |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SerialComManager.PARITY[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SerialComManager.PARITY P_NONE
public static final SerialComManager.PARITY P_ODD
The number of bits in the frame with the value one is odd. If the sum of bits with a value of 1 is odd in the frame, the parity bit's value is set to zero. If the sum of bits with a value of 1 is even in the frame, the parity bit value is set to 1, making the total count of 1's in the frame an odd number.
public static final SerialComManager.PARITY P_EVEN
The number of bits in the frame with the value one is even. The number of bits whose value is 1 in a frame is counted. If that total is odd, the parity bit value is set to 1, making the total count of 1's in the frame an even number. If the count of ones in a frame a is already even, the parity bit's value remains 0.
Odd parity may be more fruitful since it ensures that at least one state transition occurs in each character, which makes it more reliable as compared even parity.
Even parity is a special case of a cyclic redundancy check (CRC), where the 1-bit CRC is generated by the polynomial x+1.
public static final SerialComManager.PARITY P_MARK
The parity bit is set to the mark signal condition (logical 1). An application may use the 9th (parity) bit for some form of addressing or special signaling.
public static final SerialComManager.PARITY P_SPACE
The parity bit is set to the space signal condition (logical 0). The mark and space parity is uncommon, as it adds no error detection information.
public static SerialComManager.PARITY[] values()
for (SerialComManager.PARITY c : SerialComManager.PARITY.values()) System.out.println(c);
public static SerialComManager.PARITY valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic int getValue()
Copyright © 2016. All rights reserved.