Class SendMessage<R extends ResponseData>

Type Parameters:
R - the type of the response of the carried command

public class SendMessage<R extends ResponseData> extends IpmiCommandCoder<R>
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 Details

    • COMMAND_CODE

      public static final byte COMMAND_CODE
      Command code of Send Message (IPMI 2.0 table G-1).
      See Also:
  • Constructor Details

    • SendMessage

      public SendMessage(int channel, int address, IpmiCommandCoder<R> command)
      Creates the command.
      Parameters:
      channel - the channel the controller is on, as its SDR records give it: 0 for the primary IPMB
      address - the slave address of the controller in its 8-bit form (the 7-bit address shifted left, bit 0 clear), 2Ch for instance
      command - 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

      public IpmiCommandCoder<R> 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: IpmiCommandCoder
      Retrieves command code specific for command represented by this class
      Specified by:
      getCommandCode in class IpmiCommandCoder<R extends ResponseData>
      Returns:
      command code
    • getNetworkFunction

      public NetworkFunction getNetworkFunction()
      Description copied from class: IpmiCommandCoder
      Retrieves network function specific for command represented by this class.
      Specified by:
      getNetworkFunction in class IpmiCommandCoder<R extends ResponseData>
      Returns:
      network function, or null for a command of a network function NetworkFunction does not list, which overrides IpmiCommandCoder.getNetworkFunctionCode() instead
      See Also:
    • answers

      public boolean answers(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. A successful response to Send Message without data only says that the BMC forwarded the request: the response of the controller follows.
      Overrides:
      answers in class IpmiCommandCoder<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: PayloadCoder
      Retrieves payload-specific response data from IPMI message
      Specified by:
      getResponseData in class IpmiCommandCoder<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

      public static String describeCompletionCode(int rawCode)
      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