或者麻烦哥,你能不能抽空帮我试一下,就是在light_switch server 程序里面加上#define APP_ENTRY_ID MESH_CONFIG_ENTRY_ID(0x0010, 0x0001)
/* Live RAM representation of the value */
static uint32_t m_live_value = 5000;
static uint32_t app_entry_setter(mesh_config_entry_id_t id, const void * p_entry)
{
const uint32_t * p_value = (const uint32_t ) p_entry;
if (p_value >= 10000)
{
/* Rejecting an invalid value. The value will not be stored to persistent storage. */
return NRF_ERROR_INVALID_DATA;
}
m_live_value = *p_value;
return NRF_SUCCESS;
}
static void app_entry_getter(mesh_config_entry_id_t id, void * p_entry)
{
uint32_t * p_value = (uint32_t *) p_entry;
*p_value = m_live_value;
}
MESH_CONFIG_ENTRY(m_app_entry,
APP_ENTRY_ID,
1, // The entry is singular
sizeof(uint32_t),
app_entry_setter,
app_entry_getter,
NULL, // No need for a delete callback
true); // There is a default value
就会出错