Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 18, 2020 20:44
Show Gist options
  • Save parzibyte/dd1007570357a070be7d3971c4bf16f4 to your computer and use it in GitHub Desktop.
Save parzibyte/dd1007570357a070be7d3971c4bf16f4 to your computer and use it in GitHub Desktop.
// La función que será llamada cuando se reciba un
// mensaje en el tópico al que nos vamos a suscribir
void callback(char *topico, byte *cargaUtil, unsigned int longitudDeDatos)
{
Serial.print("Se ha recibido un mensaje en: ");
Serial.println(topico);
Serial.print("Contenido: ");
for (unsigned int i = 0; i < longitudDeDatos; i++)
{
Serial.print((char)cargaUtil[i]);
}
Serial.println();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment