WTP connection class.
More...
|
def | __init__ (self, server, wisp_id, checksum_func, checksum_type) |
| WTP connection constructor. More...
|
|
def | send (self, msg_data) |
| Send a message to WISP. More...
|
|
def | recv (self) |
| Receive a message from WISP. More...
|
|
def | close (self) |
| Close WTP connection with WISP. More...
|
|
def | __init__ (self) |
| Event target mix-in constructor. More...
|
|
def | on (self, event, handler=None) |
| Add an event handler. More...
|
|
def | off (self, event, handler) |
| Remove an event handler. More...
|
|
def | trigger (self, event, result=None) |
| Trigger an event. More...
|
|
|
def | _build_header (self, packet_type) |
| Build WTP packet header for sending. More...
|
|
def | _build_ack (self) |
| Build WTP acknowledgement packet. More...
|
|
def | _handle_packet (self, stream, packet_type) |
| Handle WTP packet for current connection. More...
|
|
def | _handle_open (self, stream) |
| Handle WTP open packet. More...
|
|
def | _handle_close (self, stream) |
| Handle WTP close packet. More...
|
|
def | _handle_ack (self, stream) |
| Handle WTP acknowledgement packet. More...
|
|
def | _handle_data_packet (self, stream, msg_begin) |
| Handle WTP message data packet. More...
|
|
def | _handle_req_uplink (self, stream) |
| Handle WTP request uplink packet. More...
|
|
def | _handle_set_param (self, stream) |
| Handle WTP set parameter packet. More...
|
|
def | _request_access_spec (self) |
| Request sending AccessSpec to WISP. More...
|
|
◆ __init__()
def wtp.connection.WTPConnection.__init__ |
( |
|
self, |
|
|
|
server, |
|
|
|
wisp_id, |
|
|
|
checksum_func, |
|
|
|
checksum_type |
|
) |
| |
WTP connection constructor.
- Parameters
-
server | WTP server reference. |
wisp_id | WISP ID. |
checksum_func | Checksum function. |
checksum_type | Checksum data type. |
◆ _build_ack()
def wtp.connection.WTPConnection._build_ack |
( |
|
self | ) |
|
|
private |
Build WTP acknowledgement packet.
- Returns
- WTP acknowledgement packet data
◆ _build_header()
def wtp.connection.WTPConnection._build_header |
( |
|
self, |
|
|
|
packet_type |
|
) |
| |
|
private |
Build WTP packet header for sending.
- Parameters
-
packet_type | WTP packet type. |
- Returns
- Checksum stream containing WTP packet header.
◆ _handle_ack()
def wtp.connection.WTPConnection._handle_ack |
( |
|
self, |
|
|
|
stream |
|
) |
| |
|
private |
Handle WTP acknowledgement packet.
- Parameters
-
stream | Data stream containing acknowledgement packet. |
◆ _handle_close()
def wtp.connection.WTPConnection._handle_close |
( |
|
self, |
|
|
|
stream |
|
) |
| |
|
private |
Handle WTP close packet.
- Parameters
-
stream | Data stream containing close packet. |
◆ _handle_data_packet()
def wtp.connection.WTPConnection._handle_data_packet |
( |
|
self, |
|
|
|
stream, |
|
|
|
msg_begin |
|
) |
| |
|
private |
Handle WTP message data packet.
- Parameters
-
stream | Data stream containing continue message packet. |
msg_begin | True for WTP_PKT_BEGIN_MSG and False for WTP_PKT_CONT_MSG. |
◆ _handle_open()
def wtp.connection.WTPConnection._handle_open |
( |
|
self, |
|
|
|
stream |
|
) |
| |
|
private |
Handle WTP open packet.
- Parameters
-
stream | Data stream containing open packet. |
◆ _handle_packet()
def wtp.connection.WTPConnection._handle_packet |
( |
|
self, |
|
|
|
stream, |
|
|
|
packet_type |
|
) |
| |
|
private |
Handle WTP packet for current connection.
- Parameters
-
stream | Data stream containing WTP packet. |
packet_type | Packet type. |
◆ _handle_req_uplink()
def wtp.connection.WTPConnection._handle_req_uplink |
( |
|
self, |
|
|
|
stream |
|
) |
| |
|
private |
Handle WTP request uplink packet.
- Parameters
-
stream | Data stream containing request uplink packet. |
◆ _handle_set_param()
def wtp.connection.WTPConnection._handle_set_param |
( |
|
self, |
|
|
|
stream |
|
) |
| |
|
private |
Handle WTP set parameter packet.
- Parameters
-
stream | Data stream containing set parameter packet. |
◆ _request_access_spec()
def wtp.connection.WTPConnection._request_access_spec |
( |
|
self | ) |
|
|
private |
Request sending AccessSpec to WISP.
◆ close()
def wtp.connection.WTPConnection.close |
( |
|
self | ) |
|
Close WTP connection with WISP.
◆ recv()
def wtp.connection.WTPConnection.recv |
( |
|
self | ) |
|
Receive a message from WISP.
- Returns
- : A deferred object that will be resolved with received message data.
◆ send()
def wtp.connection.WTPConnection.send |
( |
|
self, |
|
|
|
msg_data |
|
) |
| |
Send a message to WISP.
- Parameters
-
- Returns
- A deferred object that will be resolved when the message is fully sent.
◆ _ongoing_access_spec
wtp.connection.WTPConnection._ongoing_access_spec |
|
private |
◆ _opspec_ctrl
wtp.connection.WTPConnection._opspec_ctrl |
|
private |
OpSpec congestion control.
◆ _pkt_handler
dictionary wtp.connection.WTPConnection._pkt_handler |
|
staticprivate |
Initial value:= {
consts.WTP_PKT_OPEN: _handle_open,
consts.WTP_PKT_CLOSE: _handle_close,
consts.WTP_PKT_ACK: _handle_ack,
consts.WTP_PKT_BEGIN_MSG: functools.partial(_handle_data_packet, msg_begin=True),
consts.WTP_PKT_CONT_MSG: functools.partial(_handle_data_packet, msg_begin=False),
consts.WTP_PKT_REQ_UPLINK: _handle_req_uplink,
consts.WTP_PKT_SET_PARAM: _handle_set_param
}
Packet handlers.
◆ _read_opspec_sizes
wtp.connection.WTPConnection._read_opspec_sizes |
|
private |
Sizes of pending Read OpSpecs.
◆ _recv_deferreds
wtp.connection.WTPConnection._recv_deferreds |
|
private |
◆ _recv_msgs
wtp.connection.WTPConnection._recv_msgs |
|
private |
◆ _rx_ctrl
wtp.connection.WTPConnection._rx_ctrl |
|
private |
◆ _send_deferreds
wtp.connection.WTPConnection._send_deferreds |
|
private |
◆ _tx_ctrl
wtp.connection.WTPConnection._tx_ctrl |
|
private |
◆ downlink_state
wtp.connection.WTPConnection.downlink_state |
◆ server
wtp.connection.WTPConnection.server |
◆ uplink_state
wtp.connection.WTPConnection.uplink_state |
◆ wisp_id
wtp.connection.WTPConnection.wisp_id |
The documentation for this class was generated from the following file: