#include <DCDT_Channel_Serial.h>
Inheritance diagram for DCDT_Channel_Serial:
Public Member Functions | |
DCDT_Channel_Serial (int AgoraID) | |
void | Open (int link_status=0) |
Try to open a serial device. | |
void | Reopen (int link_status) |
void | Prepare (CommData *local, CommData *remote) |
Prepare channel's data structure. | |
void | StaticPrepare (unsigned int prof, char *dev) |
Prepare static channel's data structure, open a FD. | |
void | ChooseChannel (int channel) |
void | WaitConn () |
Method called when the link is in WAITING state. | |
void | StartConn () |
Method called when the link is in CONNECTING state. | |
void | Send (const DCDT_Msg *msg) |
Send a message. | |
void | SendNotify () |
Send an HS_NOTIFY message. | |
void | SendAnswer (CommData *to, CommData *local) |
Send an HS_ANSWER message then stop the channel. | |
DCDT_Msg * | Receive () |
Receive a message using the channel settings. | |
void | ReceiveHS (HSMsgHeader *&header, CommData *&remote) |
Receive an handshake message. | |
void | Dispose () |
void | Close () |
void | KeepAlive () |
CommData * | GetStartingCD () |
unsigned int | ReadStartingProfile () |
CommData * | GetCommData () |
void | SetTimers () |
void | SetLostTimer (int usec) |
void | LostTimerOn () |
void | LostTimerOff () |
void | SetConnTimer (int usec) |
void | ConnTimerOn () |
void | ConnTimerOff () |
void | SetSendTimer (int usec) |
void | SendTimerOn () |
void | SendTimerOff () |
void | UnblockSend () |
void | SetReceiveTimer (int usec) |
void | ReceiveTimerOn () |
void | ReceiveTimerOff () |
void | UnblockReceive () |
void | Restart (int link_status) |
void | Stop () |
Private Attributes | |
int | device |
int | status |
CommData_Serial * | localCD |
termios | options |
int | trecv_flag |
Flag: = 1 -> use timer when receiving. | |
int | tlost_flag |
Flag: = 1 -> use timer when communicating. | |
int | unblock_recv_flag |
Flag: = 1 -> use no blocking calls when receiving. | |
timeval trecv_value | tlost_value |
Communication timeout. | |
char | device_name [UNIX_PATH_MAX] |
unsigned int | profile |
bool | dynamic |
Flag: 1 -> dynamic channel; != 1 -> static channel. |
|
Definition at line 47 of file DCDT_Channel_Serial.h. References device, localCD, status, tlost_flag, tlost_value, trecv_flag, and unblock_recv_flag. |
|
Implements DCDT_Channel. Definition at line 58 of file DCDT_Channel_Serial.h. |
|
Implements DCDT_Channel. Definition at line 613 of file DCDT_Channel_Serial.h. References device. |
|
Implements DCDT_Channel. Definition at line 654 of file DCDT_Channel_Serial.h. |
|
Implements DCDT_Channel. Definition at line 650 of file DCDT_Channel_Serial.h. |
|
Implements DCDT_Channel. Definition at line 609 of file DCDT_Channel_Serial.h. |
|
Implements DCDT_Channel. Definition at line 209 of file DCDT_Channel_Serial.h. |
|
Returns an heap memory area of wich is no more responsible Implements DCDT_Channel. Definition at line 587 of file DCDT_Channel_Serial.h. References device_name. |
|
Implements DCDT_Channel. Definition at line 68 of file DCDT_Channel_Serial.h. |
|
Implements DCDT_Channel. Definition at line 640 of file DCDT_Channel_Serial.h. References tlost_flag. |
|
Implements DCDT_Channel. Definition at line 635 of file DCDT_Channel_Serial.h. References tlost_flag. Referenced by SetTimers(), and StaticPrepare(). |
|
Try to open a serial device.
Implements DCDT_Channel. Definition at line 183 of file DCDT_Channel_Serial.h. References BAUDRATE, DCDT_TRC_COMM, device, CommData_Serial::device_name, localCD, options, and TRC_PRINT. Referenced by Reopen(), Restart(), and StaticPrepare(). |
|
Prepare channel's data structure.
Implements DCDT_Channel. Definition at line 146 of file DCDT_Channel_Serial.h. References DCDT_TRC_COMM, device_name, CommData_Serial::device_name, localCD, and TRC_PRINT. |
|
Implements DCDT_Channel. Definition at line 593 of file DCDT_Channel_Serial.h. |
|
Receive a message using the channel settings.
Implements DCDT_Channel. Definition at line 234 of file DCDT_Channel_Serial.h. References DCDT_MsgHeader, DCDT_TRC_COMM, device, DCDT_Msg::ReadPayloadLen(), DCDT_Msg::SetPayload(), tlost_value, and TRC_PRINT. |
|
Receive an handshake message. When an HS_ANSWER message was received close and reopen the channel.
Implements DCDT_Channel. Definition at line 378 of file DCDT_Channel_Serial.h. References DCDT_TRC_COMM, device, device_name, HSMsgHeader, Stop(), tlost_value, TRC_PRINT, and _HSMsgHeader::type. Referenced by StartConn(), and WaitConn(). |
|
Implements DCDT_Channel. Definition at line 687 of file DCDT_Channel_Serial.h. References trecv_flag. Referenced by StartConn(), and WaitConn(). |
|
Implements DCDT_Channel. Definition at line 681 of file DCDT_Channel_Serial.h. References trecv_flag, and unblock_recv_flag. Referenced by SetTimers(), and StaticPrepare(). |
|
Implements DCDT_Channel. Definition at line 204 of file DCDT_Channel_Serial.h. References Open(). |
|
Implements DCDT_Channel. Definition at line 697 of file DCDT_Channel_Serial.h. References Open(). |
|
Send a message.
Implements DCDT_Channel. Definition at line 471 of file DCDT_Channel_Serial.h. References DCDT_TRC_COMM, device, DCDT_Msg::GetHeader(), DCDT_Msg::GetPayload(), DCDT_Msg::ReadPayloadLen(), tlost_value, and TRC_PRINT. |
|
Send an HS_ANSWER message then stop the channel.
Implements DCDT_Channel. Definition at line 563 of file DCDT_Channel_Serial.h. References DCDT_TRC_COMM, device, Stop(), and TRC_PRINT. |
|
Send an HS_NOTIFY message.
Implements DCDT_Channel. Definition at line 538 of file DCDT_Channel_Serial.h. References DCDT_TRC_COMM, device, and TRC_PRINT. Referenced by StartConn(), and WaitConn(). |
|
Implements DCDT_Channel. Definition at line 667 of file DCDT_Channel_Serial.h. |
|
Implements DCDT_Channel. Definition at line 663 of file DCDT_Channel_Serial.h. |
|
Implements DCDT_Channel. Definition at line 645 of file DCDT_Channel_Serial.h. |
|
Implements DCDT_Channel. Definition at line 629 of file DCDT_Channel_Serial.h. References tlost_value. Referenced by SetTimers(), and StaticPrepare(). |
|
Implements DCDT_Channel. Definition at line 675 of file DCDT_Channel_Serial.h. Referenced by SetTimers(), and StaticPrepare(). |
|
Implements DCDT_Channel. Definition at line 658 of file DCDT_Channel_Serial.h. |
|
Implements DCDT_Channel. Definition at line 621 of file DCDT_Channel_Serial.h. References LostTimerOn(), ReceiveTimerOn(), SER_LOST_TIMER_VAL, SER_RECV_TIMER_VAL, SetLostTimer(), and SetReceiveTimer(). |
|
Method called when the link is in CONNECTING state.
Implements DCDT_Channel. Definition at line 600 of file DCDT_Channel_Serial.h. References HSMsgHeader, ReceiveHS(), ReceiveTimerOff(), and SendNotify(). |
|
Prepare static channel's data structure, open a FD.
Definition at line 164 of file DCDT_Channel_Serial.h. References DCDT_TRC_COMM, device_name, dynamic, localCD, LostTimerOn(), Open(), profile, ReceiveTimerOn(), SER_LOST_TIMER_VAL, SetLostTimer(), SetReceiveTimer(), and TRC_PRINT. |
|
Implements DCDT_Channel. Definition at line 702 of file DCDT_Channel_Serial.h. References device. Referenced by ReceiveHS(), and SendAnswer(). |
|
Implements DCDT_Channel. Definition at line 692 of file DCDT_Channel_Serial.h. References unblock_recv_flag. |
|
Implements DCDT_Channel. Definition at line 671 of file DCDT_Channel_Serial.h. |
|
Method called when the link is in WAITING state. Wait for an HS_NOTIFY message then respond with an HS_ANSWER message. ( ??? ) indefinitamente Implements DCDT_Channel. Definition at line 219 of file DCDT_Channel_Serial.h. References HSMsgHeader, ReceiveHS(), ReceiveTimerOff(), and SendNotify(). |
|
Definition at line 92 of file DCDT_Channel_Serial.h. Referenced by Close(), DCDT_Channel_Serial(), Open(), Receive(), ReceiveHS(), Send(), SendAnswer(), SendNotify(), and Stop(). |
|
Definition at line 109 of file DCDT_Channel_Serial.h. Referenced by GetStartingCD(), Prepare(), ReceiveHS(), and StaticPrepare(). |
|
Flag: 1 -> dynamic channel; != 1 -> static channel.
Definition at line 113 of file DCDT_Channel_Serial.h. Referenced by StaticPrepare(). |
|
Definition at line 93 of file DCDT_Channel_Serial.h. Referenced by DCDT_Channel_Serial(), Open(), Prepare(), and StaticPrepare(). |
|
Definition at line 94 of file DCDT_Channel_Serial.h. Referenced by Open(). |
|
Definition at line 110 of file DCDT_Channel_Serial.h. Referenced by StaticPrepare(). |
|
Definition at line 92 of file DCDT_Channel_Serial.h. Referenced by DCDT_Channel_Serial(). |
|
Flag: = 1 -> use timer when communicating.
Definition at line 97 of file DCDT_Channel_Serial.h. Referenced by DCDT_Channel_Serial(), LostTimerOff(), and LostTimerOn(). |
|
Communication timeout.
Definition at line 103 of file DCDT_Channel_Serial.h. Referenced by DCDT_Channel_Serial(), Receive(), ReceiveHS(), Send(), and SetLostTimer(). |
|
Flag: = 1 -> use timer when receiving.
Definition at line 97 of file DCDT_Channel_Serial.h. Referenced by DCDT_Channel_Serial(), ReceiveTimerOff(), and ReceiveTimerOn(). |
|
Flag: = 1 -> use no blocking calls when receiving.
Definition at line 97 of file DCDT_Channel_Serial.h. Referenced by DCDT_Channel_Serial(), ReceiveTimerOn(), and UnblockReceive(). |