Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
26
of
174
5.2.2.3. ssize_t write
(…)
Any data is accepted as a watchdog kick.
Argument name
Type
Direction Description
fd
Int
in
File descriptor received at
open
buf
void *
in
Character buffer to read data from
nbytes
size_t
in
Number of bytes to write
Return value
Description
*
nNumber of bytes that were
written.
- 1
see
errno
values
errno values
EPERM
Device was not opened
EBUSY
Device is busy
5.2.2.4.
int ioctl(…)
Ioctl allows for disabling/enabling of the watchdog and setting of the timeout.
Argument name
Type
Direction Description
fd
Int
in
File descriptor received at
open
cmd
Int
in
Command to send
val
Int
in
Data to write
Command table
Val interpretation
WATCHDOG_ENABLE_IOCTL
1 = Enables the watchdog
0 = Disables the watchdog
WATCHDOG_SET_TIMEOUT_IOCTL 0
–
255 = Number of seconds until the watchdog barks
Return value
Description
0
Command executed
successfully
-1
see
errno
values
errno values
EINVAL
Invalid data sent
RTEMS_NOT_DEFINED Invalid I/O command
5.2.3.
Usage description
5.2.3.1. RTEMS
The RTEMS driver must be opened before it can access the watchdog device. Once
opened, all provided operations can be used as described in the RTEMS API defined in
subchapter 5.2.2. And, if desired, the access can be closed when not needed.