broadcastExcept method

Future<bool> broadcastExcept(
  1. Object data,
  2. AdHocDevice excluded
)

Broadcasts a message to all directly connected nodes except the excluded one.

The message payload is set to data.

The node specified by excluded is not included in the broadcast.

Returns true upon successful broadcast, otherwise false.

Throws a DeviceFailureException if the Wi-Fi/Bluetooth adapter is not enabled.

Implementation

Future<bool> broadcastExcept(Object data, AdHocDevice excluded) async {
  if (_datalinkManager.checkState() == 0) {
    throw DeviceFailureException('No wifi and bluetooth connectivity');
  }

  return await _presentationManager.broadcastExcept(
      data, excluded.label!, false);
}