Pwr_Stat.ada - Intermec Janus 2010 Reference Manual

Intermec janus 2010: reference guide
Hide thumbs Also See for Janus 2010:
Table of Contents

Advertisement

PWR_STAT.ADA

-- File Name:
pwr_stat.ada
--
-- Purpose:
This sample program demonstrates Intermec's
--
Ada procedure im_power_status. It retrieves the AC line status,
--
battery status, backup battery status, and the percentage
--
of remaining life in the battery.
--
-- COPYRIGHT (c) 1994 INTERMEC CORPORATION, ALL RIGHTS RESERVED
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use
System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure pwr_stat Is
package SYSBYTE_IO is new INTEGER_IO (System.Byte);
line_status
: IM_LINE_STATUS;
battery_status : IM_BATTERY_STATUS;
backup_status
: IM_BACKUP_STATUS;
fuel_gauge
: System.Byte;
status
: System.Word;
in_char
: Character := ' ';
begin
loop
exit when in_char = 'q';
Put_Line("Checking power");
New_Line;
im_power_status(line_status, battery_status, backup_status,
fuel_gauge, status);
if im_isgood(status) then
Put_Line("Line Status: ");
case line_status is
when IM_ACline_NOT_CONNECTED =>
Put_Line("Not connected");
when IM_ACline_CONNECTED =>
Put_Line("Connected");
when IM_UNKNOWN_ACline =>
Put_Line("Unknown");
when others =>
Put_Line("Invalid");
end case;
New_Line;
Put_Line("Battery Status: ");
case battery_status is
when IM_HIGH_BAT =>
Put_Line("Charge high");
when IM_LOW_BAT =>
Put_Line("Charge low");
B
PWR_STAT.ADA
B-7

Advertisement

Table of Contents
loading

This manual is also suitable for:

Janus 2050Janus 2020Janus psk for ada

Table of Contents