diff --git a/apps/iot/src/iot_mqtt_aircon_gateway.erl b/apps/iot/src/iot_mqtt_aircon_gateway.erl index f4b6d4a..8764f47 100644 --- a/apps/iot/src/iot_mqtt_aircon_gateway.erl +++ b/apps/iot/src/iot_mqtt_aircon_gateway.erl @@ -117,7 +117,7 @@ handle_cast({send_command, Ref, ReceiverPid, DeviceId, Command}, State = #state{ {stop, Reason :: term(), NewState :: #state{}}). handle_info({mqtt_message, Topic, Payload, _Qos}, State = #state{inflight = Inflight}) -> lager:debug("[iot_mqtt_aircon_gateway] get reply of topic: ~p, payload: ~p", [Topic, Payload]), - case binary:split(Topic, <<"/">>) of + case binary:split(Topic, <<"/">>, [global]) of [<<>>, <<"aircon">>, DeviceId, <<"command_reply">>] -> Reply = catch jiffy:decode(Payload, [return_maps]), case Reply of