data property

  1. @override
List<int> get data
override

Return the complete message to be sent out on the Z-Wave network

Implementation

@override
List<int> get data {
  final data = <int>[
    SOF, // start of frame
    3, // length
    REQ_TYPE, // request
    functId,
  ];

  // Add function parameters if there are any
  var param = functParam;
  if (param != null) {
    data.addAll(param);
    data[1] = data.length - 1; // update length field
  }

  // Calculate and append checksum
  var crc = 0xFF;
  for (var index = 1; index < data.length; ++index) crc ^= data[index];
  data.add(crc);

  return data;
}