|
|
|
@ -3,8 +3,7 @@ import { airPortStore } from '@/store/modules/airport';
|
|
|
|
|
import errorCode from './error_code.json';
|
|
|
|
|
|
|
|
|
|
const airPortStoreVal = airPortStore();
|
|
|
|
|
const airPort = airPortStoreVal.getAirport;
|
|
|
|
|
const uav = airPortStoreVal.getUAV;
|
|
|
|
|
const gateway = airPortStoreVal.getGateway;
|
|
|
|
|
export const debug_mode_openOptions = {
|
|
|
|
|
canceled: '取消或终止',
|
|
|
|
|
failed: '失败',
|
|
|
|
@ -37,47 +36,38 @@ export const errorName = (code) => {
|
|
|
|
|
};
|
|
|
|
|
export const servicesTopic = (data) => {
|
|
|
|
|
// 发送消息
|
|
|
|
|
clientPublish('thing/product/' + airPort.sn + '/services', data);
|
|
|
|
|
clientPublish('thing/product/' + gateway + '/services', data);
|
|
|
|
|
};
|
|
|
|
|
export const services_replyTopic = () => {
|
|
|
|
|
// 订阅消息
|
|
|
|
|
clientSubscribe('thing/product/' + airPort.sn + '/services_reply');
|
|
|
|
|
};
|
|
|
|
|
// 无人机
|
|
|
|
|
export const servicesUAVTopic = (data) => {
|
|
|
|
|
// 发送消息
|
|
|
|
|
clientPublish('thing/product/' + uav.sn + '/services', data);
|
|
|
|
|
};
|
|
|
|
|
export const services_replyUAVTopic = () => {
|
|
|
|
|
// 订阅消息
|
|
|
|
|
clientSubscribe('thing/product/' + uav.sn + '/services_reply');
|
|
|
|
|
clientSubscribe('thing/product/' + gateway + '/services_reply');
|
|
|
|
|
};
|
|
|
|
|
export const eventsTopic = (data) => {
|
|
|
|
|
// 发送消息
|
|
|
|
|
clientPublish('thing/product/' + airPort.sn + '/events', data);
|
|
|
|
|
clientPublish('thing/product/' + gateway + '/events', data);
|
|
|
|
|
};
|
|
|
|
|
export const events_replyTopic = () => {
|
|
|
|
|
// 订阅消息
|
|
|
|
|
clientSubscribe('thing/product/' + airPort.sn + '/events_reply');
|
|
|
|
|
clientSubscribe('thing/product/' + gateway + '/events_reply');
|
|
|
|
|
};
|
|
|
|
|
export const drcDownTopic = (data) => {
|
|
|
|
|
// 发送消息thing/product/{gateway_sn}/drc/down
|
|
|
|
|
clientPublish('thing/product/' + airPort.sn + '/drc/down', data);
|
|
|
|
|
clientPublish('thing/product/' + gateway + '/drc/down', data);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const eventsTopicSubscribe = () => {
|
|
|
|
|
// 发送消息
|
|
|
|
|
clientSubscribe('thing/product/' + airPort.sn + '/events');
|
|
|
|
|
clientSubscribe('thing/product/' + gateway + '/events');
|
|
|
|
|
};
|
|
|
|
|
export const drcUpTopic = () => {
|
|
|
|
|
clientSubscribe('thing/product/' + airPort.sn + '/drc/up');
|
|
|
|
|
clientSubscribe('thing/product/' + gateway + '/drc/up');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const setTopic = (data) => {
|
|
|
|
|
// 发送消息
|
|
|
|
|
clientPublish('thing/product/' + airPort.sn + '/property/set', data);
|
|
|
|
|
clientPublish('thing/product/' + gateway + '/property/set', data);
|
|
|
|
|
};
|
|
|
|
|
export const set_replyTopic = () => {
|
|
|
|
|
// 订阅消息
|
|
|
|
|
clientSubscribe('thing/product/' + airPort.sn + '/services_reply');
|
|
|
|
|
clientSubscribe('thing/product/' + gateway + '/services_reply');
|
|
|
|
|
};
|
|
|
|
|