package com.mogo.realtime.api;

import android.content.Context;

import com.mogo.realtime.core.SnapshotUploadInTime;
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
import com.mogo.realtime.socket.SocketHandler;

/**
 * RealTime实时上报数据服务SDK
 */
public class MoGoAiCloudRealTime {

    /**
     * 开始实时上报定位坐标服务
     * @param context 上下文对象
     * @param appId 配置id
     */
    public static void startRealTime(Context context, String appId) {
        SnapshotUploadInTime.getInstance().start(context, appId);
    }

    /**
     * 停止实时上报定位坐标服务
     */
    public static void stopRealTime(){
        SnapshotUploadInTime.getInstance().stop();
    }

    /**
     * 注册上报定位回调
     * @param onMsgListener {@link IMogoCloudOnMsgListener}
     */
    public static void registerOnMsgListener(IMogoCloudOnMsgListener onMsgListener) {
        SocketHandler.getInstance().registerOnMsgListener(onMsgListener);
    }

    /**
     * 取消注册上报定位回调
     * @param onMsgListener {@link IMogoCloudOnMsgListener}
     */
    public static void unRegisterOnMsgListener(IMogoCloudOnMsgListener onMsgListener) {
        SocketHandler.getInstance().unRegisterOnMsgListener(onMsgListener);
    }
}
