Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4Java)  1.26.2
Watchdog.java
Go to the documentation of this file.
1 // -----------------------------------------------------------------------
2 // MLPI - <Watchdog.java>
3 // -----------------------------------------------------------------------
4 // Copyright (c) 2012 Bosch Rexroth. All rights reserved.
5 // Redistribution and use in source and binary forms of this MLPI software
6 // (SW) provided to you, with or without modification, are permitted
7 // without prior approval provided that the following conditions are met:
8 //
9 // 1. Redistributions of source code of SW must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form of SW must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // 3. User recognizes and acknowledges that it acquires no right,
17 // title or interest in or to any of the names or trademarks used in
18 // connection with the SW ("names") by virtue of this License and waives
19 // any right to or interest in the names. User recognizes and acknowledges
20 // that names of companies or names or products of companies displayed
21 // in the documentation of SW to indicate the interoperability of products
22 // with the SW are the names of their respective owners. The use of such
23 // names in the documentation of SW does not imply any sponsorship,
24 // approval, or endorsement by such companies of this product.
25 //
26 // 4. Modified code versions, i.e. any addition to or deletion from
27 // the substance or structure of the original code of the SW running
28 // the MLPI must be plainly marked as such and must not be misrepresented
29 // as being original SW.
30 //
31 // 5. The SW may only be used in connection with a Bosch Rexroth product.
32 //
33 // THIS INFORMATION IS PROVIDED BY BOSCH REXROTH CORPORATION "AS IS"
34 // AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING
35 // (BUT NOTLIMITED TO) ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
36 // FITNESS FOR ANY PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WHILE THE
37 // INFORMATION PROVIDED IS BELIEVED TO BE ACCURATE, IT MAY INCLUDE
38 // ERRORS OR INACCURACIES.
39 // SUBJECT TO COMPULSORY STATUTORY PROVISIONS OF THE GERMAN LAW AS
40 // THE APPLICABLE LAW FOR THIS LICENSE BOSCH REXROTH CORPORATION WILL
41 // NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF
42 // THE SOFTWARE DISTRIBUTED HEREUNDER, INCLUDING BUT NOT LIMITED TO
43 // DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, AND CONSEQUENTIAL DAMAGES.
44 // -----------------------------------------------------------------------
45 //
55 //
56 // -----------------------------------------------------------------------
57 package com.boschrexroth.mlpi;
58 
59 
70 public class Watchdog extends MlpiComponent {
71  /*
72  * Enums
73  */
85  public enum WatchdogAction
86  {
87  WATCHDOG_REBOOT (0x00),
88  WATCHDOG_PLCSTOPP (0x01),
89  WATCHDOG_ERROR (0x02),
90  WATCHDOG_WARNING (0x03);
91 
92  private int _code;
93  int getCode() { return _code; }
94  WatchdogAction(int code) { this._code = code; }
95  static WatchdogAction valueOf(int code) {
96  for (WatchdogAction value : values()) {
97  if (code == value.getCode()) return value;
98  }
99  return null;
100  }
101  }
102 
113  public enum WatchdogState
114  {
115  WATCHDOG_DISABLED (0x00),
116  WATCHDOG_ENABLED (0x01),
117  WATCHDOG_TIMEOUT (0x02);
118 
119  private int _code;
120  int getCode() { return _code; }
121  WatchdogState(int code) { this._code = code; }
122  static WatchdogState valueOf(int code) {
123  for (WatchdogState value : values()) {
124  if (code == value.getCode()) return value;
125  }
126  return null;
127  }
128  }
129 
130  /*
131  * Methods
132  */
133  Watchdog(MlpiHandle connection) {
134  super(connection);
135  }
136 
151  public native void setup(int timeout, WatchdogAction action);
152 
163  public native void start();
164 
175  public native void stop();
176 
187  public native void reset();
188 
202  public native WatchdogState getState();
203 }
This enumeration describes the state of a watchdog.
Definition: Watchdog.java:113
native WatchdogState getState()
This enumeration must be used to define the action to execute when a watchdog has expired...
Definition: Watchdog.java:85
Class definition of the WatchdogLib.
Definition: Watchdog.java:70
native void setup(int timeout, WatchdogAction action)