Introduction
This document provides a comprehensive guide to implementing a BGAPI and BGLIB Serial Port Profile (SPP) server example. It details the structure and usage of the BGAPI serial protocol and its companion BGLib library, using sample implementations provided with the BT121 Software Development Kit (SDK).
The example project is designed for use with the BT121 Module Development Kit and the free 'Community' version of Microsoft Visual Studio. The core implementation is compatible with any ANSI C host platform, allowing for the creation or porting of similar libraries onto platforms capable of host-to-module communication over a UART interface.
To follow along effectively, users should have the BT121 Module Development Kit, Microsoft Visual Studio Community Edition or similar, and an Android-based phone with Bluetooth 4.0 or higher support.
Getting Started
The document outlines the steps to install the Bluetooth Dual Mode SDK, including downloading the SDK from Silicon Labs' website and running the installer.
It also details the SDK's folder structure, including API, BIN, EXAMPLES, FW, HOST_EXAMPLE, and HOSTBGAPI directories, and the included tools such as BGTool, bgbuild.exe, and bgupdate.exe.
Project Walkthrough
A detailed walkthrough of the BT121 SPP Server demo project is provided, covering BGAPI project components, module firmware projects, and host application projects. The document explains the project.xml file, hardware configuration, GATT services configuration, and SDP entries.
Instructions are given for compiling the module firmware with BGBuild and flashing the new firmware using bgupdate.exe. Additionally, it covers compiling the host application project with Visual Studio and running it on Windows.
Testing and Summary
The document concludes with instructions for testing client connectivity using an Android smartphone and the S2 Bluetooth Terminal app. It guides users through scanning, pairing, establishing an SPP connection, sending data, and disconnecting.
A summary and quick-reference guide for BGAPI/BGLib implementation is provided, highlighting key aspects for both module firmware and host application projects.