# Namespace hcap.mpi

hcap.mpi

- Defined in: hcap-1.24.6.5901.js

Namespace Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| hcap.mpi

## Method Summary

## Namespace Detail

hcap.mpi

## Method Detail

- <static> hcap.mpi.sendAndReceiveMpiData(param)
  Sends the vendor specific data using the MPI card and receives the reply data.

      hcap.mpi.sendAndReceiveMpiData({
           "id" : 0,
           "sequence" : 0,
           "packet" : "ABC0x123",
           "onSuccess" : function(s) {
               console.log("onSuccess return packet " + s.packet);
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Number} param.id [Required] - request ID that is defined between application and headend. (0 ~ 255)
    - {Number} param.sequence [Required] - sequence number of the packet. (0 ~ 255).
    - {String} param.packet [Required] - packet data to the MPI card. (0 ~ 32). The packet format is character array. For example param.packet = "ABC0x123";
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function (param) {
                // {String} param.packet - received packet data (length < 32) from MPI card.
                //     If failed to get the data, then the packet will be empty string "".
            }

    - {Function} param.onFailure [Optional] - failure callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.3.1
  See:
    hcap.mpi.sendMpiData()
- <static> hcap.mpi.sendMpiData(param)
  Sends the vendor specific data to the MPI card
  The MPI data will be received by {Event} mpi_data_received.

      hcap.mpi.sendMpiData({
           "id" : 0,
           "sequence" : 0,
           "packet" : "ABC0x123",
           "onSuccess" : function() {
               console.log("onSuccess");
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Number} param.id [Required] - request ID that is defined between application and headend. (0 ~ 255)
    - {Number} param.sequence [Required] - sequence number of the packet. (0 ~ 255).
    - {String} param.packet [Required] - packet data to the MPI card. (0 ~ 32). The packet format is character array. For example param.packet = "ABC0x123";
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function() {
                // No Parameter.
            }

    - {Function} param.onFailure [Optional] - failure callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.3.1
  See:
    hcap.mpi.sendAndReceiveMpiData()
    {Event} mpi_data_received