#include "sn.h" #include #include #include #include /******************************************************************************* * EXTERN * *******************************************************************************/ static sn_t m_sn; sn_t* xs_device_info_get() { // sn_t* info = (sn_t*)DEVICE_INFO_START_ADD; m_sn = *info; if (m_sn.year == 255) { m_sn.year = 0; } if (m_sn.weak == 255) { m_sn.weak = 0; } if (m_sn.index == 65535) { m_sn.index = 0; } return &m_sn; } const char* sn_get_str() { sn_t* info = xs_device_info_get(); static char sn_str[32]; sprintf(sn_str, "%s%02d%02d%04d", "SN", info->year, info->weak, info->index); return sn_str; }