/*
 * Copyright 1999-2023 Logitech, Inc.
 * All Rights Reserved
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

syntax = "proto3";

package logi.device.proto;

option java_package = "com.logitech.vc.proto";

/**
 * For reboot schedule request defined here
 * https://docs.google.com/document/d/10pG89Cw_siDvnmsKxdLQqutIqegH6ouSnMon_G28Nyc/edit#bookmark=id.k0bz8vzzaj9
 */
message RebootSchedule
{
	/**
	 * The time to reboot.
	 * If this is empty and ts is non-zero, it means to clear the reboot schedule
	 */
	string when = 1;

	/**
	 * repeat mode defined here
	 * https://docs.google.com/document/d/1yQp8Ju82bDuVfHmprP_5ToUJbitK7kOjmj_71Cqc-do/edit#heading=h.k8yyuyddqj1v
	 */
	uint32 repeat = 2;

	/**
	 * timestamp the schedule request was made
	 */
	uint64 ts = 3;
}

/**
 * Request to reboot device
 * This is to be included in UsbMsg
 *
 * After the device receives this, the device should send a response,
 * followed by an mqtt event that conforms to device reboot or
 * schedule reboot defined here
 * https://docs.google.com/document/d/10pG89Cw_siDvnmsKxdLQqutIqegH6ouSnMon_G28Nyc/edit#bookmark=id.zcy4ldnyuij
 * and
 * https://docs.google.com/document/d/10pG89Cw_siDvnmsKxdLQqutIqegH6ouSnMon_G28Nyc/edit#bookmark=id.k0bz8vzzaj9
 *
 * EXPECTED RESPONSE
 * RebootDeviceResponse
 */
message RebootDeviceRequest
{
	/**
	 * Unused. Reserved for future use.
	 */
	bool reserved = 1;

	/**
	 *  A timestamp indicating when the reboot request
	 *	was initiated.
	 *  The device should include this entry as part of the event information
	 *   it sends back to PC during a reboot request.
	 */
	uint64 iat = 2;

	/**
	 * Below are newly defined attributes that includes rebootSchedule,
	 * and also tries to keep the request in-line with cloud request
	 * Note:
	 *   older versions of Sync app would not know about below
	 */
	/**
	 * (REQUIRED)Reboot strategy defined in
	 * https://docs.google.com/document/d/10pG89Cw_siDvnmsKxdLQqutIqegH6ouSnMon_G28Nyc/edit#
	 */
	uint32 strategy = 3;
	/**
	 * (REQUIRED) Same behavior as in Raiden Backend API
	 */
	bool rebootNow = 4;
	/**
	 * (OPTIONAL) Same behavior as in Raiden Backend API
	 */
	RebootSchedule schedule = 5;
	/**
	 * (REQUIRED) For device to distinguish between older request and new one that
	 *   support schedule reboot.
	 *   This defaults to 0 for older Sync app.  Sync app that supports
	 *   schedule reboot will pass with value 1.
	 */
	uint32 version = 6;

	/**
	 * (OPTIONAL)
	 *  serial number of the intended recipient of the command.
	 *  If empty, the receiver should handle the command as the intended recipient. This also
	 * handles backward compatibility with older Sync app where serial number is not defined.
	 *  Behavior for host and peripheral device: if command is for host device, host will
	 * handle command and forward the command to peripheral device as well.  If for peripheral
	 * device, host will just forward command to peripheral device.
	 */
	string serial_number = 7;
}

/**
 * Reboot device response
 */
message RebootDeviceResponse
{
	/**
	 * bool value to indicate reboot was requested.  If there are errors
	 * while requesting a device to reboot, should set the value to false
	 */
	bool success = 1;
}

/**
 * This message requests that the speaker boost audio setting be changed.
 * The device should send a device info event after this setting request are handled.
 *
 * EXPECTED RESPONSE
 * SetSpeakerBoostResponse
 *
 */
message SetSpeakerBoostRequest
{
	/**
	 * (REQUIRED) The speaker boost setting to be set
	 *
	 * If value is 0, the request is to disable.  If 1,
	 * the request is to enable.
	 */
	int32 speaker_boost = 1;
}

message SetSpeakerBoostResponse
{
	/**
	 * (REQUIRED) set to true if the audio setting request was successfully sent, false
	 * otherwise
	 */
	bool success = 1;
}

/**
 * This message requests that the noise reduction audio setting be changed.
 * The device should send a device info event after this setting request are handled.
 *
 * EXPECTED RESPONSE
 * SetNoiseReductionResponse
 *
 */
message SetNoiseReductionRequest
{
	/**
	 * (REQUIRED) The noise reduction setting to be set
	 *
	 * If value is 0, the request is to disable.  If 1,
	 * the request is to enable.
	 */
	int32 noise_reduction = 1;
}

message SetNoiseReductionResponse
{
	/**
	 * (REQUIRED) set to true if the audio setting request was successfully sent, false
	 * otherwise
	 */
	bool success = 1;
}

/**
 * This message requests that the reverb mode audio setting be changed.
 * The device should send a device info event after this setting request are handled.
 *
 * EXPECTED RESPONSE
 * SetReverbModeResponse
 *
 */
message SetReverbModeRequest
{
	/**
	 * Reverb mode enumeration
	 */
	enum ReverbMode {
		DISABLED = 0;
		MILD = 1;
		NORMAL = 2;
		AGGRESSIVE = 3;
	}

	/**
	 * (REQUIRED) The reverb mode setting to be set
	 *
	 *  see Reverb mode enumeration
	 */
	ReverbMode reverb_mode = 1;
}

message SetReverbModeResponse
{
	/**
	 * (REQUIRED) set to true if the setting request was successfully sent, false otherwise
	 */
	bool success = 1;
}

/**
 * This message requests that the microphone eq mode audio setting be changed.
 * The device should send a device info event after this setting request are handled.
 *
 * EXPECTED RESPONSE
 * SetMicEQModeResponse
 *
 */
message SetMicEQModeRequest
{
	/**
	 * MicEQ mode enumeration
	 */
	enum MicEQMode {
		BASSBOOST = 0;
		NORMAL = 1;
		VOICEBOOST = 2;
	}

	/**
	 * (REQUIRED) The microphone eq setting to be set
	 *
	 *  see MicEQ mode enumeration
	 */
	MicEQMode mic_eq_mode = 1;
}

message SetMicEQModeResponse
{
	/**
	 * (REQUIRED) set to true if the setting request was successfully sent, false otherwise
	 */
	bool success = 1;
}

/**
 * This message requests that the speaker eq mode audio setting be changed.
 * The device should send a device info event after this setting request are handled.
 *
 * EXPECTED RESPONSE
 * SetSpeakerEQModeResponse
 *
 */
message SetSpeakerEQModeRequest
{
	/**
	 * SpeakerEQ mode enumeration
	 */
	enum SpeakerEQMode {
		BASSBOOST = 0;
		NORMAL = 1;
		VOICEBOOST = 2;
	}

	/**
	 * (REQUIRED) The speaker eq setting to be set
	 *
	 *  see SpeakerEQ mode enumeration
	 */
	SpeakerEQMode speaker_eq_mode = 1;
}

message SetSpeakerEQModeResponse
{
	/**
	 * (REQUIRED) set to true if the setting request was successfully sent, false otherwise
	 */
	bool success = 1;
}

/**
 * This message requests that the device forgets a peripheral.
 * After forgetting the peripheral, the device should send ForgetDeviceResponse
 * and indicate success or false.
 * The device should also send a device info event after sending the response
 * to indicate the new peripheral state.
 * Note: micpod uid comes from device in this format "uid": "33",
 *   but Sync stores this as hex string , like  uuid: "0x0021".
 *   Sync app will send the uuid in hex string format.
 * EXPECTED RESPONSE
 * ForgetDeviceResponse
 *
 */
message ForgetDeviceRequest
{
	/**
	 * (REQUIRED) The uuid of peripheral to forget
	 *
	 */
	string uuid = 1;
}

message ForgetDeviceResponse
{
	/**
	 * (REQUIRED) set to true if forget request was successfully handled
	 */
	bool success = 1;
}
