Skip to content

Commit

Permalink
10_screen_ipc: allow to run without openthread
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Dec 10, 2024
1 parent 6a079e6 commit 232e34d
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions examples/tutorials/thread_network/10_screen_ipc/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,22 +192,19 @@ static int init_controller_ipc(void) {

if (err_sensor < 0) {
printf("No sensor service\r\n");
return -1;
} else {
printf("[controller] Discovered sensor service: %d\r\n", sensor_svc_num);
ipc_register_client_callback(sensor_svc_num, sensor_callback, NULL);
ipc_share(sensor_svc_num, &temperature_buffer, sizeof(temperature_buffer));
}

if (err_openthread < 0) {
printf("No openthread service\r\n");
return -1;
} else {
printf("[controller] Discovered openthread service: %d\r\n", openthread_svc_num);
ipc_register_client_callback(openthread_svc_num, openthread_callback, NULL);
ipc_share(openthread_svc_num, &openthread_buffer, sizeof(openthread_buffer));
}

printf("[controller] Discovered sensor service: %d\r\n", sensor_svc_num);
printf("[controller] Discovered openthread service: %d\r\n", openthread_svc_num);

ipc_register_client_callback(sensor_svc_num, sensor_callback, NULL);
ipc_register_client_callback(openthread_svc_num, openthread_callback, NULL);

ipc_share(sensor_svc_num, &temperature_buffer, sizeof(temperature_buffer));
ipc_share(openthread_svc_num, &openthread_buffer, sizeof(openthread_buffer));

return err;
}

0 comments on commit 232e34d

Please sign in to comment.