Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

RebootRTSystem

LabWindows/CVI 8.5 Help
November 2007

NI Part Number:
370051K-01

»View Product Info

int RebootRTSystem (char address[], int addressType, int timeout, ProgressCallback callback, void *callbackData);

Purpose

Reboots a remote real-time system.

If you specify a timeout, this function waits for the reboot to complete before returning. Otherwise, the function returns immediately.

You can provide a callback to asynchronously receive updates on the progress of the reboot.

Windows This function is supported only on Windows.

Parameters

Input
Name Type Description
address char [] Specifies RT system on which to operate. You can pass the IP address, DNS-resolvable hostname, or MAC address.

You must specify IP addresses in dot-decimal format, as a sequence of 4 decimal octets separated by dots. An example of an IP address is 127.0.0.1.

You must specify MAC addresses as a sequence of 6 hexadecimal octets separated by colons. An example of a MAC address is 00:AB:11:CD:2e:3f. Letters can be uppercase, lowercase, or mixed case.

Note    Newly formatted or otherwise unconfigured systems, which appear in MAX 0.0.0.0, do not have assigned IP addresses. To call this function on an unconfigured system, you must specify its MAC address.
addressType int Specifies the type of address string you pass to the address parameter.

You can pass one of the following values:

Value Description Example
AddressType_IP An IP address or DNS-resolvable hostname. 127.0.0.1
SomeHost
AddressType_MAC A MAC address. 01:23:45:AB:CD:EF
timeout int The maximum number of seconds to wait for the system to finish rebooting before returning the error kRTTimeout.

To have the function return immediately without waiting for the reboot to complete, pass -1.
callback ProgressCallback A callback function that receives notification of events that occur on the system. You can pass NULL if you do not want to register a callback.

The callback function, type ProgressCallback, takes the following form:

int CVICALLBACK CallbackFunc (const char *systemIP, const char *systemMAC, int event, void *eventData1, void *eventData2, void *callbackData);

The callback is executed in a separate thread every time a RTUtilEvent occurs on the system. If you are interested only in certain events, your callback must examine the event parameter passed in. The systemIP parameter contains the IP address of the system for which the event occurred. The systemMAC parameter contains the system MAC address. The callback return value is ignored.

You do not need to explicitly unregister your callback. The callback stop receiving notifications once the operation for which it was registered has completed. Just before the callback is unregistered, it receives the RTUtilEvent_CallbackUnregistered event to indicate that it is safe to clean up callbackData, if necessary.

The following lists RTUtilEvent events and relevant details for each event:

Event Description
RTUtilEvent_NewSystemStatus The status of the system changed.

eventData1 (int *)—Pointer to the new status. One of RTSystemStatus_Rebooting,
RTSystemStatus_Initializing,
RTSystemStatus_Connected,
RTSystemStatus_Disconnected,
RTSystemStatus_Unconfigured,
RTSystemStatus_Unknown
RTUtilEvent_BeginCreateImage Beginning image creation operation.
RTUtilEvent_EndCreateImage Finished image creation operation.

eventData1 (int *)—Pointer to the return code.
RTUtilEvent_BeginApplyImage Beginning image application operation.
RTUtilEvent_EndApplyImage Finished image application operation.

eventData1 (int *)—Pointer to the return code.
RTUtilEvent_BeginFormatSystem Beginning system HD format operation.
RTUtilEvent_EndFormatSystem Finished system HD format operation.

eventData1 (int *)—Pointer to the return code.
RTUtilEvent_EnumRemoteFiles Enumerating files on the remote system.
RTUtilEvent_CreateLocalDirs Creating local image directory hierarchy.
RTUtilEvent_BeginTransferFiles Beginning transfer of a batch of files to/from the remote system.

eventData1 (int *)—Pointer to the number of files.
RTUtilEvent_EndTransferFiles Finished tranferring a batch of files to/from the remote system.

eventData1 (int *)—Pointer to the number of failures.
eventData2 (const char *)—Semicolon-separated list of failed file paths.
RTUtilEvent_DeleteExistingFiles Deleting files and/or directories from the remote system.

eventData1 (int *)—Pointer to the number of files to delete.
eventData2 (int *)—Pointer to the number of directories to remove.
RTUtilEvent_CheckingForSafeMode Checking that the remote system is booted into safe mode.
RTUtilEvent_RebootIntoSafeMode Rebooting the remote system into safe mode.
RTUtilEvent_RebootIntoInstallMode Rebooting the remote system into install mode.
RTUtilEvent_BeginReboot Rebooting the remote system.
RTUtilEvent_BeginFormattingHD Beginning hard drive format.
RTUtilEvent_EndFormattingHD Hard drive finished reformatting.
RTUtilEvent_GetFile Getting a file from the remote system.

eventData1 (const char *)—File path (local).
eventData2 (int *)—Pointer to the 0-based index (in the batch).
RTUtilEvent_PutFile Sending a file to the remote system.

eventData1 (const char *)—File path (remote).
eventData2 (int *)—Pointer to the 0-based index (in the batch).
RTUtilEvent_DeleteFile Deleting a file from the remote system.

eventData1 (const char *)—File path.
eventData2 (int *)—Pointer to the 0-based index (in the batch).
RTUtilEvent_DeleteDir Deleting a directory from the remote system.

eventData1 (const char *)—Directory path.
eventData2 (int *)—Pointer to the 0-based index (in the batch).
RTUtilEvent_CreateLocalDir Creating a local directory.

eventData1 (const char *)—Directory path.
eventData2 (int *)—Pointer to the 0-based index (in the batch).
RTUtilEvent_CreateRemoteDir Creating a directory on the remote system.

eventData1 (const char *)—Directory path.
eventData2 (int *)—Pointer to the 0-based index (in the batch).
RTUtilEvent_CallbackUnregistered The callback is about to be unregistered. You can deallocate callbackData if necessary.
callbackData void * A 4-byte value the library passes to the callback function through the callbackData parameter.

You can use the callbackData as an integer value or as a pointer to a data object you want to access in the callback function. In this way, you do not have to declare the data object as a global variable.

Return Value

Name Type Description
status integer Return value indicating whether the function was successful. Unless otherwise stated, zero indicates successful execution and a negative number indicates that an error occurred.

You can call the GetRTUtilErrorString function to obtain a message that describes the error.

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit