cancel
Showing results for 
Search instead for 
Did you mean: 

AIROC™ Bluetooth

shlim
New Contributor II

When we sending data via SPP, we are using API  'wiced_bt_spp_rx_flow_enable'  

We are testing In case of above,  last some data cannot be sent 

 

Test condition :

     PC : Bluetooth intergrated  on board

    Teraterm  Termianl : PC Side  & Device(CYW20719) Side 

                                          Setting -> local echo off 

     Eclipsed IDE Modustoolbox2.3 Wiced BTSDK v3.10

 

 Test application :

       Modustoolbox RFCOMM_Serial_port base

       Timer added for  writing data through PUART

       MEMCPY will be called in case of RFCOMM data receiving or Timer calling.

        wiced_bt_spp_rx_flow_enable  function  will be called as following the buffer size increasing .

 

   Test method :

          PC scanning DEVICE(20719EVK) -> Connect -> Open Serial port with TERATERM -> Local Echo off ->  Sending file( more than 20KB)  -> Log check

spp_rx_data_callback handle:2 len:100 20-61, total rx 18500
spp_rx_data_callback handle:2 len:100 63-61, total rx 18600
spp_rx_data_callback handle:2 len:100 79-74, total rx 18700
spp_rx_data_callback handle:2 len:100 68-72, total rx 18800
spp_rx_data_callback handle:2 len:100 65-76, total rx 18900

Disable flow
spp_rx_data_callback handle:2 len:100 69-73, total rx 19000
spp_rx_data_callback handle:2 len:100 0d-63, total rx 19100

En flow
spp_rx_data_callback handle:2 len:100 68-67, total rx 19200
spp_rx_data_callback handle:2 len:100 20-2c, total rx 19300
spp_rx_data_callback handle:2 len:100 20-73, total rx 19400
spp_rx_data_callback handle:2 len:100 20-64, total rx 19500
spp_rx_data_callback handle:2 len:100 6f-20, total rx 19600
spp_rx_data_callback handle:2 len:100 72-74, total rx 19700
spp_rx_data_callback handle:2 len:100 75-20, total rx 19800

        If you send a one byte character by press keyboard in PC Side terminal,  You can find out 100byte length data be recieved in device side on teraterm.

       ex) spp_rx_data_callback handle:2 len:100 6d-64, total rx 66400

      this phenomenon will keep going until bluetootn connection lost.

 

 

 

 

Daniel Lim
0 Likes
1 Solution
Owen_Zhang123
Moderator
Moderator

Could you try to enable the flow control in the connection_up event? Per my test, there is no problem to enable the flow control once the connection is created. Please do not disable/enable the flow control during the transfer.

View solution in original post

5 Replies
Owen_Zhang123
Moderator
Moderator

Could you see the problem with the demo code?

shlim
New Contributor II

It doesnt' happened in original demo code because it doesn't use API 'wiced_bt_spp_rx_flow_enalbe' .

But we should use that API above for the implementation.

I attacehd my code because I didn't ask customer whether to expose or not.

So, It doesn't use timer. I substituted button interrupt insttead of timer.

But result is same as well.

 

Test method :

  During the sending file, if you push the user button, sending sequence stopped, After that if you push the user button again, rest of data will be sent. But, it doesn't send whole data.

 

 

 

Daniel Lim
0 Likes
Owen_Zhang123
Moderator
Moderator

Could you try to enable the flow control in the connection_up event? Per my test, there is no problem to enable the flow control once the connection is created. Please do not disable/enable the flow control during the transfer.

shlim
New Contributor II

Hi~

Yes, you are right.  In case of that situation you mentioned, there is no problem at all.

But, we need to disable/ enable flow control during the transfer.

Is there any solution for the case above?

Daniel Lim
0 Likes
shlim
New Contributor II

I actually didn't mentioned other simillar sample application ( ex RFCOMM_Serial_Port_Multi-Port).

Because it might make a confustion.

Even if RFCOMM_Serial_port_multi-port used same API (wiced_bt_spp_rx_flow_enable), But it also has same problem.

Please refer to the attached code file 

 

Daniel Lim
0 Likes