package com.dji.sample.psdk.service;

import com.dji.sample.psdk.model.dto.SpeakerPlayDTO;
import com.dji.sdk.mqtt.services.ServicesReplyData;
import com.dji.sdk.mqtt.services.TopicServicesResponse;

/**
 * PSDK service interface
 * 
 * @author GeoFly Team
 * @version 1.0
 * @date 2026-02-03
 */
public interface IPsdkService {

    /**
     * Send custom data to PSDK payload
     * @param deviceSn device serial number
     * @param psdkIndex PSDK index (0-3)
     * @param data custom data (max 256 bytes)
     * @return service reply
     */
    TopicServicesResponse<ServicesReplyData> sendCustomDataToPsdk(String deviceSn, Integer psdkIndex, String data);

    /**
     * Set PSDK widget value
     * @param deviceSn device serial number
     * @param psdkIndex PSDK index (0-3)
     * @param widgetIndex widget index
     * @param value widget value
     * @return service reply
     */
    TopicServicesResponse<ServicesReplyData> setWidgetValue(String deviceSn, Integer psdkIndex, Integer widgetIndex, Integer value);

    /**
     * Set PSDK input box text
     * @param deviceSn device serial number
     * @param psdkIndex PSDK index (0-3)
     * @param text input text (max 128 bytes)
     * @return service reply
     */
    TopicServicesResponse<ServicesReplyData> setInputBoxText(String deviceSn, Integer psdkIndex, String text);

    /**
     * Play audio on speaker
     * @param deviceSn device serial number
     * @param playDTO speaker play parameters
     * @return service reply
     */
    TopicServicesResponse<ServicesReplyData> playAudio(String deviceSn, SpeakerPlayDTO playDTO);

    /**
     * Play TTS on speaker
     * @param deviceSn device serial number
     * @param playDTO speaker play parameters
     * @return service reply
     */
    TopicServicesResponse<ServicesReplyData> playTts(String deviceSn, SpeakerPlayDTO playDTO);

    /**
     * Replay on speaker
     * @param deviceSn device serial number
     * @param psdkIndex PSDK index (0-3)
     * @return service reply
     */
    TopicServicesResponse<ServicesReplyData> replay(String deviceSn, Integer psdkIndex);

    /**
     * Stop playing on speaker
     * @param deviceSn device serial number
     * @param psdkIndex PSDK index (0-3)
     * @return service reply
     */
    TopicServicesResponse<ServicesReplyData> stopPlay(String deviceSn, Integer psdkIndex);

    /**
     * Set speaker play mode
     * @param deviceSn device serial number
     * @param psdkIndex PSDK index (0-3)
     * @param playMode play mode (0: single, 1: loop)
     * @return service reply
     */
    TopicServicesResponse<ServicesReplyData> setPlayMode(String deviceSn, Integer psdkIndex, Integer playMode);

    /**
     * Set speaker volume
     * @param deviceSn device serial number
     * @param psdkIndex PSDK index (0-3)
     * @param volume volume (0-100)
     * @return service reply
     */
    TopicServicesResponse<ServicesReplyData> setVolume(String deviceSn, Integer psdkIndex, Integer volume);
}
