User App Deployment
This feature is supported only in FX Series reader. The GPI’s following functionalities are supported for facilitating embedded user application on the FX Series.
- Installation and un-installation of the user application
- Listing the set of currently installed user applications
- Starting and Stopping the user application
- Getting the current Run status
- Auto start of the upper application on reader reboot
The methods that are exposed in rfidApi to support of deployment of user application are: rm.UserApp.Install, rm.UserApp.Uninstall, rm.UserApp.Start, rm.UserApp.Stop, rm.UserApp.GetRunStatus, rm.UserApp.List and rm.UserApp.AutoStart
String appName;
Boolean found = false;
String pkgLocation;
Boolean autoStart = true;
Boolean exit = false;
String option;
try
{
Console.WriteLine("Enter the name of the application:");
appName = Console.ReadLine();
Console.WriteLine("Enter the path to the package:");
pkgLocation = Console.ReadLine();
while (true)
{
Console.WriteLine("User Application Deployment");
Console.WriteLine("1. Install");
Console.WriteLine("2. Uninstall");
Console.WriteLine("3. Start");
Console.WriteLine("4. Stop");
Console.WriteLine("5. AutoStart");
Console.WriteLine("6. List");
Console.WriteLine("7. Status");
Console.WriteLine("8. Exit");
option = Console.ReadLine();
if (option == "1")
{
rm.UserApp.Install(pkgLocation);
Console.WriteLine("Successfully installed application package");
}
else if (option == "2")
{
rm.UserApp.Uninstall(appName);
Console.WriteLine("Successfully uninstalled app");
}
else if (option == "3")
{
rm.UserApp.Start(appName);
Console.WriteLine("Successfully started app");
}
else if (option == "4")
{
rm.UserApp.Stop(appName);
Console.WriteLine("Successfully stopped app");
}
else if (option == "5")
{
String szoption;
LogMessage("1. Enable");
LogMessage("2. Disable");
szoption = Console.ReadLine();
if (szoption == "1")
autoStart = true;
else
autoStart = false;
rm.UserApp.AutoStart(appName, autoStart);
if (autoStart == true)
Console.WriteLine("Successfully enabled autostart");
else
Console.WriteLine("Successfully disabled autostart");
}
else if (option == "6")
{
UserAppInfo[] appList = rm.UserApp.List();
if (appList != null && appList.Length > 0)
{
foreach (UserAppInfo appInfo in appList)
{
Console.WriteLine((appInfo.AppName + ":" + appInfo.MetaData));
}
}
else
Console.WriteLine("No Apps installed");
}
else if (option == "7")
{
bool runStatus = false;
rm.UserApp.GetRunStatus(appName, ref runStatus);
if (runStatus == true)
Console.WriteLine("App is running");
else
Console.WriteLine("App is not running");
}
else if (option == "8")
{
break;
}
}
}
catch (Exception ex)
{
Console.WriteLine("User App Deployment Failed " + ex.ToString());
}