| C# | Visual Basic |
public BluetoothListener( BluetoothAddress localaddr, Guid service )
Public Sub New ( _ localaddr As BluetoothAddress, _ service As Guid _ )
- localaddr (BluetoothAddress)
- A BluetoothAddress that represents the local Bluetooth radio address.
- service (Guid)
- The Bluetooth service on which to listen for incoming connection attempts.
An SDP record is published on successful Start()()() to advertise the server. A generic record is created, containing the essential ServiceClassIdList and ProtocolDescriptorList attributes. The specified service identifier is inserted into the former, and the RFCOMM Channel number that the server is listening on is inserted into the latter. See the Bluetooth SDP specification for details on the use and format of SDP records.
If a SDP record with more elements is required, then use one of the other constructors that takes an SDP record e.g. BluetoothListener(BluetoothAddress, Guid, ServiceRecord), or when passing it as a byte array, e.g. BluetoothListener(BluetoothAddress, Guid, array<Byte>[]()[], Int32). The format of the generic record used here is shown there also.
Call the Start()()() method to begin listening for incoming connection attempts.