startServer method
Creates an RFCOMM server socket listening on the given uuid.
uuid defaults to BtcUuid.spp (the Serial Port Profile). serviceName
is the SDP service name. If secure is true, uses
authenticated/encrypted RFCOMM.
| Platform | Supported |
|---|---|
| Android | Yes |
| Windows | Yes |
| macOS | Yes |
| Linux | Yes |
| iOS | No |
Throws BtcUuidException if uuid is not a valid UUID.
Implementation
Future<BtcServerSocket> startServer({
required String serviceName,
String uuid = BtcUuid.spp,
bool secure = true,
}) {
_validateUuid(uuid);
return _platform.startServer(
uuid: uuid, serviceName: serviceName, secure: secure);
}