This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3235SF: 关于MQTT-client例程LED灯使用的问题?

Part Number: CC3235SF

请问我在使用MQTT-client例程的时候,代码里没有找到在哪里使用了LED灯,也就是为什么代码一烧进去灯就亮了呢?如果我想让LED灯用在其他地方,应该在哪里修改关闭LED灯呢,或者例程中哪里调用了点亮LED灯的函数呢?

  • /*
         * In case a persistent session is being used, subscribe is called before connect so that the module
         * is aware of the topic callbacks the user is using. This is important because if the broker is holding
         * messages for the client, after CONNACK the client may receive the messages before the module is aware
         * of the topic callbacks. The user may still call subscribe after connect but have to be aware of this.
         */
        ret = MQTT_IF_Subscribe(mqttClientHandle, "Broker/To/cc32xx", MQTT_QOS_2, BrokerCB);
        ret |= MQTT_IF_Subscribe(mqttClientHandle, "cc32xx/ToggleLED1", MQTT_QOS_2, ToggleLED1CB);
        ret |= MQTT_IF_Subscribe(mqttClientHandle, "cc32xx/ToggleLED2", MQTT_QOS_2, ToggleLED2CB);
        ret |= MQTT_IF_Subscribe(mqttClientHandle, "cc32xx/ToggleLED3", MQTT_QOS_2, ToggleLED3CB);

    在以上回调中使用了LED,LED用于指示状态,可在readme文件中找到详细说明

    使用GPIO API参考:GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_OFF);