formatAck method
formatAck formats the ACK message to send to the Layrz ecosystem.
Implementation
String formatAck(String response) {
String parsedMessage = '';
DateTime now = DateTime.now();
parsedMessage += '${now.millisecondsSinceEpoch ~/ 1000};';
parsedMessage += '$commandId;';
parsedMessage += '$response;';
final crc16 = calculateCrc(parsedMessage.codeUnits).toRadixString(16).padLeft(4, '0');
parsedMessage += crc16;
return "<Pc>$parsedMessage</Pc>";
}