# RadioLib: PagerClient Class Reference

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

  phy | Pointer 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

  base | Base (center) frequency to be used in MHz.
  speed | Bit rate to use in bps. Common POCSAG decoders can receive 512, 1200 and 2400 bps.
  invert | Enable frequency inversion. Disabled by default (high frequency is digital 0).
  shift | Set 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

  data | Pointer to array to save the received message.
  len | Pointer 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.
  addr | Pointer 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

  addr | Address 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

  pin | Pin to receive digital data on (e.g., DIO2 for SX127x).
  addrs | Array of addresses to receive.
  masks | Array of address masks to use for filtering. Masks will be applied to corresponding addresses in addr array.
  numAddress | Number 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

  pin | Pin to receive digital data on (e.g., DIO2 for SX127x).
  addr | Address of this "pager". Allowed values are 0 to 2097151 - values above 2000000 are reserved.
  mask | Address 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

  str | C-string that will be transmitted.
  addr | Address of the destination pager. Allowed values are 0 to 2097151 - values above 2000000 are reserved.
  encoding | Encoding to be used (BCD or ASCII). Defaults to RADIOLIB_PAGER_BCD.
  function | bits (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

  data | Binary data that will be transmitted.
  len | Length of binary data to transmit (in bytes).
  addr | Address of the destination pager. Allowed values are 0 to 2097151 - values above 2000000 are reserved.
  encoding | Encoding to be used (BCD or ASCII). Defaults to RADIOLIB_PAGER_BCD.
  function | bits (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:

- src/protocols/Pager/Pager.h
- src/protocols/Pager/Pager.cpp