Commit d36760c7dacb728462c56017e699eb48c84f30e7

Authored by 云中非
1 parent 00ba0876

feat: 设备配置扩展传输协议TCP

... ... @@ -31,6 +31,7 @@ import java.io.Serializable;
31 31 @JsonSubTypes({
32 32 @JsonSubTypes.Type(value = DefaultDeviceProfileTransportConfiguration.class, name = "DEFAULT"),
33 33 @JsonSubTypes.Type(value = MqttDeviceProfileTransportConfiguration.class, name = "MQTT"),
  34 + @JsonSubTypes.Type(value = TcpDeviceProfileTransportConfiguration.class, name = "TCP"),
34 35 @JsonSubTypes.Type(value = Lwm2mDeviceProfileTransportConfiguration.class, name = "LWM2M"),
35 36 @JsonSubTypes.Type(value = CoapDeviceProfileTransportConfiguration.class, name = "COAP"),
36 37 @JsonSubTypes.Type(value = SnmpDeviceProfileTransportConfiguration.class, name = "SNMP")
... ...
  1 +/**
  2 + * Copyright © 2016-2022 The Thingsboard Authors
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +package org.thingsboard.server.common.data.device.profile;
  17 +
  18 +import lombok.Data;
  19 +import org.thingsboard.server.common.data.DeviceTransportType;
  20 +import org.thingsboard.server.common.data.validation.NoXss;
  21 +import org.thingsboard.server.common.data.yunteng.enums.TcpDataTypeEnum;
  22 +
  23 +@Data
  24 +public class TcpDeviceProfileTransportConfiguration implements DeviceProfileTransportConfiguration {
  25 +
  26 + @NoXss
  27 + private TcpDataTypeEnum dataFormat = TcpDataTypeEnum.HEX;
  28 + private String scriptId;
  29 +
  30 + @Override
  31 + public DeviceTransportType getType() {
  32 + return DeviceTransportType.MQTT;
  33 + }
  34 +
  35 +
  36 +
  37 +
  38 +}
... ...
  1 +package org.thingsboard.server.common.data.yunteng.enums;
  2 +
  3 +/**
  4 + * 设备凭证
  5 + */
  6 +public enum TcpDataTypeEnum {
  7 + HEX,
  8 + JSON,
  9 + ASCII
  10 +}
... ...
... ... @@ -8,12 +8,8 @@ import lombok.Data;
8 8 import lombok.EqualsAndHashCode;
9 9 import org.apache.ibatis.type.EnumTypeHandler;
10 10 import org.thingsboard.server.common.data.yunteng.constant.ModelConstants;
11   -import org.thingsboard.server.common.data.yunteng.enums.DeviceCredentialsEnum;
12   -import org.thingsboard.server.common.data.yunteng.enums.DeviceState;
13 11 import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum;
14 12
15   -import java.time.LocalDateTime;
16   -
17 13 @Data
18 14 @EqualsAndHashCode(callSuper = true)
19 15 @TableName(value = ModelConstants.Table.IOTFS_DEVICE_TABLE_NAME, autoResultMap = true)
... ...