CYW943907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-18703 Rev. *B
39
5.
Code Examples
This chapter demonstrates the functionality of CYW43907 devices using CYW943907AEVAL1F EVK code examples. The
code examples are already bundled with the SDK, which can be found in
<InstallationFolder>\ModusToolbox_1.0\libraries\wiced_base-1.0\examples\apps\snips
.
Code examples can be compiled after creating the ModusToolbox project. Refer to
Building and Programming a Project for
for details on creating, building, and downloading projects.
5.1 AWSIOTPubSub Project
This project demonstrates publishing a message to a
Thing
in the Amazon Web Services (AWS) cloud and subscribing to the
same messages. A
Thing
is a representation of a specific device or logical entity. For more information, refer to the
On
startup,
the
AWSIOTPubSub
code
example
joins
a
Wi-Fi
access
point
specified
in
the
/AWSIOTPubSub_mainapp/src/wifi_config_dct.
file, connects to AWS, subscribes to the specified topic, and then alternately
tries to publish and subscribe messages.
The project consists of the following files:
▪
aws_app.c
: This file contains the main application function
application_start()
which is the entry point and
execution of the firmware application. It also contains function definitions for initializing, publishing, and subscribing to
AWSaws_config.h
: This file contains all the necessary macro definitions such as WICED_TOPIC and
WICED_MESSAGESTR.
▪
wifi_config_dct.h
: This file contains the Wi-Fi access point credentials (SSID and pass phrase key) and soft AP
credentials. You should enter the client access point name and password credentials before building the application.
These are specified as CLIENT_AP_SSID and CLIENT_AP_PASSPHRASE. Note that the security type may also have
to be changed if the access point does not use WPA2 security. The Wi-Fi access point must have access to the internet
to connect with AWS.
5.1.1 Hardware Connections
No specific hardware connections are required for this project because all connections are hardwired on the
CYW943907AEVAL1F EVK.