Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: IRMQTTServer: Incorrect acknowledgements for some A/C protocols. #460

Merged
merged 1 commit into from
May 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 24 additions & 26 deletions examples/IRMQTTServer/IRMQTTServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1195,35 +1195,33 @@ void sendIRCode(int const ir_type, uint64_t const code, char const * code_str,
// Indicate that we sent the message.
debug("Sent the IR message.");
debug("Type: " + String(ir_type));
switch (ir_type) {
case KELVINATOR:
case PRONTO:
case RAW:
case GLOBALCACHE:
debug("Code: ");
debug(code_str);
debug("Repeats: " + String(repeat));
// Confirm what we were asked to send was sent.
// For "long" codes we basically repeat what we got.
if (hasACState((decode_type_t) ir_type) ||
ir_type == PRONTO ||
ir_type == RAW ||
ir_type == GLOBALCACHE) {
debug("Code: ");
debug(code_str);
debug("Repeats: " + String(repeat));
// Confirm what we were asked to send was sent.
#ifdef MQTT_ENABLE
if (ir_type == PRONTO && repeat > 0)
mqtt_client.publish(MQTTack, (String(ir_type) + ",R" +
String(repeat) + "," +
String(code_str)).c_str());
else
mqtt_client.publish(MQTTack, (String(ir_type) + "," +
String(code_str)).c_str());
if (ir_type == PRONTO && repeat > 0)
mqtt_client.publish(MQTTack, (String(ir_type) + ",R" +
String(repeat) + "," +
String(code_str)).c_str());
else
mqtt_client.publish(MQTTack, (String(ir_type) + "," +
String(code_str)).c_str());
#endif // MQTT_ENABLE
break;
default:
debug("Code: 0x" + uint64ToString(code, 16));
debug("Bits: " + String(bits));
debug("Repeats: " + String(repeat));

} else { // For "short" codes, we break it down a bit more before we report.
debug("Code: 0x" + uint64ToString(code, 16));
debug("Bits: " + String(bits));
debug("Repeats: " + String(repeat));
#ifdef MQTT_ENABLE
mqtt_client.publish(MQTTack, (String(ir_type) + "," +
uint64ToString(code, 16)
+ "," + String(bits) + "," +
String(repeat)).c_str());
mqtt_client.publish(MQTTack, (String(ir_type) + "," +
uint64ToString(code, 16)
+ "," + String(bits) + "," +
String(repeat)).c_str());
#endif // MQTT_ENABLE
}
}
Expand Down