This is an example on how to use RSS to execute the diagnostic test
The example executes as follows:
- Register the RSS HAL
- Power on the sensor
- Create diagnostic test
- Enable the sensor
- Execute diagnostic test
- Destroy diagnostic test
- Disable the sensor
- Power off the sensor
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define SENSOR_ID (1U)
#define SENSOR_TIMEOUT_MS (1000U)
{
(void)argc;
(void)argv;
bool test_ok = true;
{
return EXIT_FAILURE;
}
if (buffer == NULL)
{
printf("Diagnostic test: Memory allocation failed\n");
return EXIT_FAILURE;
}
if (assembly_test != NULL)
{
do
{
switch (test_state)
{
break;
{
}
break;
default:
break;
}
}
else
{
printf("Diagnostic test: Could not create assembly test\n");
test_ok = false;
}
if (buffer != NULL)
{
}
if (test_ok)
{
printf("Diagnostic test completed\n");
printf("Application finished OK\n");
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
}