pfodParser 5.0.1 The pfodParser library is handles commands sent from the Android pfodApp, pfodApp supports WiFi, BLE, Bluetooth and SMS connections

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pfodRadio Class Reference

An ack consists of a message with: More...

`#include <pfodRadio.h>`

Inherits pfod_Base.

## Public Member Functions
| pfodRadio (pfodRadioDriver *_driver, uint8_t _thisAddress)
void | setDebugStream (Print *_debugOut)
void | debugPfodRadioMsg (pfodRadioMsg *msg)
void | connectTo (uint8_t _to)
void | listen ()
void | setAckTimeout (uint16_t _timeout_mS)
void | setNoOfRetries (uint8_t _noOfRetries)
void | setMaxWriteBufLen (size_t _maxLen)
bool | recvMsg ()
bool | isNewMsg ()
bool | isAckForLastMsgSent ()
size_t | sendMsg ()
bool | isConnectionClosed ()
uint16_t | getLastRSSI ()
bool | notInTxMode ()
bool | inTxMode ()
pfodRadioMsg * | getReceivedMsg ()
void | sendAck ()
uint8_t | getThisAddress ()
bool | isServer ()
bool | init ()
int | available ()
int | peek ()
int | read ()
void | flush ()
size_t | write (uint8_t b)
unsigned long | getDefaultTimeOut ()
void | _closeCurrentConnection ()
size_t | writeRawData (uint8_t c)
Print * | getRawDataOutput ()
Public Member Functions inherited from pfod_Base
virtual bool | connect ()
virtual void | _setLinkTimeout (unsigned long _linkTimeout_mS)

## Protected Member Functions
bool | sendTo (uint8_t *_buf, uint8_t _len, uint8_t _address)
void | sendMsg (pfodRadioMsg *radioMsg)
void | pollRadio ()
void | clearTxRxBuffers ()
void | checkIfNeedToConnect ()
void | resendLastMsg ()
bool | isNewConnectionRequest ()
uint16_t | getRandomTimeout ()
void | setTimeLastMsgSent ()
void | checkForAllowableNewConnection ()
void | closeConnection ()

## Protected Attributes
pfodRadioMsg | receivedMsg
pfodRadioMsg | lastMsgSent
bool | waitingForAckOfLastMsgSent
unsigned long | timeLastMsgSent
bool | connectionClosed
Print * | debugOut

## Detailed Description

An ack consists of a message with:

- TO set to the from address of the original message
- FROM set to this node address
- ID set to the ID of the original message
- FLAGS with the RH_FLAGS_ACK bit set
- 1 octet of payload containing ASCII '!' (since some drivers cannot handle 0 length payloads)

Definition at line 36 of file pfodRadio.h.

## Constructor & Destructor Documentation

## ◆ pfodRadio()

pfodRadio::pfodRadio | ( | pfodRadioDriver * | _driver,
|  | uint8_t | _thisAddress
| ) |  |

## Member Function Documentation

## ◆ _closeCurrentConnection()

void pfodRadio::_closeCurrentConnection | ( |  | ) |
| virtual

Implements pfod_Base.

## ◆ available()

int pfodRadio::available | ( |  | ) |
| virtual

Reimplemented from pfod_Base.

## ◆ checkForAllowableNewConnection()

void pfodRadio::checkForAllowableNewConnection | ( |  | ) |
| protected

## ◆ checkIfNeedToConnect()

void pfodRadio::checkIfNeedToConnect | ( |  | ) |
| protected

## ◆ clearTxRxBuffers()

void pfodRadio::clearTxRxBuffers | ( |  | ) |
| protected

## ◆ closeConnection()

void pfodRadio::closeConnection | ( |  | ) |
| protected

## ◆ connectTo()

void pfodRadio::connectTo | ( | uint8_t | _to | ) |

## ◆ debugPfodRadioMsg()

void pfodRadio::debugPfodRadioMsg | ( | pfodRadioMsg * | msg | ) |

## ◆ flush()

void pfodRadio::flush | ( |  | ) |
| virtual

Reimplemented from pfod_Base.

## ◆ getDefaultTimeOut()

unsigned long pfodRadio::getDefaultTimeOut | ( |  | ) |
| virtual

Implements pfod_Base.

## ◆ getLastRSSI()

uint16_t pfodRadio::getLastRSSI | ( |  | ) |

## ◆ getRandomTimeout()

uint16_t pfodRadio::getRandomTimeout | ( |  | ) |
| protected

## ◆ getRawDataOutput()

Print* pfodRadio::getRawDataOutput | ( |  | ) |
| virtual

Implements pfod_Base.

## ◆ getReceivedMsg()

pfodRadioMsg* pfodRadio::getReceivedMsg | ( |  | ) |

## ◆ getThisAddress()

uint8_t pfodRadio::getThisAddress | ( |  | ) |

## ◆ init()

bool pfodRadio::init | ( |  | ) |

## ◆ inTxMode()

bool pfodRadio::inTxMode | ( |  | ) |

## ◆ isAckForLastMsgSent()

bool pfodRadio::isAckForLastMsgSent | ( |  | ) |

## ◆ isConnectionClosed()

bool pfodRadio::isConnectionClosed | ( |  | ) |

## ◆ isNewConnectionRequest()

bool pfodRadio::isNewConnectionRequest | ( |  | ) |
| protected

## ◆ isNewMsg()

bool pfodRadio::isNewMsg | ( |  | ) |

## ◆ isServer()

bool pfodRadio::isServer | ( |  | ) |

## ◆ listen()

void pfodRadio::listen | ( |  | ) |

## ◆ notInTxMode()

bool pfodRadio::notInTxMode | ( |  | ) |

## ◆ peek()

int pfodRadio::peek | ( |  | ) |
| virtual

Reimplemented from pfod_Base.

## ◆ pollRadio()

void pfodRadio::pollRadio | ( |  | ) |
| protected

## ◆ read()

int pfodRadio::read | ( |  | ) |
| virtual

Implements pfod_Base.

## ◆ recvMsg()

bool pfodRadio::recvMsg | ( |  | ) |

## ◆ resendLastMsg()

void pfodRadio::resendLastMsg | ( |  | ) |
| protected

## ◆ sendAck()

void pfodRadio::sendAck | ( |  | ) |

## ◆ sendMsg() [1/2]

size_t pfodRadio::sendMsg | ( |  | ) |

## ◆ sendMsg() [2/2]

void pfodRadio::sendMsg | ( | pfodRadioMsg * | radioMsg | ) |
| protected

## ◆ sendTo()

bool pfodRadio::sendTo | ( | uint8_t * | _buf,
|  | uint8_t | _len,
|  | uint8_t | _address
| ) |  |
| protected

## ◆ setAckTimeout()

void pfodRadio::setAckTimeout | ( | uint16_t | _timeout_mS | ) |

## ◆ setDebugStream()

void pfodRadio::setDebugStream | ( | Print * | _debugOut | ) |
| virtual

Reimplemented from pfod_Base.

## ◆ setMaxWriteBufLen()

void pfodRadio::setMaxWriteBufLen | ( | size_t | _maxLen | ) |

## ◆ setNoOfRetries()

void pfodRadio::setNoOfRetries | ( | uint8_t | _noOfRetries | ) |

## ◆ setTimeLastMsgSent()

void pfodRadio::setTimeLastMsgSent | ( |  | ) |
| protected

## ◆ write()

size_t pfodRadio::write | ( | uint8_t | b | ) |
| virtual

Reimplemented from pfod_Base.

## ◆ writeRawData()

size_t pfodRadio::writeRawData | ( | uint8_t | c | ) |
| virtual

Implements pfod_Base.

## Member Data Documentation

## ◆ connectionClosed

bool pfodRadio::connectionClosed
| protected

Definition at line 98 of file pfodRadio.h.

## ◆ debugOut

Print* pfodRadio::debugOut
| protected

Definition at line 104 of file pfodRadio.h.

## ◆ lastMsgSent

pfodRadioMsg pfodRadio::lastMsgSent
| protected

Definition at line 92 of file pfodRadio.h.

## ◆ receivedMsg

pfodRadioMsg pfodRadio::receivedMsg
| protected

Definition at line 91 of file pfodRadio.h.

## ◆ timeLastMsgSent

unsigned long pfodRadio::timeLastMsgSent
| protected

Definition at line 97 of file pfodRadio.h.

## ◆ waitingForAckOfLastMsgSent

bool pfodRadio::waitingForAckOfLastMsgSent
| protected

Definition at line 96 of file pfodRadio.h.