Si la puerta de enlace desea obtener el número de versión de la aplicación del lado del firmware, como V1.0.0, se puede lograr mediante este método. Enlace de referencia
https://www.silabs.com/community/wireless/zigbee-and-thread/knowledge-base.entry.html/2018/09/21/reporting_custommes-cKOS
El principio es usar el XNCP del complemento, puede informar la información a continuación y luego la aplicación de puerta de enlace puede analizarla después de recibir la información.
El enlace anterior informará con regularidad, podemos informar una vez y luego apagar el informe.
#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);
}
El efecto final es el siguiente: