Home
SPPLE Application Guide STM
Contents
1. data that was sent This data was sent over BluetoothLE using a custom service of SPPLE in the sample application 1 AutomaticReadMode makes sure that all data received by the device is read automatically instead of manually using LERead as described above m DisplayRawModeData displays the data that has been read automatically n Loopback is used to send back the data that is being sent by the remote device So if the remote device wrote 50 characters turning on Loopback would send those characters back to the remote device where it can be read Connecting to an iPhone running SPPLE Chat application The STM device can also connect to an iPhone running an SPPLE application The application that we use on the iPhone is SPPLE Chat which can be downloaded for free from the app store here There are some changes that need to be made to the SPPLEDemo C file 1 Inthe function ConnectLEDevice make the following changes to the result statement after the Everything appears correct go ahead and attempt to make the connection comment and before the if Result statement Result GAP_LE Create Connection BluetoothStackID 100 100 Result fpNoFilter fpWhiteList latRandom Result amp BD_ADDR NULL latPublic amp ConnectionParameters GAP_LE Event _Callback 0 2 Inthe function ConfigureSPPLE make the following changes to the if statement after the Determine if a service discovery operation has been previously done comm
2. E e Bluetopia h Protocol Stack For STM3240G Bluetoot SPPLE DEMO Sample Application User Manual Version 2 1 3 January 4th 2010 stonestreet one Louisville KY www stonestreetone com Bluetooth and the Bluetooth logos are trademarks owned by Bluetooth SIG Inc USA and licensed to Stonestreet One Bluetopia Stonestreet One and the Stonestreet One logo are registered trademarks of Stonestreet One Louisville Kentucky USA All other trademarks are property of their respective owners Copyright 2000 2009 by Stonestreet One All rights reserved Table of Contents DEMO OVERVIEW AE E AA EA EERE EARE ET 3 Running the Bluetooth Coden eeren anie e Ea e ie a niai E aA ORE AE O EAEE EATA ARRET 3 DEMO APPLICATION icssssccessasediccoessocvasessnsasenscstoscssecteoonscniesevscosesendeadnscboectecsnsendeconsdecesessesdnssasedbecsoacusesensoedavavaooseeeed 4 Device 1 server setup on the demo application cccccscccccssssscecssssececsecsececsssaececsesaeceesesaeeeeseaeeeeseaaes 4 Device 2 client setup on the demo application cccesscccssssececssseececssaececsssaececsesaececsesaeeeeseaeeeesesaes 5 Initiating CONNECTION from device 2 o ccccecesssssecececeeseseaeaeeeeecessesesseseeeescesseseaaeeeseessessesseaeeeeseesseseaeaeeeesens 6 Identify Supported Services neninn its al ude eee vanes te os Adee een seek Pv a at 7 Data Transfer between Client and SCrver cccesscccsssssececsenececssnececseaae
3. cecseaececeeueeecseaaeeeeseaaeeeeeeaeeeesenaes 9 Connecting to an iPhone running SPPLE Chat application ccccccccssssscccececessesssseceeeeseessesseaeeeeeessessees 11 Demo Overview This application demonstrates a BR EDR SPP based application as well as a custom application SPPLE over Bluetooth LE that is similar in functionality to the BR EDR appliacation The SPPLE Profile is similar to the SPP profile except that it uses LE transport compared to BR EDR transport in the SPP profile The SPP profile emulates serial cable connections There are two roles defined in this profile The first is the server that has the SPPLE service running on it and has open an server port The client is a device that connects to the server Both of these devices can then exchange data with each other This document talks about the SPPLE application in details The application allows the user to use a console to use Bluetooth Low Energy BLE to establish connection between two BLE devices send Bluetooth commands and exchange data over BLE The first part of this document explains how to connect to two STM3240G boards over SPPLE and transfer data The second part talks about how to connect the STM3240G to an iPhone application Running the Bluetooth Code Once the code is flashed connect the board to a PC using a serial cable or serial or to USB converter Once connected wait for the driver to install Attach a Terminal program like Tera Term
4. ent and before the else case if TRUE Display SPPLE Service found on remote device attempting to read Transmit Credits and configured CCCDs r n Enable Notifications on the proper characteristics EnableDisableNotificationsIndications DeviceInfo gt ClientInfo Tx Client_Configuration_Descriptor GATT_CLIENT_CONFIGURATION_CHARACTERISTIC_NOTIFY_ENABLE GATT_ClientEventCallback_SPPLE ret_val 0 3 Inthe function SendDataCommand add the following code after the SendInfo BytesSent 0 and before the Kick start the send process comment add the following code DeviceInfo gt TransmitCredits 100 DeviceInfo gt ServerInfo Tx_Client Configuration Descriptor GATT_CLIENT_CONFIGURATION_CHARACTERISTIC_NOTIFY_ENABLE 4 Load the SPP LE profile on to the STM3240G device by rebuilding the project and flashing it from the project 5 Set up a Terminal Program for the Serial Port that the device is connected to The serial parameters to use are 115200 Baud 8 no 1 and no flow control Once connected reset the device using Reset S3 button and you should see the stack getting initialized on the terminal 6 On the iPhone open the SPPLE chat application Choose peripheral mode and turn on advertising 7 On the STM device StartScanning to find out devices in the area that are connectable The Bluetooth address of the Iphone should show up something like this etLE Advertising Report with size 36 1 Respon
5. ice you can stop scanning by using the command StopScanning EP COM26 PuTTY e gt Initiating connection from device 2 e Once the application on the client side knows the Bluetooth address of the device that is advertising it can connect to that device using the command ConnectLE lt Bluetooth Address gt r E EP COM26 PuTTY Soe Identify supported services f After Initialization the device needs to find out if SPP services are supported To do this DiscoverSPPLE is run on the client 1 g 5 gp COM26 PuTTY g After finding out support for SPP LE we need to configure SPP LE This is done by running ConfigureSPPLE on the client gp COM26 PuTTY eS Data Transfer between Client and Server h After configuring we can send data between client and server To send data we use Senddata lt number of bytes gt W COM22 115200baud Tera Term VT l a File Edit Setup Control Window Help ILE gt conf igure pple SPPLE Service found on remote device attempting to read Transmit Credits and c 1 Once the other device receives the data it receives a Data Indication event j The receiving device can then read the data that was sent using command Read W COM22 115200baud Tera Term VT File Edit Setup Control Window Help Data Indication Event Connection ID 1 Received 3 bytes E gt read Read 14 test textEOM k This will print out the
6. ses Advertising Type rtConnectableUndirected Address Type atRandom Address 0x79F20C012372 RSSI OXFFFFFFCB Data Length 29 D Type 0x01 D Length 0x01 Data 0x1A Type 0x07 Length 0x10 Data 0x39 0x23 OxCF 0x40 0x73 0x16 0x42 0x9A 0x5C 0x41 0x7E 0x7D 0x9A 0x83 0x14 Type 0x09 Length 0x06 Data 0x69 0x50 0x68 Ox6F Ox6E 0x65 A A A A A A C A A A UVUVUFUVVY LE gt etLE Advertising Report with size 36 1 Responses Advertising Type rtScanResponse Address Type atRandom Address 0x79F20C012372 RSSI OXFFFFFECB Data Length 0 8 The address type will be random Note down the address of the device specified 9 Connect to the remote device using the connectle lt bd addr gt command where the bd addr is the previously noted address 10 Discover services using discoverspple and configure services using configurespple 11 Now the two devices are connected Data from the iphone can be send by typing text on the text box and hitting send 12 Data from the STM device can be sent using the senddata command It is read and displayed automatically in the output window of the app Select Mode Peripheral test text Text Box Send nopqr Output Window XYZ abcdefghijkim DEFGHIJKLMNOPQRSTUVW 7890 lt gt ABC amp _ 123456 noparstuvwxyz lt gt XYZI l abcdefahiikim Advertising OFF Advertising ON OFF Toggle
7. to the serial port x the serial port you connected your hardware to for the board The serial parameter to use is 115200 Baud 8 no 1 no flow control Once connected reset the device using Reset button located next to the display and you should see the stack getting initialized on the terminal and the help screen will be displayed which shows all of the commands r EP COM22 PuTTY wo E m s Now connect the second board via another serial cable and follow the same steps performed before when running the Bluetooth code on the first board Demo Application The demo application provides a description on how to use the demo application to connect two configured boards and communicate over bluetoothLE The included application registers a custom service on a board when the stack is initialized Device 1 server setup on the demo application a To start with one of the devices has to have the SPP LE Service running on it It can be started by running RegisterSPPLE p EP COM22 PuTTY b Next the device acting as a server needs to advertise to other devices This can be done by running AdvertiseLE 1 Device 2 client setup on the demo application Steps c and d are optional if you already know the Bluetooth address of the device that you want to connect to c The client LE device can try to find which LE devices are in the vicinity using the command StartScanning d Once you have found the dev
Download Pdf Manuals
Related Search
Related Contents
Samsung BQ1S4T133 Uživatelská přiručka High Performance Oscilloscope Best Practices Tsi-9535-Manual - Davis Instruments DIAGNOSTICS DE SYSTÈMES OBD-II エアーフロス8000 トライアルキャンペーン ANCLAJE QUíMICO CONSTRUCT 戸 ひざ掛け本体の洗たく コン トローラーとコー ドのお手入れ Lorsque l`audace économique de neuf NÉGOCIER EN SITUATION _ Kwikset 915TRL TSCR 11P UL Instructions / Assembly Copyright © All rights reserved.
Failed to retrieve file