📄 spp_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: spp.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>spp.h File Reference</h1>Header file for the Serial Port Profile library. <a href="#_details">More...</a><p><h2>Data Structures</h2><ul><li>struct <a class="el" href="struct_s_p_p___i_n_i_t___c_f_m___t.html">SPP_INIT_CFM_T</a><dl class="el"><dd class="mdescRight">An initialise confirmation message from the SPP library. <a href="struct_s_p_p___i_n_i_t___c_f_m___t.html#_details">More...</a><br></dl><li>struct <a class="el" href="struct_s_p_p___c_o_n_n_e_c_t___c_f_m___t.html">SPP_CONNECT_CFM_T</a><dl class="el"><dd class="mdescRight">A connection confirmation message from the SPP library. <a href="struct_s_p_p___c_o_n_n_e_c_t___c_f_m___t.html#_details">More...</a><br></dl><li>struct <a class="el" href="struct_s_p_p___c_o_n_n_e_c_t___i_n_d___t.html">SPP_CONNECT_IND_T</a><dl class="el"><dd class="mdescRight">A connection indication message from the SPP library. <a href="struct_s_p_p___c_o_n_n_e_c_t___i_n_d___t.html#_details">More...</a><br></dl><li>struct <a class="el" href="struct_s_p_p___m_e_s_s_a_g_e___m_o_r_e___d_a_t_a___t.html">SPP_MESSAGE_MORE_DATA_T</a><dl class="el"><dd class="mdescRight">A source associated with an SPP task has more data. <a href="struct_s_p_p___m_e_s_s_a_g_e___m_o_r_e___d_a_t_a___t.html#_details">More...</a><br></dl><li>struct <a class="el" href="struct_s_p_p___m_e_s_s_a_g_e___m_o_r_e___s_p_a_c_e___t.html">SPP_MESSAGE_MORE_SPACE_T</a><dl class="el"><dd class="mdescRight">A sink associated with an SPP task has more space. <a href="struct_s_p_p___m_e_s_s_a_g_e___m_o_r_e___s_p_a_c_e___t.html#_details">More...</a><br></dl><li>struct <a class="el" href="struct_s_p_p___d_i_s_c_o_n_n_e_c_t___i_n_d___t.html">SPP_DISCONNECT_IND_T</a><dl class="el"><dd class="mdescRight">A disconnection indication message from the SPP library. <a href="struct_s_p_p___d_i_s_c_o_n_n_e_c_t___i_n_d___t.html#_details">More...</a><br></dl></ul><h2>Defines</h2><ul><li>#define <a class="el" href="spp_8h.html#a0">SPP_MESSAGE_BASE</a> 0x6f00<dl class="el"><dd class="mdescRight">Base message number for this library. <a href="#a0"></a><br></dl></ul><h2>Typedefs</h2><ul><li>typedef __SPP <a class="el" href="spp_8h.html#a1">SPP</a><dl class="el"><dd class="mdescRight">The Serial Port Profile structure. <a href="#a1"></a><br></dl></ul><h2>Enumerations</h2><ul><li>enum <a class="el" href="spp_8h.html#a37">SppMessageId</a> { <br> <a class="el" href="spp_8h.html#a37a2">SPP_INIT_CFM</a> = SPP_MESSAGE_BASE, <br> <a class="el" href="spp_8h.html#a37a3">SPP_CONNECT_CFM</a>, <br> <a class="el" href="spp_8h.html#a37a4">SPP_CONNECT_IND</a>, <br> <a class="el" href="spp_8h.html#a37a5">SPP_MESSAGE_MORE_DATA</a>, <br> <a class="el" href="spp_8h.html#a37a6">SPP_MESSAGE_MORE_SPACE</a>, <br> <a class="el" href="spp_8h.html#a37a7">SPP_DISCONNECT_IND</a>, <br> <a class="el" href="spp_8h.html#a37a8">SPP_MESSAGE_TOP</a><br> }<dl class="el"><dd class="mdescRight">The main app messages sent by the SPP library. <a href="#a37">More...</a><br></dl><li>enum <a class="el" href="spp_8h.html#a38">spp_device_type</a> { <br> <a class="el" href="spp_8h.html#a38a9">devA</a>, <br> <a class="el" href="spp_8h.html#a38a10">devB</a>, <br> <a class="el" href="spp_8h.html#a38a11">dunDCE</a>, <br> <a class="el" href="spp_8h.html#a38a12">dunDTE</a><br> }<dl class="el"><dd class="mdescRight">The type of device. <a href="#a38">More...</a><br></dl><li>enum <a class="el" href="spp_8h.html#a39">spp_init_status</a> { <br> <a class="el" href="spp_8h.html#a39a13">spp_init_success</a>, <br> <a class="el" href="spp_8h.html#a39a14">spp_init_rfc_chan_fail</a>, <br> <a class="el" href="spp_8h.html#a39a15">spp_init_sdp_reg_fail</a>, <br> <a class="el" href="spp_8h.html#a39a16">spp_init_fail</a><br> }<dl class="el"><dd class="mdescRight">Possible status codes for the init cfm message. <a href="#a39">More...</a><br></dl><li>enum <a class="el" href="spp_8h.html#a40">spp_connect_status</a> { <br> <a class="el" href="spp_8h.html#a40a17">spp_connect_success</a>, <br> <a class="el" href="spp_8h.html#a40a18">spp_connect_sdp_fail</a>, <br> <a class="el" href="spp_8h.html#a40a19">spp_connect_slc_failed</a>, <br> <a class="el" href="spp_8h.html#a40a20">spp_connect_failed_busy</a>, <br> <a class="el" href="spp_8h.html#a40a21">spp_connect_failed</a>, <br> <a class="el" href="spp_8h.html#a40a22">spp_connect_server_channel_not_registered</a>, <br> <a class="el" href="spp_8h.html#a40a23">spp_connect_timeout</a>, <br> <a class="el" href="spp_8h.html#a40a24">spp_connect_rejected</a>, <br> <a class="el" href="spp_8h.html#a40a25">spp_connect_normal_disconnect</a>, <br> <a class="el" href="spp_8h.html#a40a26">spp_connect_abnormal_disconnect</a>, <br> <a class="el" href="spp_8h.html#a40a27">spp_connect_dun_invalid</a><br> }<dl class="el"><dd class="mdescRight">Return status for the SPP_CONNECT_CFM message. <a href="#a40">More...</a><br></dl><li>enum <a class="el" href="spp_8h.html#a41">spp_disconnect_status</a> { <br> <a class="el" href="spp_8h.html#a41a28">spp_disconnect_success</a>, <br> <a class="el" href="spp_8h.html#a41a29">spp_disconnect_link_loss</a>, <br> <a class="el" href="spp_8h.html#a41a30">spp_disconnect_no_slc</a>, <br> <a class="el" href="spp_8h.html#a41a31">spp_disconnect_timeout</a>, <br> <a class="el" href="spp_8h.html#a41a32">spp_disconnect_error</a><br> }<dl class="el"><dd class="mdescRight">Possible status codes for the disconnect message. <a href="#a41">More...</a><br></dl></ul><h2>Functions</h2><ul><li>void <a class="el" href="spp_8h.html#a33">SppInit</a> (<a class="el" href="struct_task_data.html">Task</a> theAppTask, <a class="el" href="spp_8h.html#a38">spp_device_type</a> type_of_device, <a class="el" href="csrtypes_8h.html#a4">uint16</a> priority)<dl class="el"><dd class="mdescRight">Initialise the SPP library. <a href="#a33"></a><br></dl><li>void <a class="el" href="spp_8h.html#a34">SppConnect</a> (<a class="el" href="spp_8h.html#a1">SPP</a> *spp, const <a class="el" href="structbdaddr.html">bdaddr</a> *bd_addr)<dl class="el"><dd class="mdescRight">Handle Connect request by sending an internal message. <a href="#a34"></a><br></dl><li>void <a class="el" href="spp_8h.html#a35">SppConnectResponse</a> (<a class="el" href="spp_8h.html#a1">SPP</a> *spp, <a class="el" href="csrtypes_8h.html#a9">bool</a> response, const <a class="el" href="structbdaddr.html">bdaddr</a> *bd_addr)<dl class="el"><dd class="mdescRight">Handle response to a connection request by sending an internal message. <a href="#a35"></a><br></dl><li>void <a class="el" href="spp_8h.html#a36">SppDisconnect</a> (<a class="el" href="spp_8h.html#a1">SPP</a> *spp)<dl class="el"><dd class="mdescRight">Disconnect the service level connection for the supported profile. <a href="#a36"></a><br></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>Header file for the Serial Port Profile library. <p>This library implements the Serial Port Profile Specification. The Serial Port Profile Specification (hereafter referred to as SPP) is used to set up an emulated serial cable connection using RFCOMM between two peer devices. The RFCOMM session exists on an L2CAP channel.<p>As well as handling the RFCOMM link, the SPP library handles the registration of a service record with the SDP database, so that the service/applications can be reached via RFCOMM.<p>The library exposes a functional downstream API and an upstream message based API.<hr><h2>Define Documentation</h2><a class="anchor" name="a0" doxytag="spp.h::SPP_MESSAGE_BASE" ></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 SPP_MESSAGE_BASE 0x6f00 </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Base message number for this library. <p> </td> </tr></table><hr><h2>Typedef Documentation</h2><a class="anchor" name="a1" doxytag="spp.h::SPP" ></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"> typedef struct __SPP <a class="el" href="spp_8h.html#a1">SPP</a> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>The Serial Port Profile structure. <p> </td> </tr></table><hr><h2>Enumeration Type Documentation</h2><a class="anchor" name="a37" doxytag="spp.h::SppMessageId" ></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"> enum <a class="el" href="spp_8h.html#a37">SppMessageId</a> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>The main app messages sent by the SPP library. <p><dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a class="anchor" name="a37a2" doxytag="SPP_INIT_CFM" ></a>SPP_INIT_CFM</em> </td><td>This message indicates the result of a initialisation attempt. </td></tr><tr><td valign=top><em><a class="anchor" name="a37a3" doxytag="SPP_CONNECT_CFM" ></a>SPP_CONNECT_CFM</em> </td><td>This message indicates the result of a connection attempt. </td></tr><tr><td valign=top><em><a class="anchor" name="a37a4" doxytag="SPP_CONNECT_IND" ></a>SPP_CONNECT_IND</em> </td><td>This message indicates that another device is trying to connect. This message must be responded to using SppConnectResponse. </td></tr><tr><td valign=top><em><a class="anchor" name="a37a5" doxytag="SPP_MESSAGE_MORE_DATA" ></a>SPP_MESSAGE_MORE_DATA</em> </td><td>This message indicates that a source associated with an SPP profile task has received more data. </td></tr><tr><td valign=top><em><a class="anchor" name="a37a6" doxytag="SPP_MESSAGE_MORE_SPACE" ></a>SPP_MESSAGE_MORE_SPACE</em> </td><td>This message indicates that a sink associated with an SPP profile task has more space. </td></tr><tr><td valign=top><em><a class="anchor" name="a37a7" doxytag="SPP_DISCONNECT_IND" ></a>SPP_DISCONNECT_IND</em> </td><td>This message indicates the result of a disconnect attempt. </td></tr><tr><td valign=top><em><a class="anchor" name="a37a8" doxytag="SPP_MESSAGE_TOP" ></a>SPP_MESSAGE_TOP</em> </td><td></td></tr></table></dl> </td> </tr></table><a class="anchor" name="a38" doxytag="spp.h::spp_device_type" ></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"> enum <a class="el" href="spp_8h.html#a38">spp_device_type</a> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>The type of device. <p><dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a class="anchor" name="a38a9" doxytag="devA" ></a>devA</em> </td><td>Master. </td></tr><tr><td valign=top><em><a class="anchor" name="a38a10" doxytag="devB" ></a>devB</em> </td><td>Slave. </td></tr><tr><td valign=top><em><a class="anchor" name="a38a11" doxytag="dunDCE" ></a>dunDCE</em> </td><td>DUN Data Circuit Equipment - DUN Master. </td></tr><tr><td valign=top><em><a class="anchor" name="a38a12" doxytag="dunDTE" ></a>dunDTE</em> </td><td>DUN Data Terminal Endpoint - DUN Slave. </td></tr></table></dl> </td> </tr></table><a class="anchor" name="a39" doxytag="spp.h::spp_init_status" ></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"> enum <a class="el" href="spp_8h.html#a39">spp_init_status</a> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Possible status codes for the init cfm message. <p><dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a class="anchor" name="a39a13" doxytag="spp_init_success" ></a>spp_init_success</em> </td><td>Successful initialisation. </td></tr><tr><td valign=top><em><a class="anchor" name="a39a14" doxytag="spp_init_rfc_chan_fail" ></a>spp_init_rfc_chan_fail</em> </td><td>Unsuccessful due to an RFCOMM channel failure. </td></tr><tr><td valign=top><em><a class="anchor" name="a39a15" doxytag="spp_init_sdp_reg_fail" ></a>spp_init_sdp_reg_fail</em> </td><td>Unsuccessful due to a service record registration failure. </td></tr><tr><td valign=top><em><a class="anchor" name="a39a16" doxytag="spp_init_fail" ></a>spp_init_fail</em> </td><td>Unsuccessful for some other reason. </td></tr></table></dl> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -