📄 stream_8h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>BlueLab: stream.h File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.8 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>stream.h File Reference</h1>Sources and sinks of 8-bit data. <a href="#_details">More...</a><p><h2>Defines</h2><ul><li>#define <a class="el" href="stream_8h.html#a0">StreamPcmSource</a>(port) StreamSourceFromSink(StreamPcmSink(port))<dl class="el"><dd class="mdescRight">Returns a Source from the PCM port passed. <a href="#a0"></a><br></dl><li>#define <a class="el" href="stream_8h.html#a1">StreamScoSource</a>(handle) StreamSourceFromSink(StreamScoSink(handle))<dl class="el"><dd class="mdescRight">Returns a Source from the SCO stream passed. <a href="#a1"></a><br></dl><li>#define <a class="el" href="stream_8h.html#a2">StreamHostSource</a>(channel) StreamSourceFromSink(StreamHostSink(channel))<dl class="el"><dd class="mdescRight">Get the Source for the specified stream-based BCSP#13 channel. <a href="#a2"></a><br></dl><li>#define <a class="el" href="stream_8h.html#a3">StreamRfcommSource</a>(mux_id, server_chan) StreamSourceFromSink(StreamRfcommSink(mux_id,server_chan))<dl class="el"><dd class="mdescRight">Find the Source corresponding to an RFCOMM connection. <a href="#a3"></a><br></dl><li>#define <a class="el" href="stream_8h.html#a4">StreamUartSource</a>() StreamSourceFromSink(StreamUartSink())<dl class="el"><dd class="mdescRight">Find the Source associated with the raw uart. <a href="#a4"></a><br></dl><li>#define <a class="el" href="stream_8h.html#a5">StreamL2capSource</a>(cid) StreamSourceFromSink(StreamL2capSink(cid))<dl class="el"><dd class="mdescRight">Find the Source corresponding to an L2CAP connection. <a href="#a5"></a><br></dl><li>#define <a class="el" href="stream_8h.html#a6">StreamKalimbaSource</a>(port) StreamSourceFromSink(StreamKalimbaSink(port))<li>#define <a class="el" href="stream_8h.html#a7">StreamUsbClassSource</a>(interface) StreamSourceFromSink(StreamUsbClassSink(interface))<dl class="el"><dd class="mdescRight">Return the USB Class Request Source associated with 'interface'. <a href="#a7"></a><br></dl><li>#define <a class="el" href="stream_8h.html#a8">StreamUsbEndPointSource</a>(end_point) StreamSourceFromSink(StreamUsbEndPointSink(end_point))<dl class="el"><dd class="mdescRight">Return the USB Request Source associated with the USB transport. <a href="#a8"></a><br></dl><li>#define <a class="el" href="stream_8h.html#a9">StreamUsbVendorSource</a>() StreamSourceFromSink(StreamUsbVendorSink())<dl class="el"><dd class="mdescRight">Return the USB Vendor Source associated with the USB transport. <a href="#a9"></a><br></dl><li>#define <a class="el" href="stream_8h.html#a10">StreamHidSink</a>() StreamSinkFromSource(StreamHidSource())<dl class="el"><dd class="mdescRight">Get the primary sink for HID. This is typically where UART data is connected. <a href="#a10"></a><br></dl></ul><h2>Functions</h2><ul><li><a class="el" href="csrtypes_8h.html#a4">uint16</a> <a class="el" href="stream_8h.html#a11">StreamMove</a> (<a class="el" href="sink___8h.html#a0">Sink</a> sink, <a class="el" href="source___8h.html#a0">Source</a> source, <a class="el" href="csrtypes_8h.html#a4">uint16</a> count)<dl class="el"><dd class="mdescRight">Move the specified number of bytes from the start of 'source' to the end of 'sink'. <a href="#a11"></a><br></dl><li>void <a class="el" href="stream_8h.html#a12">StreamConfigure</a> (<a class="el" href="vm__if_8h.html#a58">vm_stream_config_key</a> key, <a class="el" href="csrtypes_8h.html#a4">uint16</a> value)<dl class="el"><dd class="mdescRight">Configure the stream subsystem. <a href="#a12"></a><br></dl><li><a class="el" href="csrtypes_8h.html#a9">bool</a> <a class="el" href="stream_8h.html#a13">StreamConnect</a> (<a class="el" href="source___8h.html#a0">Source</a> source, <a class="el" href="sink___8h.html#a0">Sink</a> sink)<dl class="el"><dd class="mdescRight">Make an automatic connection between a source and sink. <a href="#a13"></a><br></dl><li>void <a class="el" href="stream_8h.html#a14">StreamDisconnect</a> (<a class="el" href="source___8h.html#a0">Source</a> source, <a class="el" href="sink___8h.html#a0">Sink</a> sink)<dl class="el"><dd class="mdescRight">Break any existing automatic connection involving the source *or* sink. <a href="#a14"></a><br></dl><li><a class="el" href="source___8h.html#a0">Source</a> <a class="el" href="stream_8h.html#a15">StreamRegionSource</a> (const <a class="el" href="csrtypes_8h.html#a8">uint8</a> *data, <a class="el" href="csrtypes_8h.html#a4">uint16</a> length)<dl class="el"><dd class="mdescRight">Create a source from a region of memory. <a href="#a15"></a><br></dl><li><a class="el" href="source___8h.html#a0">Source</a> <a class="el" href="stream_8h.html#a16">StreamSourceFromSink</a> (<a class="el" href="sink___8h.html#a0">Sink</a> sink)<dl class="el"><dd class="mdescRight">Find the Source from its Sink. <a href="#a16"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a17">StreamSinkFromSource</a> (<a class="el" href="source___8h.html#a0">Source</a> source)<dl class="el"><dd class="mdescRight">Find the Sink from its Source. <a href="#a17"></a><br></dl><li><a class="el" href="csrtypes_8h.html#a9">bool</a> <a class="el" href="stream_8h.html#a18">StreamSinksFromBdAddr</a> (<a class="el" href="csrtypes_8h.html#a4">uint16</a> *max, <a class="el" href="sink___8h.html#a0">Sink</a> *sinks, const <a class="el" href="structbdaddr.html">bdaddr</a> *)<dl class="el"><dd class="mdescRight">Find all the sinks connected to a given Bluetooth address. <a href="#a18"></a><br></dl><li><a class="el" href="csrtypes_8h.html#a9">bool</a> <a class="el" href="stream_8h.html#a19">StreamConnectDispose</a> (<a class="el" href="source___8h.html#a0">Source</a> source)<dl class="el"><dd class="mdescRight">Dispose of all data arriving on the specified source by throwing it away. <a href="#a19"></a><br></dl><li><a class="el" href="source___8h.html#a0">Source</a> <a class="el" href="stream_8h.html#a20">StreamAudioSource</a> (const <a class="el" href="audio__if_8h.html#a5">audio_note</a> *audio)<dl class="el"><dd class="mdescRight">Returns a source with the contents of the memory audio_note points to. <a href="#a20"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a21">StreamPcmSink</a> (<a class="el" href="csrtypes_8h.html#a4">uint16</a> port)<dl class="el"><dd class="mdescRight">Returns a Sink from the PCM port passed. <a href="#a21"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a22">StreamScoSink</a> (<a class="el" href="csrtypes_8h.html#a4">uint16</a> handle)<dl class="el"><dd class="mdescRight">Returns a Sink from the SCO stream passed. <a href="#a22"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a23">StreamHostSink</a> (<a class="el" href="csrtypes_8h.html#a4">uint16</a> channel)<dl class="el"><dd class="mdescRight">Get the Sink for the specified stream-based BCSP#13 channel. <a href="#a23"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a24">StreamRfcommSink</a> (<a class="el" href="csrtypes_8h.html#a8">uint8</a> mux_id, <a class="el" href="csrtypes_8h.html#a8">uint8</a> server_chan)<dl class="el"><dd class="mdescRight">Find the Sink corresponding to an RFCOMM connection. <a href="#a24"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a25">StreamUartSink</a> (void)<dl class="el"><dd class="mdescRight">Find the Sink associated with the raw uart. <a href="#a25"></a><br></dl><li>void <a class="el" href="stream_8h.html#a26">StreamUartConfigure</a> (<a class="el" href="uart__if_8h.html#a17">vm_uart_rate</a> rate, <a class="el" href="uart__if_8h.html#a18">vm_uart_stop</a> stop, <a class="el" href="uart__if_8h.html#a19">vm_uart_parity</a> parity)<dl class="el"><dd class="mdescRight">Dynamically configure the UART settings. <a href="#a26"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a27">StreamL2capSink</a> (<a class="el" href="csrtypes_8h.html#a4">uint16</a> cid)<dl class="el"><dd class="mdescRight">Find the Sink corresponding to an L2CAP connection. <a href="#a27"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a28">StreamKalimbaSink</a> (<a class="el" href="csrtypes_8h.html#a4">uint16</a> port)<dl class="el"><dd class="mdescRight">The Sink connected to the port passed on Kalimba. <a href="#a28"></a><br></dl><li><a class="el" href="source___8h.html#a0">Source</a> <a class="el" href="stream_8h.html#a29">StreamFileSource</a> (<a class="el" href="file__if_8h.html#a2">FILE_INDEX</a> index)<dl class="el"><dd class="mdescRight">Return a source with the contents of the specified file. <a href="#a29"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a30">StreamUsbClassSink</a> (<a class="el" href="usb___8h.html#a8">UsbInterface</a> interface)<dl class="el"><dd class="mdescRight">Return the USB Class Request Sink. <a href="#a30"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a31">StreamUsbEndPointSink</a> (<a class="el" href="usb___8h.html#a9">EndPoint</a> end_point)<dl class="el"><dd class="mdescRight">Return the USB Request Sink associated with the USB transport. <a href="#a31"></a><br></dl><li><a class="el" href="sink___8h.html#a0">Sink</a> <a class="el" href="stream_8h.html#a32">StreamUsbVendorSink</a> (void)<dl class="el"><dd class="mdescRight">Return the USB Vendor Sink associated with the USB transport. <a href="#a32"></a><br></dl><li><a class="el" href="source___8h.html#a0">Source</a> <a class="el" href="stream_8h.html#a33">StreamHidSource</a> (void)<dl class="el"><dd class="mdescRight">Get the primary source for HID. <a href="#a33"></a><br></dl><li><a class="el" href="source___8h.html#a0">Source</a> <a class="el" href="stream_8h.html#a34">StreamHidAuxSource</a> (void)<dl class="el"><dd class="mdescRight">Get the auxiliary source for HID. <a href="#a34"></a><br></dl><li><a class="el" href="csrtypes_8h.html#a9">bool</a> <a class="el" href="stream_8h.html#a35">StreamEnableSniffSubrating</a> (<a class="el" href="sink___8h.html#a0">Sink</a> sink, <a class="el" href="csrtypes_8h.html#a4">uint16</a> max_remote_latency, <a class="el" href="csrtypes_8h.html#a4">uint16</a> max_local_latency, <a class="el" href="csrtypes_8h.html#a4">uint16</a> min_remote_timeout, <a class="el" href="csrtypes_8h.html#a4">uint16</a> min_local_timeout)<dl class="el"><dd class="mdescRight">Enable support for sniff sub-rating. <a href="#a35"></a><br></dl><li><a class="el" href="csrtypes_8h.html#a9">bool</a> <a class="el" href="stream_8h.html#a36">StreamConnectAndDispose</a> (<a class="el" href="source___8h.html#a0">Source</a> source, <a class="el" href="sink___8h.html#a0">Sink</a> sink)<dl class="el"><dd class="mdescRight">Make an automatic connection between a source and sink, or dispose it. <a href="#a36"></a><br></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>Sources and sinks of 8-bit data. <p>The Stream API provides functions for efficiently processing streams of eight bit data. Available streams include RFCOMM, L2CAP, TCP/UDP connections, the serial port, USB endpoint and files.<p>Streams are classified into sources (which can be read) and sinks (which can be written).<hr><h2>Define Documentation</h2><a class="anchor" name="a0" doxytag="stream.h::StreamPcmSource" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define StreamPcmSource </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">port </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> StreamSourceFromSink(StreamPcmSink(port))</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Returns a Source from the PCM port passed. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>port</em> </td><td>The PCM port number. Must be in the range 0..3 </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a1" doxytag="stream.h::StreamScoSource" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define StreamScoSource </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">handle </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> StreamSourceFromSink(StreamScoSink(handle))</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Returns a Source from the SCO stream passed. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>handle</em> </td><td>The SCO stream from which to fetch the Source. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a2" doxytag="stream.h::StreamHostSource" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define StreamHostSource </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">channel </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> StreamSourceFromSink(StreamHostSink(channel))</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the Source for the specified stream-based BCSP#13 channel. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>channel</em> </td><td>The channel to fetch the Source for. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a3" doxytag="stream.h::StreamRfcommSource" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define StreamRfcommSource </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">mux_id, <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>server_chan </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> StreamSourceFromSink(StreamRfcommSink(mux_id,server_chan))</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Find the Source corresponding to an RFCOMM connection. <p> </td> </tr></table><a class="anchor" name="a4" doxytag="stream.h::StreamUartSource" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define StreamUartSource </td> <td class="md" valign="top">( </td> </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> StreamSourceFromSink(StreamUartSink())</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Find the Source associated with the raw uart. <p>Returns zero if it is unavailable (for example the appropriate transport has not been configured.) </td> </tr></table><a class="anchor" name="a5" doxytag="stream.h::StreamL2capSource" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define StreamL2capSource </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">cid </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> StreamSourceFromSink(StreamL2capSink(cid))</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Find the Source corresponding to an L2CAP connection. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>cid</em> </td><td>The connection ID to fetch the Source for. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a6" doxytag="stream.h::StreamKalimbaSource" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define StreamKalimbaSource </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">port </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> StreamSourceFromSink(StreamKalimbaSink(port))</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a class="anchor" name="a7" doxytag="stream.h::StreamUsbClassSource" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define StreamUsbClassSource </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">interface </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> StreamSourceFromSink(StreamUsbClassSink(interface))</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Return the USB Class Request Source associated with 'interface'. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>The</em> </td><td>USB interface to fetch the Source for. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a8" doxytag="stream.h::StreamUsbEndPointSource" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define StreamUsbEndPointSource </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">end_point </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> StreamSourceFromSink(StreamUsbEndPointSink(end_point))</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Return the USB Request Source associated with the USB transport. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>end_point</em> </td><td>The USB endpoint to fetch the Source for. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a9" doxytag="stream.h::StreamUsbVendorSource" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -