toString method

  1. @override
String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.

Implementation

@override
String toString () {
  StringBuffer sb = StringBuffer();

  sb.write('touchVersion: ${_array2String(touchVersion, 64)}, ');
  sb.write('softwareVersion: ${_array2String(softwareVersion, 64)}, ');
  sb.write('radioVersion: ${_array2String(radioVersion, 64)}, ');
  sb.write('clingId: ${_array2String(clingId, 64)}, ');
  sb.write('modelNumber: ${_array2String(modelNumber, 64)}, ');
  sb.write('batteryLevel: $batteryLevel, ');
  sb.write('memoryAvailable: 0x${memoryAvailable.toRadixString(16)}($memoryAvailable), ');
  sb.write('fileAvailable: 0x${fileAvailable.toRadixString(16)}($fileAvailable), ');
  sb.write('bondUserID: 0x${bondUserID.toRadixString(16)}($bondUserID), ');
  sb.write('bondEpoch: 0x${bondEpoch.toRadixString(16)}($bondEpoch), ');
  sb.write('resetCount: $resetCount, ');
  sb.write('gps_blk_count: $gps_blk_count, ');
  sb.write('minuteStreamingFile: $minuteStreamingFile, ');
  sb.write('clkfaceIndex0: 0x${clkfaceIndex0.toRadixString(16)}($clkfaceIndex0), ');
  sb.write('clkfaceIndex1: 0x${clkfaceIndex1.toRadixString(16)}($clkfaceIndex1), ');
  sb.write('clkfaceIndex2: 0x${clkfaceIndex2.toRadixString(16)}($clkfaceIndex2), ');
  sb.write('clkfaceIndex3: 0x${clkfaceIndex3.toRadixString(16)}($clkfaceIndex3), ');
  sb.write('flashtype: $flashtype, ');
  sb.write('validMac: 0x${validMac.toRadixString(16)}($validMac), hasValidMac: $hasValidMac, ');
  sb.write('mac: ');
  for (int i = 0; i < MAC_ADDR_NUM; i ++) {
    sb.write(mac[MAC_ADDR_NUM-1-i].toRadixString(16));
    if (i < MAC_ADDR_NUM-1) {
      sb.write(':');
    }
  }

  return sb.toString();
}