Commit 03634d84 authored by chiaming2000's avatar chiaming2000 Committed by GitHub
Browse files

Merge pull request #41 from Kinetic/features/power-management-staged

Added support for power management.
parents 774bd9f0 e9fec764
Loading
Loading
Loading
Loading
+35 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ option java_outer_classname = "Kinetic";
// the protocol version number by building this message
// and then reading the value.
message Local {
	optional string protocolVersion = 1 [default = "3.0.7"];
	optional string protocolVersion = 1 [default = "3.1.0"];
}

// THe message is an authorization and command bytes.
@@ -190,6 +190,13 @@ message Command {
		// batch operation
		// This is included in the END_BATCH and END_BATCH_RESPONSE.
		optional Batch batch = 9;

		// power management
		optional PowerManagement power = 10;
	}

	message PowerManagement {
		optional PowerLevel level = 1;
	}

	// This is included in the END_BATCH and END_BATCH_RESPONSE.
@@ -290,6 +297,14 @@ message Command {
			// and delete. This error is put against the offending command and "
			// the rest of the commands and the END_BATCH return NOT_ATTEMPTED."
			INVALID_BATCH = 21;

			// the status is returned to caller if commands are received when
			// device is in hibernate state
			HIBERNATE = 22;

			// the status is returned to caller if commands are received when
			// device is shutting down.
			SHUTDOWN = 23;
		}

	}
@@ -521,6 +536,11 @@ message Command {
			optional int32 port = 10;
			optional int32 tlsPort = 11;

			// The unsolicited message at the beginning of a connection will return
			// the drive status. The only two possible values are OPERATIONAL
			// or HIBERNATE.
			optional PowerLevel currentPowerLevel = 18;

			// 18, 19 are reserved.
			message Interface {
				optional string name = 1;
@@ -619,6 +639,7 @@ message Command {
				P2POP = 5; // can do a peer to peer operation
				GETLOG = 7; // can get log
				SECURITY = 8; // can set up the security roles of the device
				POWER_MANAGEMENT = 9; // can setup power management
			}

			// The maxPriority is checked against the header priority and range
@@ -742,6 +763,18 @@ message Command {
		END_BATCH_RESPONSE = 43;
		ABORT_BATCH = 46;
		ABORT_BATCH_RESPONSE = 45;

		// power management
		SET_POWER_LEVEL = 48;
		SET_POWER_LEVEL_RESPONSE = 47;
	}

	enum PowerLevel {
		INVALID_LEVEL = -1;
		OPERATIONAL = 1; // Fully operational mode, default mode for the drive
		HIBERNATE = 2; // All operations will be rejected
		SHUTDOWN = 3;
		FAIL = 4;
	}

}