WICED SDK 2.4.1 support SPP ?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Dear,

During evaluating WICED SDK with BCM9WCDPLUS Board.

I have a few question as below.

1. WICED SDK 2.4.1 support SPP Profile ? or WICED SDK 3.0.0 ?

2. I have test "bt_rfcomm_client" example, but I' could not connect to a remote device.

  - How can I try to connect to a remote device with specific bd_addr ?

  - Is there any user guide ?

Thanks,

Regards.

0 Likes
1 Solution
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

1) I am looking at sdk3 and it implements rfcomm for the bluetooth (only for 20702 for bridge). SPP is not implemented for 732 ble device.

2) I suggest you installed sdk3 and refer to the discussion on the whitelist. You can assign a device to the whitelist and if you set a filter to it, the next time the bluetooth will scan for only those devices on that list.

View solution in original post

19 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

1) I am looking at sdk3 and it implements rfcomm for the bluetooth (only for 20702 for bridge). SPP is not implemented for 732 ble device.

2) I suggest you installed sdk3 and refer to the discussion on the whitelist. You can assign a device to the whitelist and if you set a filter to it, the next time the bluetooth will scan for only those devices on that list.

Anonymous
Not applicable

Thank you for your information.

Does the whitelist work on classic bluetooth also ?

BR,

Joy Kang.

0 Likes

The concept of Whitelist is found in BLE node to protect itself from unwanted scans and connection requests. Classic mode does not have such a concept.

0 Likes
Anonymous
Not applicable

My understanding is same as you. then How can I create a rfcomm connection to remote server ?

In bt_rfcomm_client example, the example use wiced_bt_rfcomm_connect() API. the API does not have BD_ADDR argument. How can I pass the remote BD_ADDR to the connection library ? can you make simply application for me ?

BR,

Joy Kang.

0 Likes

I have copied the following for adding a smart device to a whitelist. You can check out the reference guide within the IDE (SDK 3.0) for more details on how to use them....

wiced_result_t wiced_bt_smartbridge_add_device_to_whitelist( const wiced_bt_device_address_t* device_address, wiced_bt_smart_address_type_t address_type )

device_address : Bluetooth address of the device to add to the whitelist

address_type : Bluetooth Smart address type of the device

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi boont,

1. Do you mean that I can use whitelist concept in classic bluetooth mode ? I am really confused.

  - I want to make an bluetooth connection in CLASSIC mode not BLE mode.  but you said "The concept of Whitelist is found in BLE node to protect itself from unwanted scans and connection requests. Classic mode does not have such a concept."

2. I've tried add whitelist using " wiced_bt_smartbridge_add_device_to_whitelis" but I could not connect to remote device. please refer to the source code I modified with "bt_rfcomm_client.c", please see the attachment and bold lines below.

---------------------------------------------------------------------------------------------------------------------------------------------

/** @file

* Bluetooth RFCOMM Client Application

*/

#include "wiced.h"

#include "wiced_bt.h"

#include "wiced_bt_rfcomm.h"

#include "bt_smart_gap.h"

/* Interval between connections in milliseconds */

#define CONNECTION_INTERVAL_MS 10000

/* Change this to your unique friendly name */

#define CLIENT_FRIENDLY_NAME   "WICED+ Client"

/* Packet content */

#define PACKET_CONTENT_STR     "Hello World from "

/* RFCOMM Server to connect to */

//#define SERVER_NAME            "WICED+ Server"

#define SERVER_NAME            "LogSole_L008001"

static void socket_event_callback( wiced_bt_rfcomm_socket_t* socket, wiced_bt_rfcomm_event_t event, void* arg );

static wiced_bool_t             connection_established = WICED_FALSE;

static wiced_semaphore_t        connection_semaphore;

static wiced_bt_rfcomm_socket_t client_socket;

/* UUID is in little endian. This has to match with the RFCOMM server UUID */

#if 0 //original

static const wiced_bt_uuid_t service_uuid =

{

    .size  = UUID_128BIT,

    .value =

    {

        .value_128_bit = { 0xCAFF, 0xDECA, 0xDEAF, 0xDECA, 0xFADE, 0xDECA, 0x0000, 0x0000 },

    },

};

#else //joy modified

static const wiced_bt_uuid_t service_uuid =

{

    .size  = UUID_16BIT,

    .value =

    {

    .value_16_bit = 0x1101,

    },

};

#endif

/******************************************************

*               Function Definitions

******************************************************/

void application_start( )

{

    /* Initialise WICED */

    wiced_init( );

    /* Initialise semaphore to indicate that connection with a client is established */

    wiced_rtos_init_semaphore( &connection_semaphore );

    /* Initialise WICED Bluetooth device */

    wiced_bt_init( WICED_BT_MPAF_MODE, "WICED+ Client" );

    /* Initialise Bluetooth RFCOMM protocol */

    wiced_bt_rfcomm_init( );

    memset( &client_socket, 0, sizeof( client_socket ) );

    /* Create an RFCOMM socket */

    wiced_bt_rfcomm_init_socket( &client_socket, socket_event_callback, NULL );

  /*begin joy added */

  wiced_result_t rspCode;

  wiced_bt_device_address_t r_address;

  r_address.address[0] = 0x68;

  r_address.address[1] = 0x84;

  r_address.address[2] = 0x70;

  r_address.address[3] = 0x00;

  r_address.address[4] = 0x80;

  r_address.address[5] = 0x01;

  rspCode = bt_smart_gap_add_device_to_whitelist(&r_address, BT_SMART_ADDR_TYPE_PUBLIC);

  WPRINT_APP_INFO( ( "rspCode=%x\r\n", rspCode ) );

  /* end joy */

    while ( 1 )

    {

        WPRINT_APP_INFO( ( "Connecting to server ...\n" ) );

        /* Attempt to connect with a WICED+ server */

        if ( wiced_bt_rfcomm_connect( &client_socket, SERVER_NAME, &service_uuid ) == WICED_SUCCESS )

        {

            wiced_bt_packet_t* packet;

            uint8_t*           data;

            /* Wait in semaphore until connection is complete.

              * socket_event_callback will set the semaphore once the RFCOMM connection is established

              */

            wiced_rtos_get_semaphore( &connection_semaphore, WICED_WAIT_FOREVER );

            if ( connection_established == WICED_TRUE )

            {

                wiced_bt_device_address_t address;

                uint32_t data_length;

                char* data_ptr;

-----------------------------------------------------------------------------------------------------------------------------------------------

BR,

Joy Kang.

0 Likes
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

As boont mentions, the Whitelist functionality you desire is a BLE function, supported on our BCM20736/7 which include a BLE stack on chip.

The current WICED SmartBridge solution is based on the BCM20702 and BCM43362.  It's my understanding that while the BCM20702 is indeed a dual mode 'Smart Ready' device (BT/BLE) from a HW perspective, the BLE portion of the device is not used within the existing SmartBridge.  In fact, there is not a Bluetooth upper layer stack included within the WICED Wi-Fi SDK where SmartBridge is supported. Access to all of the Bluetooth functionality is essentially through HCI/RFCOMM (i.e. runs as an RFCOMM client/server).

Here's the samples we provide:

  • Apps/demo/bt_smartbridge
  • Apps/snip/bt_rfcomm
  • Apps/test/bt_smartbridge_console
  • Apps/test/bt_smartbridge_mfg_test
0 Likes
Anonymous
Not applicable

Hi,

My hardware is BCM9WCDPLUS114 (BCM43362+STM32F205 WICED+ Module and BCM20702 Bluetooth module).

then do you mean smartbridge samples work as Classic Mode with BCM20702 Bluetooth module ?

but I think only bt_rfcomm sample works as classic mode. the others(bt_smartbridge, smartbrigde_consol and bt_smartbridge_mfg_test) only support BLE mode.

Anyway, I am testing with "bt_rfcomm_clinet" sample but I do not know how to connect a remote rfcomm server.

the result of connection action of the sample code is always failed.

I wan to know how to connect a remote rfcomm server which I already know the BD_ADDR of remote rfcomm server. the sample code does not include any methods of setting the BD_ADDR of remote device.

BR,

Joy Kang.

0 Likes

I will check with the developers to determine whether or not we can provide an example of the "bt_rfcomm_clinet" connecting to a remote rfcomm server with a known BR_ADDR.

More to follow on this....

In addition, I believe you are correct in that bt_smartbridge, smartbrigde_consol and bt_smartbridge_mfg_test support BLE mode.

0 Likes
Anonymous
Not applicable

Thank you for your helpful information.

I have to decide which platform I will use for my sensor bridge within a few days,

Please let me know the your side decision ASAP. (the example of the "bt_rfcomm_client" connecting to a remote rfcomm server with a known BD_ADDR)

In addition,

1. The best case is that WICED SDK includes SPP profile.

    - Do you have any plan to release SPP profile ?

2. If you do not have a plan to release SPP profile

   - Could you open APIs regarding GAP functions( at least, two APIs, Inquiry and create connection with a known BD_ADDR should be included)

Best regards,

Joy Kang.

0 Likes

I have created a case with the factory and will try to answer these questions for you in the next few working days.

You may also want to take a look at this thread as the existing Smartbidge functionality is explained here as well: Regarding Bluetooth peripheral method on WICED Wi-Fi platform

0 Likes

The developers confirmed that the current RFCOMM client does not support connecting to a server with specific BD_ADDR. Unfortunately, this is a firmware limitation which they can’t change in the application or library code.

The team normally suggests that customers use a unique device-friendly name for the server.

0 Likes
Anonymous
Not applicable

Ok, I see,

How about the additional questions ? Do you have any timeline for below features ?

1. The best case is that WICED SDK includes SPP profile.

    - Do you have any plan to release SPP profile ?

2. If you do not have a plan to release SPP profile

   - Could you open APIs regarding GAP functions( at least, two APIs, Inquiry and create connection with a known BD_ADDR should be included)

BR,

Joy,

0 Likes

Note that I confirmed today that the next release of the WICED-SDK version 3.1.1, will NOT include support for BT dual-mode stack, so any previous statements about simultaneous support for SPP and GATT are incorrect.

Essentially, while both BLE and BT Classic are supported on the current SmartBridge solutions, simultaneous support for a dual mode stack is NOT.

Here's the rundown on our offering:

1.

Currently supported on WICED-SDK-2.4.1:
BCM20702
- GATT (not-simultaneously with SPP)
- SPP/RFCOMM

2.

Currently supported on WICED-SDK-3.0.1:

2a.

BCM20702
- GATT (not-simultaneously with SPP)
- SPP/RFCOMM


2b.

BCM43341
- GATT

3.
Future support for a dual-mode stack with simultaneous SPP and GATT support on the 20702 and 43341 is definitely being planned, but we cannot provide an ETA on when this will be released.

0 Likes
Anonymous
Not applicable

Hi,

I do not need dual mode stack at the moment, I can follow your timeline for the dual mode stack.

Now I only need serial port profile(classic mode).

But I have some trouble with create a rfcomm connection to remote server.

When I try to create a rfcomm connection, I always get a "MPAF_PAGE_TIMEOUT" result.

Maybe I did something wrong with rfcomm server setting. My rfcomm server setting is like below.

- uuid : 0x1101

- server name : "WICED+ Server"

- Class Of Device: 0x1f000000  - do I have to a proper CoD ?


Please let me get a guidance for rfcomm server settings.

BR,

Joy Kang.

0 Likes

I have updated the case I created with the developers to see if they can provide some specific guidance on the problem you've identified.

0 Likes
Anonymous
Not applicable

Hi,

Now, I can successfully connect a remote rfcomm server.

I have to modify two major things as below for my rfcomm server.

1. Class of Device should be 0x7A020C.

2. 16bit UUID does not work. so I made new sdp service record with 128 bit uuids.

There is one more problem.

I thought the WICED rfcomm client would use unique friendly name for creating a connection. but the WICED rfcomm client do not use server name. Only CoD(class of device) is used. ie, WICED rfcomm client do not use SERVER_NAME.

Actually, the best way to create rfcomm connection for my system is using a known BD_ADDR,

and second choice is using known friendly name.

BR,

Joy.

0 Likes

Could you post the code you are using so that one of our developers can take a look?

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Please refer to the attachment.

For your information.

The rfcomm_server is based on CSR BC04-ext (Bluelab SDK )

The rfcomm_client is WICED rfcomm_client.

Only thing I want to get,  is new APIs which uses BD_ADDR or friendly name for BT Connection

1. Connecting with BD_ADDR : priority 1, Do you have any plan for new API ?

2. Connecting with friendly name: priority 2, According to your posting before, this function should work properly, but not. Is it a bug ?

BR,

Joy Kang.

0 Likes