# 发送请求

Source: [https://docs.qualcomm.com/doc/80-PK177-134Y/topic/send_request.html](https://docs.qualcomm.com/doc/80-PK177-134Y/topic/send_request.html)

通过会话向传感器子系统发送请求消息。客户端可发送的消息如[编码和解码 protobuf 消息](https://docs.qualcomm.com/doc/80-PK177-134Y/topic/encoding_and_decoding_protobuf_messages.html)所述。如果客户端尝试向不可用的传感器发送消息，则客户端将获得的返回结果为错误。

int send_request(int sensor_session_id, byte[] data) Copy to clipboard

## 参数

                    - sensor\_session\_id

                        - 指定传感器的会话 ID。

                    - data

                        - 已编码 protobuf 消息的字节数组

## 返回结果

                    - 状态

                        - 其值如下：
- 0 - 成功
- -1 - 失败
- 非 0 或 1 - QESDK 异常

**Parent Topic:** [传感器接口](https://docs.qualcomm.com/doc/80-PK177-134Y/topic/sensor_interfaces.html)

Last Published: Jun 22, 2023

[Previous Topic
传感器接口](https://docs.qualcomm.com/bundle/publicresource/80-PK177-134Y/topics/sensor_interfaces.md) [Next Topic
register\_event\_callback](https://docs.qualcomm.com/bundle/publicresource/80-PK177-134Y/topics/register_event_callback.md)