| // Copyright 2018 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // gRPC API exposed by the diagnostics_processor daemon. Normally the consumer |
| // of the API is the diagnosticsd daemon. |
| |
| syntax = "proto3"; |
| |
| package diagnostics.grpc_api; |
| |
| service DiagnosticsProcessor { |
| // Called when a message is sent by the diagnostics UI extension (hosted by |
| // the browser). |
| rpc HandleMessageFromUi(HandleMessageFromUiRequest) |
| returns (HandleMessageFromUiResponse) {} |
| |
| // Called when the diagnosticsd daemon received EC event. |
| rpc HandleEcNotification(HandleEcNotificationRequest) |
| returns (HandleEcNotificationResponse) {} |
| } |
| |
| // Parameters for the HandleMessageFromUi RPC. |
| message HandleMessageFromUiRequest { |
| // Message contents, as sent by the diagnostics UI extension. Should be a |
| // valid JSON string. |
| string json_message = 1; |
| } |
| |
| // Return value of the HandleMessageFromUi RPC. |
| message HandleMessageFromUiResponse { |
| // Response message contents, as sent by the diagnostics_processor daemon. |
| // When set, should be a valid JSON string. |
| string response_json_message = 1; |
| } |
| |
| // Parameters for the HandleEcNotification RPC. |
| message HandleEcNotificationRequest { |
| // EC notification type. |
| // |
| // |type| value is located from 0x0000 to 0xFFFF, i.e. only 16 bits used. |
| uint32 type = 1; |
| |
| // EC notification payload. |
| // |
| // Originally, EC driver provides |uint16_t| data array which we encode to |
| // |payload| (i.e. |uint8_t| array) using little-endian format. |
| // For example, [0x0102, 0x1314, 0x2526] will be represented as |
| // [0x02, 0x01, 0x14, 0x13, 0x26, 0x25] payload. |
| // |
| // |payload| size does not exceed 12 bytes. |
| bytes payload = 2; |
| } |
| |
| // Return value of the HandleEcNotification RPC. |
| message HandleEcNotificationResponse {} |