12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BLUETOOTH (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> BLUETOOTH (9)btproto_connect(handle , addr)Initiate a connection by the protocol object described by handle to the remote device described byaddr. This will result in a call to either proto->connected() or proto->disconnected(),and optionally proto->connecting() with the appropriate reference as given tobtproto_attach().btproto_peeraddr(handle , addr)Copy the remote address of the protocol object described by handle into addr.btproto_disconnect(handle , linger)Schedule a disconnection by the protocol object described by handle. This will result in a call toproto->disconnected() with the appropriate reference when the connection is torn down. Iflinger is zero, the disconnection will be initiated immediately and any outstanding data may be lost.btproto_detach(handle_ptr)Detach the protocol object described by the value in the location of handle_ptr, and free anyrelated memory. The pointer in the location is cleared.btproto_listen(handle)Use the protocol object described by handle as a listening post. This will result in calls to theproto->newconn() function when incoming connections are detected.btproto_send(handle , mbuf)Send data on the connection described by the protocol object.btproto_rcvd(handle , space)Indicate to the protocol that space is now available in the input buffers so that flow control may bedeasserted. This should also be called to indicate initial buffer space. Note that space is an absolutevalue.btproto_setopt(handle , optarg , arg)Set options on the protocol object described by handle.btproto_getopt(handle , optarg , arg)Get options for the protocol object described by handle.(∗connecting)(ref)This function will be called when the protocol receives information that the connection described byref is pending.(∗connected)(ref)This function will be called when the connection described by ref is successful and indicates thatdata may now besent.(∗disconnected)(ref , error)This function will be called when the connection described by ref is disconnected.∗(∗newconn)(ref , laddr , raddr)This function will be called when the protocol receives anew incoming connection on the localdevice described by laddr from the remote device described by raddr. The protocol shoulddecide if it wishes to accept the connection and should attach and return a new instance of the relevantprotocol handle or NULL.(∗complete)(ref , count)This function will be called when the protocol has completed sending data. Complete will usuallymean that the data has successfully left the device though for guaranteed protocols it can mean thatthe data has arrived atthe other end and been acknowledged, and that count amount of data can beremoved from the socket buffer. The units of the count value will be dependent on the protocol<strong>NetBSD</strong> 3.0 November 20, 2007 4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!