Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sink Service: test connection with sink #50

Merged
merged 1 commit into from
Jun 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions sink_service/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ int main(int argc, char * argv[])
int r;
int c;
unsigned int sink_id = 0;
uint16_t mesh_version;

/* Parse arguments */
while ((c = getopt(argc, argv, "b:p:i:")) != -1)
Expand Down Expand Up @@ -110,6 +111,14 @@ int main(int argc, char * argv[])
return EXIT_FAILURE;
}

/* Do sanity check to test connectivity with sink */
if (WPC_get_mesh_API_version(&mesh_version) != APP_RES_OK)
{
LOGE("Cannot establish communication with sink over UART\n");
return EXIT_FAILURE;
}
LOGI("Node is running mesh API version %d\n", mesh_version);

/* Connect to the user bus */
r = sd_bus_open_system(&m_bus);
if (r < 0)
Expand Down