mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added Intel AMT wake support.
This commit is contained in:
parent
9df9de0922
commit
b12b6fa26b
2 changed files with 22 additions and 0 deletions
|
@ -59,6 +59,11 @@ module.exports.CreateAmtManager = function(parent) {
|
|||
|
||||
// React to node being removed
|
||||
if (event.action == 'removenode') { removeDevice(event.nodeid); }
|
||||
|
||||
// React to node wakeup command, perform Intel AMT wake if possible
|
||||
if ((event.action == 'wakedevices') && (Array.isArray(event.nodeids))) {
|
||||
for (var i in event.nodeids) { performPowerAction(event.nodeids[i], 2); }
|
||||
}
|
||||
}
|
||||
|
||||
// Remove a device
|
||||
|
@ -69,6 +74,18 @@ module.exports.CreateAmtManager = function(parent) {
|
|||
delete obj.amtDevices[nodeid];
|
||||
}
|
||||
|
||||
// Perform a power action: 2 = Power up, 5 = Power cycle, 8 = Power down, 10 = Reset
|
||||
function performPowerAction(nodeid, action) {
|
||||
var dev = obj.amtDevices[nodeid];
|
||||
if ((dev == null) || (dev.amtstack == null)) return;
|
||||
try { dev.amtstack.RequestPowerStateChange(action, performPowerActionResponse); } catch (ex) { }
|
||||
}
|
||||
|
||||
// Response to Intel AMT power action
|
||||
function performPowerActionResponse(stack, name, responses, status) {
|
||||
//console.log('performPowerActionResponse', status);
|
||||
}
|
||||
|
||||
// Update information about a device
|
||||
function fetchIntelAmtInformation(nodeid) {
|
||||
parent.db.Get(nodeid, function (err, nodes) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue