Branch data MC/DC data Line data Source code
1 : : : #include <ecu.h>
2 : : : #include <mcal.h>
3 : : : #include <sys/types.h>
4 : : : #include <unistd.h>
5 : : :
6 : : : #include "dtc_codes_bsw.h"
7 : : : #include "dtc_logger.h"
8 : : :
9 : : : /**
10 : : : * @brief function get by console the status and number of the PIN set it.
11 : : : * @return SUCCESS(0), FAIL(1)
12 : : : */
13 : : :
14 : : 11 : uint8_t read_console(void)
15 : : : {
16 : : 11 : uint8_t pin = 0;
17 : : 11 : uint8_t status = 0;
18 : : 11 : uint8_t ret = SUCCESS;
19 [ + + ]: [ T F ]: 11 : if (read_pint_status(&pin, &status) == FAIL)
20 : : : {
21 : : 1 : REPORT_ERROR("read_pin_status FAIL\n", DTC_READ_PIN_FAIL);
22 : : 1 : ret = FAIL;
23 : : : }
24 : : :
25 [ + + ]: [ T F ]: 7 : if (ret == SUCCESS)
26 : : : {
27 [ + + ]: [ T F ]: 6 : if (set_pin_status(status, pin) == FAIL)
28 : : : {
29 : : 3 : REPORT_ERROR("read_console.set_pin_status FAIL\n", DTC_READ_CONSOLE_FAIL);
30 : : 3 : ret = FAIL;
31 : : : }
32 : : : }
33 : : :
34 : : 7 : return ret;
35 : : : }
|