 
 
   // send received MQTT value by IR signal
-  sendIRCode(ir_type, code,
-             callback_str.substring(callback_str.indexOf(",") + 1).c_str(),
-             nbits, repeat);
+  lastSendSucceeded = sendIRCode(
+      ir_type, code,
+      callback_str.substring(callback_str.indexOf(",") + 1).c_str(),
+      nbits, repeat);
 }
 
 // Callback function, when the gateway receive an MQTT value on the topics

// Args:
//   irType: Nr. of the protocol we need to send.
//   str: A hexadecimal string containing the state to be sent.
void parseStringAndSendAirCon(const uint16_t irType, const String str) {
  uint8_t strOffset = 0;
  uint8_t state[kStateSizeMax] = {0};  // All array elements are set to 0.
  uint16_t stateSize = 0;

        c = c - 'a' + 10;
    } else {
      debug("Aborting! Non-hexadecimal char found in AirCon state: " + str);
      return false;
    }
    if (i % 2 == 1) {  // Odd: Upper half of the byte.
      *statePtr += (c << 4);
