Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

CC3200 XMPP Reference Application

From Texas Instruments Wiki
Jump to: navigation, search
Cc31xx cc32xx return home.png
Cc32xx return sample apps.png


Overview

This example code demonstrate how to connect and work with Extensible Messaging and Presence Protocol(XMPP) server using CC32xx. This code doesn't implement a full XMPP SW stack\library. Please check the Limitation Section for more details.

Warning Warning: The service used by this example, Google Chat, has been phased out. This example no longer works as-is.

Application details

The application performs the following steps:

  • Initializes the device networking layers.
  • Connect to Access Point with SSID "cc3200demo" and Security as "Open"
  • Wait for the Connection to the AP
  • Once AP connection is done, It Configures the XMPP Server and Login Information
  • It then Connects to Configured XMPP Server (google.com) followed by authentication using Base64 Encrypted Login Credential
  • Once Authentication is Successful, It waits for a chat message from another Client
  • Once it receives the Chat Message, It replies back with the Same message


NoteNote: Use your own email-id (CLIENT_USER_NAME) & password(CLIENT_PASSWORD) in source code (main.c) and build the project before running the application.
This example can be used either on TI-RTOS or FreeRTOS.

For the application to work with TI-RTOS, ti_rtos_config project needs to be imported into the application workspace. These projects can be found in CC3200-SDK under ti_rtos folder. Please follow this link for CC3200 TI-RTOS usage CC3200 TI-RTOS

Source Files briefly explained

  • main - Simple Application demonstrating XMPP Client Functionalities.
  • netapps\xmpp\client - libxmpp is Platform Independent Library and can be Integrated to any XMPP Client Software using below APIs
    1. sl_NetAppXmppSet - Configure XMPP Server, Login Information
    2. sl_NetAppXmppConnect- Connect to XMPP Server
    3. sl_NetAppXmppSend - Send Chat Message to another XMPP Client
    4. sl_NetAppXmppRecv - Receive Chat Message from another XMPP Client

Usage

  1. Choose an AP and Configure the SSID as "cc3200demo" and Security as Open
  2. In source code set e-mail username and password
#define CLIENT_USER_NAME    "cc32xx.apps"
#define CLIENT_PASSWORD     "xxxxxx"

NoteNote: By default, the expected message length and user ID length (Jabber ID) is set to 50, please modify the following MACRO as per your requirement

#define REMOTE_USERID_LEN   50
#define RECV_MSG_LEN        50
  1. Login into Your Gmail Account on Chat/Hangout Application and add cc32xx.apps@gmail.com as Contact
  2. Login into Gmail Account with cc32xx.apps@gmail.com and accept Invite on Chat/Hangout Application. Logout from cc3200 apps Account.
  3. Login into Your Gmail Account on Chat/Hangout Application
  4. Run the reference application (Flashing the bin/IAR/CCS)
    • Open the Project as mentioned in the 'docs\CC3200-Getting Started Guide.pdf' or flash xmpp.bin to the device.
    • XMPP Reference Application on CCS runs on TI RTOS which requires additional tools to be Installed. Refer to CC3200 TI-RTOS for more information.
    • Build and download the application to the board
  5. Run Application and Wait for it connect to XMPP Server
  6. Wait till you see "CC3200 SimpleLink" in your Chat/Hangout Application
  7. Send Chat Message to "CC3200 SimpleLink"
  8. Check the Reply
    CC3200 xmpp chat window.png

LED Status Notification

  • Red LED will glow when device is connected to AP
  • Orange LED will glow when device gets any chat message from the server.




Limitations/Known Issues

  • It only implements a limited set of functionality and has some limitations.

E.g:

  1. Retreiving the full friend roster isn't supported
  2. Not checking the remote friend status (online, off line) before sending him a message

Links