beautypg.com

Hm_getbootreason, Syntax, Remarks – Rockwell Automation 6182 SDK User Manual

Page 89: Return value, Portability

background image

RAC6182-Specific Extensions to the CE API

4–49

Publication 6182-UM002B-EN-P

hm_GetBootReason

This function gets the reason for last boot. It is prototyped in
HardwareMonitorAPI.h.

Syntax

#include
#include

DWORD hm_GetBootReason (void)

Remarks
This function returns a DWORD representing the reason the board was
last booted. Magic cookies and intelligent selection of default cases are
used to distinguish as many scenarios as possible. However, the method
relies on the probability that DRAM will hold a value for 10s of
milliseconds without refresh, and on other such factors. Accordingly, the
returned value cannot be guaranteed to be correct, especially in cases of
very brief power interruptions.

Return Value
Return values are represented by macros defined in
HardwareMonitorAPI.h.

Macro

Description

BOOT_REASON_
UNTRAPPED

Board was reset after a power-up boot, not by a
user or operating system call, but most likely by the
watchdog.

BOOT_REASON_
COLD_POWER_
CYCLE

Board went through a normal power-up boot.

BOOT_REASON_
POWER_DOWN_
CLEAN

Board was previously powered down when power
fail monitor level was set, and either no applications
were registered for power down event handling, or
all applications registered completed their shutdown
activities and signaled this to the operating system.

BOOT_REASON_
POWER_DOWN_
DIRTY

Board was previously power down when power fail
monitor level was set, but at least one application
registered for a power down event did not signal that
it completed its shutdown activities.

BOOT_REASON_
WARM_UNDEFINED

Board was reset for an unknown reason

BOOT_REASON_
WARM_REQUESTED

Board was reset by an application call to
hm_RebootBoard.

BOOT_REASON_
WARM_INTERNAL

Board was reset by some operating system
operation

Portability
This function is specific to the RAC6182 hardware.

This manual is related to the following products: