blob: 1aec21fbcabf52f33ddd5a953a94039b0bfcf9bb [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.telephony.snoop;
using zx;
type Direction = strict enum {
FROM_MODEM = 1;
TO_MODEM = 2;
};
type QmiMessage = struct {
timestamp zx.Time;
direction Direction;
is_partial_copy bool;
opaque_bytes array<uint8, 256>;
};
//TODO(jiamingw): change it to xunion after transport driver is converted to LLCPP
type Message = strict union {
1: qmi_message QmiMessage;
};
/// Protocol for forwarding messages to Snooper.
closed protocol Publisher {
strict SendMessage(struct {
msg Message;
});
};
/// Protocol for forwarding Message from Snooper.
@discoverable
closed protocol Snooper {
/// Get number of devices that connect to Snooper.
strict GetDeviceNum() -> (struct {
device_num uint32;
});
/// Snoop message which receives by Snooper client.
strict -> OnMessage(struct {
msg Message;
});
};