How to reboot a device using EMDK

So, I've read through the Power Managment tutorial. While I can follow the tutorial, it seems like a lot of extra work is done with manual additions to the XML. My understanding of the XML profiles is that they should declare permissions, that can then be acted upon through the code, similar to the way that the Scanner API can be accessed.

 

While I'm aware this isn't how it works, this is what I expect:

 

PowerManager powerManager = (PowerManager) emdkManager.getInstance(EMDKManager.FEATURE_TYPE.POWER);

powerManager.reboot();

 

Obviously, this isn't the case, but is there a way I can do something similar? My hope would be to declare my profile ahead of time (rather than parse XML at runtime), and simply operate based off of these predefined capabilities.

Anonymous (not verified)
Matt, xml parsing is not

Matt, xml parsing is not necessary, unless you want to parse for an error.  Just setup your profile to reboot the device and submit via process profile. There is also a sample app Rebooting The Device - Zebra Technologies Online Documentation

In the sample in the modifyProfile_XMLString() method just pass an empty string as  modifyData.

i.e.  modifyData[0]= ""

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Matt Laser
Thanks Bill.  This is helpful

Thanks Bill.  This is helpful.

Since profiles are "processed" by name, does that mean if I wanted to say, set the device audio to vibrate OR reboot the device, I would need two different profiles? And, if so, would I have to manually split these up inside of EMDKConfig.xml (since the wizard puts all characteristics/permissions under the same profile name)?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
You do not need to do that

You do not need to do that manually. In Profile Manager, just create multiple profiles, and then submit each by name depending on your logic. Profile manager will place both profiles in the same EMDKConfig.xml.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Matt Laser
Ah, I gotcha. In my head I

Ah, I gotcha. In my head I was thinking that the EMDKConfig had to be mapped to a singular profile. Thanks Bill!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments