Inside and Out…

An attempt to understand technology better…

Global Memory and Battery Status Support in CERapi

Posted by Gaurav Khanna on February 15, 2005

I just finished implementing support for getting the global memory details and the battery charge details in CERapi – my managed RAPI implementation. To get these details, simply obtain the CESystemInformation instance and use the GlobalMemoryInformation and BatteryInformation properties to get the details, as shown in the code snippet below (si, in the snippet below, is reference to CESystemInformation object):

// Global Memory Details
CEGlobalMemory gm = si.GlobalMemoryInformation;
Console.WriteLine(“Memory Load: {0}”,gm.MemoryLoad);
Console.WriteLine(“Total Physical Memory: {0}”,gm.TotalPhysicalMemory);

// Battery Details
CEBattery bat = si.BatteryInformation;
Console.WriteLine(“ACLine: {0}”,bat.ACLine.ToString());
Console.WriteLine(“Main Battery Remain: {0}%”,bat.MainBatteryRemainLifePercent);
Console.WriteLine(“Main Battery Status: {0}”,bat.MainBatteryCharge);
Console.WriteLine(“Backup Battery Remain: {0}%”,bat.BackupBatteryRemainLifePercent);
Console.WriteLine(“Backup Battery Status: {0}”,bat.BackupBatteryCharge);

bat.Dispose();
gm.Dispose();

I just finished implementing support for getting the global memory details and the battery charge details in

Do you have any suggestions on what functionality you would like to see in CERAPI? If so, mail me.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: