Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
25
of
174
5.2. Watchdog
5.2.1. Description
This section describes the driver as one utility for accessing the watchdog device.
5.2.2. RTEMS API
This API represents the
driver interface from a user application’s perspective for the RTEMS
driver.
The driver functionality is accessed through RTEMS POSIX API for ease of use. In case of
failure on a function call, the
errno
value is set for determining the cause.
5.2.2.1. int open
(…)
Opens access to the bare metal driver. The device can only be opened once at a time.
Argument name
Type
Direction Description
filename
char *
in
The absolute path to the file that is to be
opened. Watchdog device is defined as
RTEMS_WATCHDOG_DEVICE_NAME
(/dev/watchdog)
oflags
int
in
A bitwise 'or' separated list of values that
determine the method in which the file is to be
opened (whether it should be read only,
read/write).
Return value
Description
> 0
A file descriptor for the device
on success
- 1
see
errno
values
errno values
EALREADY
Device already opened.
5.2.2.2. int close
(…)
Closes access to the device.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at
open
Return value
Description
0
Device closed successfully
-1
see
errno
values
errno values
EPERM
Device is not open.