Inside and Out…

An attempt to understand technology better…

Welcome Windows CE Remote API (RAPI) to the managed world

Posted by Gaurav Khanna on February 15, 2005

At the last Mobile and Embedded DevCon held at Bangalore, India, I spoke about the Windows CE Remote API, better known as RAPI.

RAPI is currently not available in the .NET Framework. To alleviate this issue, I have started working on a managed RAPI to get the functionality in the managed world – following is how the code looks like:

CERapi rapi = newCERapi();

if(rapi.Init(5000) != InitReturnCode.Success)
Console.WriteLine(“Unable to initialize RAPI”);
else
{
Console.WriteLine(“Initialized RAPI”);

CESystemInformation si = rapi.SystemInformation;

// Processor Details
Console.WriteLine(“Processor Architecture: {0}”,si.ProcessorType.ToString());
Console.WriteLine(“Processor Level: {0}”,si.ProcessorLevel);

// OS Details
Console.WriteLine(“OS: {0}”,si.OSPlatform.ToString());
Console.WriteLine(“Version: {0}.{1}.{2}”,si.MajorVersion,si.MinorVersion,si.BuildNumber);
Console.WriteLine(“CSD: {0}”,si.CSDVersion);

// Storage Details
Console.WriteLine(“Total Storage: {0} MB”,si.StoreTotalSize/(1024.0*1024.0));
Console.WriteLine(“Free Storage: {0} MB”,si.StoreFreeSize/(1024.0*1024.0));

Console.WriteLine(“Temp Folder: {0}”,si.TempFolderPath);
Console.WriteLine(“Programs Folder: {0}”,si.GetSpecialFolder(CESpecialFolder.Programs));

// shutdown RAPI
if(rapi.Shutdown() == false)
Console.WriteLine(“Unable to shutdown RAPI”);
}

At the last And heres’ the sample output:

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: