merge mqtt code