Class SendMessage<R extends ResponseData>
java.lang.Object
org.metricshub.ipmi.core.coding.PayloadCoder
org.metricshub.ipmi.core.coding.commands.IpmiCommandCoder<R>
org.metricshub.ipmi.core.coding.commands.app.SendMessage<R>
- Type Parameters:
R- the type of the response of the carried command
Send Message with response tracking (IPMI 2.0 sections 6.13.3 and 22.7): carries the request of another command to
a controller behind the BMC, a satellite management controller on the IPMB for instance, and returns the response
of that controller, decoded by that command.
new SendMessage<>(0, 0x2C, new GetSensorReading(5, 0)) reads
sensor 5 of the controller at slave address 2Ch on the primary IPMB.
The BMC answers the Send Message request at once, then forwards the response of the controller under the sequence
number of the carried request, which is the one of the Send Message request. Some BMCs put the response of the
controller in their response to Send Message instead: both are accepted. A request the BMC acknowledged
(isAcknowledged()) that gets no response of the controller says nothing about the session: the controller
may be absent or busy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteCommand code of Send Message (IPMI 2.0 table G-1). -
Constructor Summary
ConstructorsConstructorDescriptionSendMessage(int channel, int address, IpmiCommandCoder<R> command) Creates the command. -
Method Summary
Modifier and TypeMethodDescriptionbooleananswers(IpmiLanMessage reply) Tells whether a reply ends the exchange: the response of the controller, or the response to Send Message when the BMC refused to forward the request or put the response of the controller in it.static StringdescribeCompletionCode(int rawCode) Describes a completion code specific to Send Message (IPMI 2.0 table 22-9).Returns the command carried to the controller.byteRetrieves command code specific for command represented by this classRetrieves network function specific for command represented by this class.getResponseData(IpmiMessage message) Retrieves payload-specific response data from IPMI messagebooleanTells whether the BMC answered Send Message itself with success to the latest try of this request: it then forwarded the request, and a missing response is the one of the controller, not of the BMC.Methods inherited from class org.metricshub.ipmi.core.coding.commands.IpmiCommandCoder
getNetworkFunctionCode, getSupportedPayloadType, isCommandResponseMethods inherited from class org.metricshub.ipmi.core.coding.PayloadCoder
encodePayload, getAuthenticationType, getCipherSuite, getIpmiVersion, setAuthenticationType, setCipherSuite, setIpmiVersion, setSessionParameters
-
Field Details
-
COMMAND_CODE
public static final byte COMMAND_CODECommand code of Send Message (IPMI 2.0 table G-1).- See Also:
-
-
Constructor Details
-
SendMessage
Creates the command.- Parameters:
channel- the channel the controller is on, as its SDR records give it: 0 for the primary IPMBaddress- the slave address of the controller in its 8-bit form (the 7-bit address shifted left, bit 0 clear), 2Ch for instancecommand- the command to carry to the controller; its LUN is the one it is built with- Throws:
IllegalArgumentException- when the channel is not 0 to 15, or the address is not an even number from 00h to FEh (an odd one is a software ID, which no controller answers to)
-
-
Method Details
-
getCommand
Returns the command carried to the controller.- Returns:
- the command
-
isAcknowledged
public boolean isAcknowledged()Tells whether the BMC answered Send Message itself with success to the latest try of this request: it then forwarded the request, and a missing response is the one of the controller, not of the BMC.- Returns:
- whether the BMC acknowledged the request
-
getCommandCode
public byte getCommandCode()Description copied from class:IpmiCommandCoderRetrieves command code specific for command represented by this class- Specified by:
getCommandCodein classIpmiCommandCoder<R extends ResponseData>- Returns:
- command code
-
getNetworkFunction
Description copied from class:IpmiCommandCoderRetrieves network function specific for command represented by this class.- Specified by:
getNetworkFunctionin classIpmiCommandCoder<R extends ResponseData>- Returns:
- network function, or null for a command of a network function
NetworkFunctiondoes not list, which overridesIpmiCommandCoder.getNetworkFunctionCode()instead - See Also:
-
answers
Tells whether a reply ends the exchange: the response of the controller, or the response to Send Message when the BMC refused to forward the request or put the response of the controller in it. A successful response to Send Message without data only says that the BMC forwarded the request: the response of the controller follows.- Overrides:
answersin classIpmiCommandCoder<R extends ResponseData>- Parameters:
reply- the IPMI message received under the tag of this request- Returns:
- whether the reply answers this request
-
getResponseData
public R getResponseData(IpmiMessage message) throws IPMIException, NoSuchAlgorithmException, InvalidKeyException Description copied from class:PayloadCoderRetrieves payload-specific response data from IPMI message- Specified by:
getResponseDatain classIpmiCommandCoder<R extends ResponseData>- Parameters:
message- - IPMI message- Returns:
- response data
- Throws:
IPMIException- when response completion code isn't OK.NoSuchAlgorithmException- when authentication, confidentiality or integrity algorithm fails.InvalidKeyException- when creating of the authentication algorithm key fails
-
describeCompletionCode
Describes a completion code specific to Send Message (IPMI 2.0 table 22-9).- Parameters:
rawCode- the completion code byte- Returns:
- the description, or null for a code that is not specific to Send Message
-