NetBurner 3.5.0
PDF Version |
|
The NBApproveShutdown callback function can be used by an application to put the system in a safe state before an application update, configuration update, or reboot event occurs. For example, closing active TCP sockets, ensuring Flash and/or file system write operations are complete, and putting critical peripherals in a safe state. The NBApproveShutdown() function as a weak reference to a system function that always returns true by default. If an application creates it's own function using the same signature, that function will be used instead.
A reason for the reboot request is passed to the function. The system will automatically call NBapproveShutdown() for the following reasons:
An application can choose to ignore the parameters or add it's own. For custom reasons, the application should call NBApproveShutdown() with the appropriate reason:
This example provides a serial port menu with options enable or disable a reboot for application or settings updates. For testing purposes you can select reboot from the serial menu, or attempt an application code update.