#include <link.h>
|
| | Link (const char *fname, int baud, NCP *ncp, bool noDSRCheck, unsigned short verbose, const int cancellationFd) |
| | Construct a new link instance.
|
| |
| | ~Link () |
| | Disconnects from device and destroys instance.
|
| |
| void | send (const BufferStore &buff) |
| | Send a PLP packet to the Peer.
|
| |
| bool | stuffToSend () |
| | Query outstanding packets.
|
| |
| bool | hasFailed () |
| | Query connection failure.
|
| |
| void | reset () |
| | Reset connection and attempt to reconnect to the peer.
|
| |
| void | purgeQueue (int channel) |
| | Purge all outstanding packets for a specified remote channel.
|
| |
| Enum< link_type > | getLinkType () |
| | Get the current link type.
|
| |
| int | getSpeed () |
| | Get current speed of the serial device.
|
| |
Definition at line 62 of file link.h.
◆ link_type
| Enumerator |
|---|
| LINK_TYPE_UNKNOWN | |
| LINK_TYPE_SIBO | |
| LINK_TYPE_EPOC | |
Definition at line 65 of file link.h.
◆ Link()
| Link::Link |
( |
const char * | fname, |
|
|
int | baud, |
|
|
NCP * | ncp, |
|
|
bool | noDSRCheck, |
|
|
unsigned short | verbose, |
|
|
const int | cancellationFd ) |
Construct a new link instance.
- Parameters
-
| fname | Name of serial device. |
| baud | Speed of serial device. |
| ncp | The calling NCP instance. |
| noDSRCheck | Disable checking DSR (for buggy serial drivers) |
| verbose | Verbosity (for debugging/troubleshooting) |
| cancellationFd | File descriptor that can be used to signal that the Link should shutdown. |
Definition at line 87 of file link.cc.
◆ ~Link()
Disconnects from device and destroys instance.
Definition at line 108 of file link.cc.
◆ getLinkType()
Get the current link type.
- Returns
- One of LINK_TYPE_... values.
Definition at line 658 of file link.cc.
◆ getSpeed()
Get current speed of the serial device.
- Returns
- The current speed in baud.
Definition at line 662 of file link.cc.
◆ hasFailed()
Query connection failure.
- Returns
- true, if the peer could not be contacted or did not response, false if everything is ok.
Definition at line 648 of file link.cc.
◆ multiAck()
| void Link::multiAck |
( |
struct timeval | refstamp | ) |
|
|
private |
◆ purgeAllQueues()
| void Link::purgeAllQueues |
( |
| ) |
|
|
private |
◆ purgeQueue()
| void Link::purgeQueue |
( |
int | channel | ) |
|
Purge all outstanding packets for a specified remote channel.
- Parameters
-
| channel | The of the channel for which to remove outstanding packets. |
Definition at line 148 of file link.cc.
◆ receive()
Effectively a delegate method that accepts data from our DataLink instance.
Called on the DataLink's internal thread.
Definition at line 233 of file link.cc.
◆ reset()
Reset connection and attempt to reconnect to the peer.
Definition at line 118 of file link.cc.
◆ retransmit()
| void Link::retransmit |
( |
| ) |
|
|
private |
◆ retransTimeout()
| unsigned long Link::retransTimeout |
( |
| ) |
|
|
private |
◆ send()
Send a PLP packet to the Peer.
- Parameters
-
| buff | The contents of the PLP packet. |
Definition at line 133 of file link.cc.
◆ sendAck()
◆ sendReq()
◆ sendReqCon()
| void Link::sendReqCon |
( |
| ) |
|
|
private |
◆ sendReqReq()
| void Link::sendReqReq |
( |
| ) |
|
|
private |
◆ stuffToSend()
| bool Link::stuffToSend |
( |
| ) |
|
Query outstanding packets.
- Returns
- true, if packets are outstanding (not yet acknowledged), false otherwise.
Definition at line 640 of file link.cc.
◆ transmit()
◆ transmitHoldQueue()
| void Link::transmitHoldQueue |
( |
int | channel | ) |
|
|
private |
◆ transmitWaitQueue()
| void Link::transmitWaitQueue |
( |
| ) |
|
|
private |
◆ DataLink
◆ expire_check
| void * expire_check |
( |
void * | arg | ) |
|
|
friend |
◆ ackWaitQueue
◆ cancellationFd_
| const int Link::cancellationFd_ |
|
private |
Used to signal cancellation.
Should never be read.
Definition at line 184 of file link.h.
◆ checkThreadId_
| pthread_t Link::checkThreadId_ |
|
private |
◆ conMagic_
| unsigned long Link::conMagic_ |
|
private |
◆ dataLink_
◆ failed_
◆ holdQueue_
◆ linkType_
◆ maxOutstanding_
| int Link::maxOutstanding_ = 1 |
|
private |
◆ ncp_
◆ queueMutex_
| pthread_mutex_t Link::queueMutex_ |
|
private |
◆ rxSequence_
| int Link::rxSequence_ = -1 |
|
private |
◆ seqMask_
◆ txSequence_
| int Link::txSequence_ = 1 |
|
private |
◆ verbose_
| const unsigned short Link::verbose_ |
|
private |
◆ waitQueue_
◆ xoff_
The documentation for this class was generated from the following files: