// @file sns_ext_svc.proto
//
// Sensor provides access to external QMI services.
//
// This Sensor will create a connection to the external service upon
// receipt of the first request. Subsequent requests will be sent upon the
// same connection. The connection will be closed after the client closes
// the data stream.
//
// An error event will be sent upon any received error, including upon
// the error callback. It is then the responsibility of the client to close
// the data stream, and re-open a new one if desired.
//
// Copyright (c) 2017, 2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.

syntax = "proto2";
import "nanopb.proto";

enum sns_ext_svc_msgid
{
  option (nanopb_enumopt).long_names = false;

  // Send a request message
  SNS_EXT_SVC_MSGID_SNS_EXT_SVC_REQ = 512;

  // Asynchronously received response message
  SNS_EXT_SVC_MSGID_SNS_EXT_SVC_RESP = 768;

  // Asynchronously received indication message
  SNS_EXT_SVC_MSGID_SNS_EXT_SVC_IND = 1024;
}

message sns_ext_svc_req
{
  required uint32 svc_id = 1;

  // QMI/IDL Message ID
  required int32 msg_id = 2;

  // Client-specified transaction ID, to be returned in sns_ext_svc_resp
  optional int32 transaction_id = 3;

  // Contains the QMI-decoded request message.
  required bytes payload = 4;
}

message sns_ext_svc_resp
{
  // QMI/IDL Message ID
  required int32 msg_id = 1;

  // Transport error, as defined in qmi_client.h; Defaults to QMI_NO_ERR
  required int32 transp_err = 2;

  // Client-specified transaction ID, as provided in sns_ext_svc_req
  optional int32 transaction_id = 3;

  // Contains the QMI-decoded response message
  // May be empty if transport_err != QMI_NO_ERR
  required bytes payload = 4;
}

message sns_ext_svc_ind
{
  // QMI/IDL Message ID
  required int32 msg_id = 1;

  // Contains the QMI-decoded indication message.
  required bytes payload = 2;
}
