willCallback method

bool willCallback(
  1. List<int> data
)

Return true if the given response indicates that the device will send the requested information in a separate unsolicited request/notification.

Implementation

bool willCallback(List<int> data) {
  /*
  Check for a response such as

   0x01, // SOF
   0x04, // length excluding SOF and checksum
   0x01, // response
   0x13, // FUNC_ID_ZW_SEND_DATA

   0x00 or 0x01 // source node ???

   0xE8, // checksum

  indicating that the device will be sent an unsolicited request/notification
  with additional information for the command just processed.
 */
  return data.length == 6 &&
      data[3] == FUNC_ID_ZW_SEND_DATA &&
      (data[4] == 0x00 || data[4] == 0x01);
}