AdHocDevice constructor
AdHocDevice({
- String? label,
- String? address,
- String? name,
- Identifier? mac,
- int type = -1,
Creates an AdHocDevice object.
If label
is given, then it is used as a unique identifier to represent
the remote device.
If address
is given, then it is either used as an UUID in case of
Bluetooth Low Energy, or an IPv4 address in case of Wi-Fi Direct.
If name
is given, then it is used to represent the name of the remote
device.
If mac
is given, then it represents the MAC address of the remote device.
If type
is given, then it defines the type of technology used, i.e.,
"0" stands for Wi-Fi Direct and "1" stands for Bluetooth Low Energy.
Implementation
AdHocDevice({
String? label,
String? address,
String? name,
Identifier? mac,
int type = -1,
}) {
this.address = checkString(address);
_label = checkString(label);
_name = checkString(name);
_mac = mac ?? Identifier();
_type = type;
}