sendConfigModelPublicationSet method

Future<ConfigModelPublicationStatus> sendConfigModelPublicationSet(
  1. int elementAddress,
  2. int publishAddress,
  3. int modelIdentifier, {
  4. int appKeyIndex = 0,
  5. bool credentialFlag = false,
  6. int publishTtl = 15,
  7. int publicationSteps = 0,
  8. int publicationResolution = 100,
  9. int retransmitCount = 0,
  10. int retransmitIntervalSteps = 0,
})

Will send a ConfigModelPublicationSet message to the given elementAddress.

Implementation

Future<ConfigModelPublicationStatus> sendConfigModelPublicationSet(
  int elementAddress,
  int publishAddress,
  int modelIdentifier, {
  int appKeyIndex = 0,
  bool credentialFlag = false,
  int publishTtl = 15,
  int publicationSteps = 0,
  int publicationResolution = 100,
  int retransmitCount = 0,
  int retransmitIntervalSteps = 0,
}) async {
  final status = _onConfigModelPublicationStatusController.stream.firstWhere(
    (element) =>
        element.elementAddress == elementAddress &&
        element.publishAddress == publishAddress &&
        element.appKeyIndex == appKeyIndex &&
        element.credentialFlag == credentialFlag &&
        element.publishTtl == publishTtl &&
        element.publicationSteps == publicationSteps &&
        element.publicationResolution == publicationResolution &&
        element.retransmitCount == retransmitCount &&
        element.retransmitIntervalSteps == retransmitIntervalSteps &&
        element.modelIdentifier == modelIdentifier,
    orElse: () => const ConfigModelPublicationStatus(-1, -1, -1, false, -1, -1, -1, -1, -1, -1, false),
  );
  await _methodChannel.invokeMethod('sendConfigModelPublicationSet', {
    'elementAddress': elementAddress,
    'publishAddress': publishAddress,
    'appKeyIndex': appKeyIndex,
    'credentialFlag': credentialFlag,
    'publishTtl': publishTtl,
    'publicationSteps': publicationSteps,
    'publicationResolution': publicationResolution,
    'retransmitCount': retransmitCount,
    'retransmitIntervalSteps': retransmitIntervalSteps,
    'modelIdentifier': modelIdentifier,
  });
  return status;
}