NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

WL18xx TI Bluetooth Stack OPPM Demo App

From Texas Instruments Wiki
Jump to: navigation, search

Return to WL18xx AM335x TI Bluetooth Stack

Demo Overview[edit]

NoteNote: : This instructions can be used to run this demo on the AM335x Platform.
This demo allows users to evaluate TI's WL18xx device by using the AM335x platform. The OPP sample application code is provided to enable a rich out-of-box experience to the user. The application allows the user to use a console to exchange object between two Bluetooth devices. OPP defines the roles of push server and push client. These roles are analogous to and must interoperate with the server and client device roles that GOEP defines.

It is recommended that the user visits the kit setup Getting Started Guide for AM335x pages before trying the application described on this page.


Running the Bluetooth Code[edit]

Once the am335x is initialized on the terminal, follow the instructions;
Enter to the Sample Application folder, for this example “cd BluetopiaPM/bin”

 root@am335x-evm:~# cd BluetopiaPM/bin/
 root@am335x-evm:~/BluetopiaPM/bin#

Start the Server and the Demo application by typing “./SS1BTPM & ./LinuxOPPM”

root@am335x-evm:~/BluetopiaPM/bin# ./SS1BTPM & ./LinuxOPPM
[1] 1789

Now the help screen is displayed


******************************************************************
* Command Options: 1) Initialize                                 *
*                  2) Cleanup                                    *
*                  3) QueryDebugZoneMask                         *
*                  4) SetDebugZoneMask                           *
*                  5) ShutdownService                            *
*                  6) RegisterEventCallback,                     *
*                  7) UnRegisterEventCallback,                   *
*                  8) QueryDevicePower                           *
*                  9) SetDevicePower                             *
*                  10)QueryLocalDeviceProperties                 *
*                  11)SetLocalDeviceName                         *
*                  12)SetLocalClassOfDevice                      *
*                  13)SetDiscoverable                            *
*                  14)SetConnectable                             *
*                  15)SetPairable                                *
*                  16)StartDeviceDiscovery                       *
*                  17)StopDeviceDiscovery                        *
*                  18)QueryRemoteDeviceList                      *
*                  19)QueryRemoteDeviceProperties                *
*                  20)AddRemoteDevice                            *
*                  21)DeleteRemoteDevice                         *
*                  22)DeleteRemoteDevices                        *
*                  23)PairWithRemoteDevice                       *
*                  24)CancelPairWithRemoteDevice                 *
*                  25)UnPairRemoteDevice                         *
*                  26)QueryRemoteDeviceServices                  *
*                  27)RegisterAuthentication                     *
*                  28)UnRegisterAuthentication                   *
*                  29)PINCodeResponse                            *
*                  30)PassKeyResponse                            *
*                  31)UserConfirmationResponse                   *
*                  32)ChangeSimplePairingParameters              *
*                  33)RegisterServer                             *
*                  34)UnRegisterServer                           *
*                  35)ConnectionRequestResponse                  *
*                  36)ParseRemoteObjectPushServices              *
*                  37)ConnectRemoteDevice                        *
*                  38)Disconnect                                 *
*                  39)Abort                                      *
*                  40)PushObject                                 *
*                  41)PullBusinessCard                           *
*                  42)EnableBluetoothDebug                       *
*                  Help, Quit.                                   *
******************************************************************




Demo Application[edit]

The demo application provides a description on how to use the demo application to connect two configured boards and communicate over Bluetooth.

Object Push Profile (OPPM)[edit]

OPPM Server Role[edit]

To verify the OPPM server role functionality, first run the "LinuxOPPM" executable, initialize, and power on the local device if necessary.


a) Initialize the profile by typing “1 1” or “Initialize 1”.
b) Powering up the Bluetooth device by typing “9 1” or "SetDevicePower 1”, if the device is already powered up you’ll receive an error that the device is already powered up

BTPM_Initialize() Success: 0.
DEVM_RegisterEventCallback() Success: 5.
OPPM>SetDevicePower 1


[181005.336514] (hci_tty): inside hci_tty_open (ecc4d3c0, ebc308c0)
[181005.343991] (stc):  chnl_id list empty :4
[181005.348046] (stk) : st_kim_start(stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

uim:read 1 from install

uim:@ st_uart_config
uim: signal received, opening /dev/ttyS1
uim:@ set_baud_rate
uim:set_baud_rate() done
uim:Setting speed to 3000000
uim:@ read_command_complete
uim: Command complete started
uim:@ read_hci_event
uim: read_hci_event
uim:Command complete done
[181005.510834] (stc): st_tty_open
uim:Speed changing to 3000000, 1
uim:@ set_custom_baud_rate
(stk) :line discipline installeduim:Installed N_TI_WL Line displine
[181005.525049] (stk) :TIInit_11.8.32.bts
uim:begin polling...
(stk) :change remote baud rate command in firmware
[181005.538289] (stk) :skipping the wait event of change remote baud[181006.293999] (stc): add_channel_to_table: id 4
[181006.298481] (stc): add_channel_to_table: id 2
[181006.302978] (stc): add_channel_to_table: id 3
BT COMM PORT (/dev/hci_tty): 1
DEVM_PowerOnDevice() Success: 0.
OPPM>
Device Powered On.
OPPM>
c) Registering a OPP server.
OPPM>RegisterServer

Usage: RegisterServer [ServerPort] [SupportedObjectTypes] [IncomingConnectionFlags] [ServiceName].
OPPM>
OPPM>RegisterServer 5 0xFF 0 OPP_Test

OPPM_Register_Server: Function Successful. ServerID: 1
OPPM>
d) Initiate OPP connection from the remote device.
Remote Device Found.
BD_ADDR:       001583584D9F
COD:           0x04C1CC
Device Name:
Device Flags:  0x80000000
RSSI:          0
Friendly Name:
App. Info:   : 00000000
Paired State : FALSE
Connect State: FALSE
Encrypt State: FALSE
Serv. Known  : FALSE
OPPM>
Remote Device Properties Changed.
BD_ADDR:       001583584D9F
Device Flags:  0x80000008
Connect State: TRUE
OPPM>
Remote Device Properties Changed.
BD_ADDR:       001583584D9F
Device Name:   CSR8510 A10
Device Flags:  0x80000009
OPPM>
OPPM Device Connected:
   Server ID: 1
   Remote Device Address: 001583584D9F
OPPM>
e) From the remote device, pull the business card of the OPP server.
OPPM Pull Business Card Request:
   Server ID: 1
   Remote Device Address: 001583584D9F

OPPM_Pull_Business_Card_Response() Successful.
OPPM>
f) From the remote device, push an object to the OPP server.
OPPM Push Object Request:
   Server ID: 1
   Remote Device Address: 001583584D9F
   Object Type: vCard
   Object Name: Default.vcf
   Total Length: 231
   Final: TRUE
   Data Length: 231
   Data:
BEGIN:VCARD
VERSION:2.1
FN:John Q. Public
N:Public;John;Q.;;
EMAIL;INTERNET:jpublic@stonestreetone.com
TEL;PREF;WORK:502-7
231 bytes written to file :Default.vcf
OPP_Push_Object_Response() Successful.
OPPM>
g) Disconnect the remote device from the local device.
OPPM>UnRegisterServer 1

OPPM_Un_Register_Server: Function Successful.
OPPM>
Remote Device Properties Changed.
BD_ADDR:       001583584D9F
Device Flags:  0x80000001
Connect State: FALSE
OPPM>


OPPM Client Role[edit]

To verify the OPPM client role functionality, first run the "LinuxOPPM" executable, initialize, and power on the local device if necessary.


a) Initialize the profile by typing “1 1” or “Initialize 1”.
b) Powering up the Bluetooth device by typing “9 1” or "Set DevicePower 1”, if the device is already powered up you’ll receive an error that the device is already powered up

BTPM_Initialize() Success: 0.
DEVM_RegisterEventCallback() Success: 5.
OPPM>SetDevicePower 1


[181005.336514] (hci_tty): inside hci_tty_open (ecc4d3c0, ebc308c0)
[181005.343991] (stc):  chnl_id list empty :4
[181005.348046] (stk) : st_kim_start(stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

uim:read 1 from install

uim:@ st_uart_config
uim: signal received, opening /dev/ttyS1
uim:@ set_baud_rate
uim:set_baud_rate() done
uim:Setting speed to 3000000
uim:@ read_command_complete
uim: Command complete started
uim:@ read_hci_event
uim: read_hci_event
uim:Command complete done
[181005.510834] (stc): st_tty_open
uim:Speed changing to 3000000, 1
uim:@ set_custom_baud_rate
(stk) :line discipline installeduim:Installed N_TI_WL Line displine
[181005.525049] (stk) :TIInit_11.8.32.bts
uim:begin polling...
(stk) :change remote baud rate command in firmware
[181005.538289] (stk) :skipping the wait event of change remote baud[181006.293999] (stc): add_channel_to_table: id 4
[181006.298481] (stc): add_channel_to_table: id 2
[181006.302978] (stc): add_channel_to_table: id 3
BT COMM PORT (/dev/hci_tty): 1
DEVM_PowerOnDevice() Success: 0.
OPPM>
Device Powered On.
OPPM>
c) Discover and identify remote device services.
OPPM>QueryRemoteDeviceServices

Usage: QueryRemoteDeviceServices [BD_ADDR] [Force Update] [Bytes to Query (specified if Force is 0)].
Function Error.
OPPM>
OPPM>QueryRemoteDeviceServices 001583584D9F 1

Attempting Query Remote Device 001583584D9F For Services.
DEVM_QueryRemoteDeviceServices() Success: 0, Total Number Service Bytes: 0.
OPPM>
Remote Device Properties Changed.
BD_ADDR:       001583584D9F
Device Flags:  0x80000049
Connect State: TRUE
OPPM>
Remote Device 001583584D9F Services Status: BR/EDR, SUCCESS.
OPPM>
Remote Device Properties Changed.
BD_ADDR:       001583584D9F
Device Flags:  0x80000149
Serv. Known  : TRUE
OPPM>
Remote Device Properties Changed.
BD_ADDR:       001583584D9F
Device Flags:  0x80000101
Connect State: FALSE
OPPM>
d) Connect to remote device.
OPPM>ConnectRemoteDevice

Usage: ConnectRemoteDevice [BD_ADDR] [Server Port] [Connection Flags (1 - Authenticate, 2 - Encrypt)].
Function Error.
OPPM
>ConnectRemoteDevice 001583584D9F 5 0

OPPM_Connect_Remote_Device: Function Successful. ClientID: 1
OPPM>
Remote Device Properties Changed.
BD_ADDR:       001583584D9F
Device Flags:  0x80000149
Connect State: TRUE
OPPM>
OPPM Connection Status:
   Client ID: 1
   Remote Device Address: 001583584D9F
   Status: 0
OPPM>
e) Pull a business card from the remote device.
OPPM>PullBusinessCard

Usage: PullBusinessCard [Client ID] [Filename to save card].
Function Error.
OPPM>
OPPM>PullBusinessCard 1 TestPullBusinessCard.vcf

OPPM_Pull_Business_Card_Request: Function Successful.
OPPM>
OPPM Pull Business Card Response:
   Client ID: 1
   Remote Device Address: 001583584D9F
   Response Code: 0
   Total Length: 0
   Data Length: 230
   Final: TRUE
Data:
BEGIN:VCARD
VERSION:2.1
FN:John Q. Public
N:Public;John;Q.;;
EMAIL;INTERNET:jpublic@stonestreetone.com
TEL;PREF;WORK:502-7
230 bytes written to file :1
OPPM>
f) Push an object to the remote device.
OPPM>PushObject

Usage: PushObject [Client ID] [Object Type] [Object File Name].
Function Error.
OPPM>
OPPM>PushObject 1 0 Default.vcf

OPPM_Push_Object_Request: Function Successful.
OPPM>
OPPM Push Object Response:
   Client ID: 1
   Remote Device Address: 001583584D9F
   Response Code: 0
OPPM>
g) Disconnect from the remote device.
OPPM>Disconnect 1

OPPM_Disconnect: Function Successful.
OPPM>
Remote Device Properties Changed.
BD_ADDR:       001583584D9F
Device Flags:  0x80000101
Connect State: FALSE
OPPM>
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article WL18xx TI Bluetooth Stack OPPM Demo App here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article WL18xx TI Bluetooth Stack OPPM Demo App here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article WL18xx TI Bluetooth Stack OPPM Demo App here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article WL18xx TI Bluetooth Stack OPPM Demo App here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article WL18xx TI Bluetooth Stack OPPM Demo App here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article WL18xx TI Bluetooth Stack OPPM Demo App here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article WL18xx TI Bluetooth Stack OPPM Demo App here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article WL18xx TI Bluetooth Stack OPPM Demo App here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article WL18xx TI Bluetooth Stack OPPM Demo App here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity