Aquisição do número da versão do chip Zigbee EFR

Se o gateway deseja obter o número da versão do aplicativo do lado do firmware, como V1.0.0, isso pode ser obtido por meio deste método. Link de referência
https://www.silabs.com/community/wireless/zigbee-and-thread/knowledge-base.entry.html/2018/09/21/reporting_custommes-cKOS

O princípio é usar o XNCP do Plugin, você pode relatar as informações abaixo, e então o aplicativo de gateway pode analisá-las após receber as informações.

O link acima irá relatar regularmente, podemos relatar uma vez e, em seguida, desligar o relatório.

#define APP_VERSION "1.0"
#define XNCP_CUSTOM_REPORT_APP_VERSION   0xA0

EmberEventControl customReportEventControl;
void customReportEventHandler(void)
{
      char msg[32];
      msg[0] = XNCP_CUSTOM_REPORT_APP_VERSION;
      sprintf(&msg[1], "v%s",APP_VERSION);
      emberAfPluginXncpSendCustomEzspMessage(sizeof(msg), msg);
      emberEventControlSetInactive(customReportEventControl);
}


/** @brief Performs any additional initialization required at system startup.
 *
 * This function is called when the application starts and can be used to
 * perform any additional initialization required at system startup.
 */
void emberAfMainInitCallback(void) {
 // your code here
	emberEventControlSetDelayMS(customReportEventControl, 2000);
}

O efeito final é o seguinte:

Acho que você gosta

Origin blog.csdn.net/xingzhibo/article/details/108620471
Recomendado
Clasificación