How to set device in either AP or SmartConfig Mode?