Package jpigpio.packet
Class Rf433rx
java.lang.Object
jpigpio.packet.Rf433rx
public class Rf433rx
extends java.lang.Object
Class implementing RF 433 MHz communication receiver (e.g. XD-RF-5V).
It implements NotificationReceiver which is decoding pulses based on preset Protocol
(you can tweak signalling by creating your own Protocol). NotificationListener is plugged
to PigpioSocket NotificationRouter, receiving every notification received from pigpiod daemon.
Received datagrams can be accessed via method get()
Work is based on Robert Tidey LightwaveRF code https://github.com/roberttidey/LightwaveRF
Work is based on Robert Tidey LightwaveRF code https://github.com/roberttidey/LightwaveRF
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description int
available()
Returns number of packets available for pickupint
byteErrorCount()
Simple statistics of byte errors detected while receiving datagrams.int
datagramErrorCount()
Simple statistics returning number of errors in datagrams.byte[]
get()
Get one packet from available packets.void
setCallback(NotificationListener notificationListener)
void
terminate()
Terminate receiving thread, cancel further notifications from pigpiod.
-
Constructor Details
-
Rf433rx
- Throws:
PigpioException
-
-
Method Details
-
setCallback
- Throws:
PigpioException
-
get
public byte[] get() throws java.lang.IndexOutOfBoundsExceptionGet one packet from available packets. Check if there are packets available before calling this method.- Returns:
- Datagram. IMPORTANT: Datagram contains nibbles 4bit) stored in bytes.
- Throws:
java.lang.IndexOutOfBoundsException
- if there is no datagram available
-
available
public int available()Returns number of packets available for pickup- Returns:
- Number of datagrams available.
-
terminate
Terminate receiving thread, cancel further notifications from pigpiod.- Throws:
PigpioException
- on pigpiod error
-
byteErrorCount
public int byteErrorCount()Simple statistics of byte errors detected while receiving datagrams. High number of errors might mean low signal strength or too long datagrams.- Returns:
- byte error count
-
datagramErrorCount
public int datagramErrorCount()Simple statistics returning number of errors in datagrams.- Returns:
- number of errors in datagrams.
-