• cb [input]callback function that is trigger when MQTT message is received from the
subscribe MQTT topic
Return: 0: success;
Other value: fail;
– Cloud_RC cloud_mqtt_yield(int timeout);
Usage: This is used by the MQTT client to manage PING requests to monitor the health of the
TCP connection as well as periodically check the socket receive buffer for subscribe
messages.
Parameters:
• timeout[input]Maximum number of milliseconds to pass thread execution to the client
Return: 0: success;
Other value: fail;
2.
IOT_MESSAGE
– cJSON* iot_message_reportInfo_shadow(char* device_type, char* mac_addr, int
report_data_num, NodeInfo data_info[]);
Usage: Generates AWS IoT Shadow report message.
Parameters:
• device_type[input]Name of the device type
• mac_addr[input] MAC address of the device
• report_data_num[input] number report items
• data_info[input] data of the report items
Return: JSON message;
Other value: fail;
3.
BUTTON
– void initialise_button(void);
Usage: Initializes GPIO for button detection.
– void buttonTaskExecute(unsigned long tick)
Usage: Executes button detection, called in a while loop to poll the button every a period.
Parameters:
• tick[input]systick value
– int regButtonShortPressDetectCallback(void* cb, int button);
Usage: Register callback function for the button short press detect.
Parameters:
• cb [input]callback function trigger when short press button is detected
• button[input] 1: SW1; 2: SW2; 3: SW3
Return: socket index
– int unRegButtonShortPressDetectCallback(int sock, int button)
Usage: Unregister callback function for the button short press detect.
Parameters:
• sock [input]socket index that represent the registration
ATWINC15x0 Smart Device Kit
Application Firmware
©
2019 Microchip Technology Inc.
User Guide
DS50002885A-page 22