You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Drv::ByteStreamDriverModel Byte Stream Driver Model
2
2
3
-
The byte stream driver is a generic model for drivers implementing a "stream of bytes" interface. Typically these
4
-
drivers operate with an outgoing stream and an incoming stream. The outgoing stream is represented by the "send" port
5
-
and the incoming stream is either polled using the "poll" port or return asynchronously via the "readCallback" port.
3
+
The byte stream driver is a generic model for drivers implementing a "stream of bytes" interface. Typically these drivers operate with an outgoing stream and an incoming stream.
4
+
The outgoing stream is represented by the input `send` port; other components can invoke this port to send data through the driver. The incoming stream is represented by the output `recv` port; the driver will call this port to send data to the component that is receiving data from the driver.
6
5
7
6
## Design
8
7
9
-
The manager component (typically the ground interface) initiates the transfer of send data by calling the "send" port.
10
-
The caller will provide a `Fw::Buffer` containing the data to send and the port call will return a status of that send.
8
+
### Send
9
+
10
+
The manager component (for example a radio manager) initiates the transfer of send data by calling the "send" port.
11
+
The caller will provide a `Fw::Buffer` containing the data to send. The driver component **must** perform a callback on its `dataReturnOut` port to return the status of that send as well as returning ownership of the `Fw::Buffer` to the caller.
11
12
These responses are an enumeration whose values are described in the following table:
12
13
13
14
| Value | Description | Buffer Ownership |
14
15
|---|---|---|
15
-
| Drv::SEND_OK | Send functioned normally. | Ownership of the `Fw::Buffer` passes to the byte stream driver. |
16
-
| Drv::SEND_RETRY | Send should be retried, but a subsequent send should return SEND_OK. | The caller retains ownership of the `Fw::Buffer`. |
17
-
| Drv::SEND_ERROR | Send produced an error, future sends likely to fail. | Ownership of the `Fw::Buffer` passes to the byte stream driver. |
18
-
19
-
**Note:** in either formation described below, send will operate as described here.
16
+
| ByteStreamStatus::OP_OK | Send functioned normally. | Ownership of the `Fw::Buffer` passes to the byte stream driver. |
17
+
| ByteStreamStatus::SEND_RETRY | Send should be retried, but a subsequent send should return OP_OK. | The caller retains ownership of the `Fw::Buffer`. |
18
+
| ByteStreamStatus::OTHER_ERROR | Send produced an error, future sends likely to fail. | Ownership of the `Fw::Buffer` passes to the byte stream driver. |
20
19
21
-
### Callback Formation
20
+
### Receive
22
21
23
22

24
23
25
24
In the callback formation, the byte stream driver component initiates the transfer of received data by calling the
26
-
"readCallback" output port. This port transfers any read data in a `Fw::Buffer` along with a status for the receive.
25
+
"recv" output port. This port transfers any read data in a `Fw::Buffer` along with a status for the receive.
27
26
This status is an enumeration whose values are described in the following table:
0 commit comments