RadioLib
Universal wireless communication library for Arduino
PagerClient Class Reference

Client for Pager communication. More...

#include <Pager.h>

Public Member Functions

 PagerClient (PhysicalLayer *phy)
 Default constructor. More...
 
int16_t begin (float base, uint16_t speed, bool invert=false, uint16_t shift=RADIOLIB_PAGER_FREQ_SHIFT_HZ)
 Initialization method. More...
 
int16_t sendTone (uint32_t addr)
 Method to send a tone-only alert to a destination pager. More...
 
int16_t transmit (const char *str, uint32_t addr, uint8_t encoding=RADIOLIB_PAGER_BCD, uint8_t function=RADIOLIB_PAGER_FUNC_AUTO)
 C-string transmit method. More...
 
int16_t transmit (uint8_t *data, size_t len, uint32_t addr, uint8_t encoding=RADIOLIB_PAGER_BCD, uint8_t function=RADIOLIB_PAGER_FUNC_AUTO)
 Binary transmit method. Will transmit arbitrary binary data. More...
 
int16_t startReceive (uint32_t pin, uint32_t addr, uint32_t mask=0xFFFFF)
 Start reception of POCSAG packets. More...
 
int16_t startReceive (uint32_t pin, uint32_t *addrs, uint32_t *masks, size_t numAddress)
 Start reception of POCSAG packets for multiple addresses and masks. More...
 
size_t available ()
 Get the number of POCSAG batches available in buffer. Limited by the size of direct mode buffer! More...
 
int16_t readData (uint8_t *data, size_t *len, uint32_t *addr=NULL)
 Reads data that was received after calling startReceive method. More...
 

Detailed Description

Client for Pager communication.

Constructor & Destructor Documentation

◆ PagerClient()

PagerClient::PagerClient ( PhysicalLayer phy)
explicit

Default constructor.

Parameters
phyPointer to the wireless module providing PhysicalLayer communication.

Member Function Documentation

◆ available()

size_t PagerClient::available ( )

Get the number of POCSAG batches available in buffer. Limited by the size of direct mode buffer!

Returns
Number of available batches.

◆ begin()

int16_t PagerClient::begin ( float  base,
uint16_t  speed,
bool  invert = false,
uint16_t  shift = RADIOLIB_PAGER_FREQ_SHIFT_HZ 
)

Initialization method.

Parameters
baseBase (center) frequency to be used in MHz.
speedBit rate to use in bps. Common POCSAG decoders can receive 512, 1200 and 2400 bps.
invertEnable frequency inversion. Disabled by default (high frequency is digital 0).
shiftSet custom frequency shift, defaults to 4500 Hz.
Returns
Status Codes

◆ readData()

int16_t PagerClient::readData ( uint8_t *  data,
size_t *  len,
uint32_t *  addr = NULL 
)

Reads data that was received after calling startReceive method.

Parameters
dataPointer to array to save the received message.
lenPointer to variable holding the number of bytes that will be read. When set to 0, the packet length will be retrieved automatically. When more bytes than received are requested, only the number of bytes requested will be returned. Upon completion, the number of bytes received will be written to this variable.
addrPointer to variable holding the address of the received pager message. Set to NULL to not retrieve address.
Returns
Status Codes

◆ sendTone()

int16_t PagerClient::sendTone ( uint32_t  addr)

Method to send a tone-only alert to a destination pager.

Parameters
addrAddress of the destination pager. Allowed values are 0 to 2097151 - values above 2000000 are reserved.
Returns
Status Codes

◆ startReceive() [1/2]

int16_t PagerClient::startReceive ( uint32_t  pin,
uint32_t *  addrs,
uint32_t *  masks,
size_t  numAddress 
)

Start reception of POCSAG packets for multiple addresses and masks.

Parameters
pinPin to receive digital data on (e.g., DIO2 for SX127x).
addrsArray of addresses to receive.
masksArray of address masks to use for filtering. Masks will be applied to corresponding addresses in addr array.
numAddressNumber of addresses/masks to match.
Returns
Status Codes

◆ startReceive() [2/2]

int16_t PagerClient::startReceive ( uint32_t  pin,
uint32_t  addr,
uint32_t  mask = 0xFFFFF 
)

Start reception of POCSAG packets.

Parameters
pinPin to receive digital data on (e.g., DIO2 for SX127x).
addrAddress of this "pager". Allowed values are 0 to 2097151 - values above 2000000 are reserved.
maskAddress filter mask - set individual bits to enable or disable match on that bit of the address. Set to 0xFFFFF (all bits checked) by default.
Returns
Status Codes

◆ transmit() [1/2]

int16_t PagerClient::transmit ( const char *  str,
uint32_t  addr,
uint8_t  encoding = RADIOLIB_PAGER_BCD,
uint8_t  function = RADIOLIB_PAGER_FUNC_AUTO 
)

C-string transmit method.

Parameters
strC-string that will be transmitted.
addrAddress of the destination pager. Allowed values are 0 to 2097151 - values above 2000000 are reserved.
encodingEncoding to be used (BCD or ASCII). Defaults to RADIOLIB_PAGER_BCD.
functionbits (NUMERIC, TONE, ACTIVATION, ALPHANUMERIC). Allowed values 0 to 3. Defaults to auto select by specified encoding
Returns
Status Codes

◆ transmit() [2/2]

int16_t PagerClient::transmit ( uint8_t *  data,
size_t  len,
uint32_t  addr,
uint8_t  encoding = RADIOLIB_PAGER_BCD,
uint8_t  function = RADIOLIB_PAGER_FUNC_AUTO 
)

Binary transmit method. Will transmit arbitrary binary data.

Parameters
dataBinary data that will be transmitted.
lenLength of binary data to transmit (in bytes).
addrAddress of the destination pager. Allowed values are 0 to 2097151 - values above 2000000 are reserved.
encodingEncoding to be used (BCD or ASCII). Defaults to RADIOLIB_PAGER_BCD.
functionbits (NUMERIC, TONE, ACTIVATION, ALPHANUMERIC). Allowed values 0 to 3. Defaults to auto select by specified encoding
Returns
Status Codes

The documentation for this class was generated from the following files: