Skip to content

Commit

Permalink
Log: add more traces at start time
Browse files Browse the repository at this point in the history
- print stack version when reading it
- print stack state (could help to diagnose easy issues
  • Loading branch information
Gwendal Raoul authored and GwendalRaoul committed Sep 22, 2020
1 parent 8df82f8 commit 6cc763b
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion sink_service/source/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,24 @@ static bool initialize_unmodifiable_variables()
NULL,
"App Config Max size");

res &= (WPC_get_firmware_version(m_sink_config.version) != APP_RES_OK);
if (WPC_get_firmware_version(m_sink_config.version) == APP_RES_OK)
{
LOGI("Stack version is: %d.%d.%d.%d\n",
m_sink_config.version[0],
m_sink_config.version[1],
m_sink_config.version[2],
m_sink_config.version[3]);
}
else
{
res = false;
}

if (!res)
{
LOGE("All the static settings cannot be read\n");
}

return res;
}

Expand All @@ -652,6 +669,7 @@ static void on_stack_boot_status(uint8_t status)
int Config_Init(sd_bus * bus, char * object, char * interface)
{
int r;
uint8_t status;

m_bus = bus;
m_object = object;
Expand All @@ -676,6 +694,16 @@ int Config_Init(sd_bus * bus, char * object, char * interface)
return r;
}

/* Get the current stack status for informative purpose */
if (WPC_get_stack_status(&status) == APP_RES_OK)
{
LOGI("Stack is %s\n", status == 0 ? "started" : "stopped");
}
else
{
LOGE("Cannot determine stack state\n");
}

return 0;
}

Expand Down

0 comments on commit 6cc763b

Please sign in to comment.