|
|
|
@ -139,11 +139,11 @@ public class JsonMqttAdaptor implements MqttTransportAdaptor { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Optional<MqttMessage> convertToGatewayPublish(MqttDeviceAwareSessionContext ctx, TransportProtos.GetAttributeResponseMsg responseMsg) throws AdaptorException { |
|
|
|
public Optional<MqttMessage> convertToGatewayPublish(MqttDeviceAwareSessionContext ctx, String deviceName, TransportProtos.GetAttributeResponseMsg responseMsg) throws AdaptorException { |
|
|
|
if (!StringUtils.isEmpty(responseMsg.getError())) { |
|
|
|
throw new AdaptorException(responseMsg.getError()); |
|
|
|
} else { |
|
|
|
JsonObject result = JsonConverter.getJsonObjectForGateway(responseMsg); |
|
|
|
JsonObject result = JsonConverter.getJsonObjectForGateway(deviceName, responseMsg); |
|
|
|
return Optional.of(createMqttPublishMsg(ctx, MqttTopics.GATEWAY_ATTRIBUTES_RESPONSE_TOPIC, result)); |
|
|
|
} |
|
|
|
} |
|
|
|
|