This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| app-notes:metric-cloudsetup:sdk-dio-mqtt-subscribe [2020/11/12 13:50] – created erdmann | app-notes:metric-cloudsetup:sdk-dio-mqtt-subscribe [2021/07/27 12:09] (current) – dodenhoeft | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Mqtt subscribe DIO Status ====== | ||
| + | |||
| + | The following script will send a subscribe message to the topic, if DIO status has been changed. | ||
| + | |||
| <file c sdk-dio-mqtt-subscribe.are> | <file c sdk-dio-mqtt-subscribe.are> | ||
| HOST = " | HOST = " | ||
| Line 46: | Line 50: | ||
| if(buffer==" | if(buffer==" | ||
| - | printf(" | + | printf(" | 
| if (nb_dio_set(" | if (nb_dio_set(" | ||
| - | printf(" | + | printf(" | 
| exit(1); | exit(1); | ||
| } | } | ||
| }else { | }else { | ||
| if(buffer==" | if(buffer==" | ||
| - | printf(" | + | printf(" | 
| if (nb_dio_set(" | if (nb_dio_set(" | ||
| - | printf(" | + | printf(" | 
| exit(1); | exit(1); | ||
| } | } | ||
| Line 62: | Line 66: | ||
| //For debugging | //For debugging | ||
| - | // | ||
| // | // | ||
| - | // | ||
| - | |||
| if(ret< | if(ret< | ||