• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Low Power RF & Wireless Connectivity » Bluetooth® Applications » BT SPP Send Behavior
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

BT SPP Send Behavior

This question is answered
Miguel
Posted by Miguel
on May 25 2011 18:57 PM
Genius11780 points

TI team,

         I have couple of questions regarding the BT_spp_send function. I hope you can help.

  1. When BT_spp_send() is executed, sdk_error_handler() goes into an endless-loop condition sometimes.  In this case, sdk_error_code is 22(SDK_BT_MEM_ALLOC_FAIL) . What could be causing this error? How can I debug it? What should I change?
  2. If BT_spp_send() is called consecutively, should it be called in the callback routines named “API_RESULT appl_spp_notify_cb()” or “API_RESULT appl_spp_l2cap_tx_queue_flow_cb()”? From our experiments, we observe the following: When BT_spp_send() returns API_SUCCESS and then BT_spp_send() is called next with 70 byte data transfer, it becomes SDK_BT_MEM_ALLOC_FAIL at 4th transfer.  For example,   70byte(OK) --> 70byte(OK) --> 70byte(OK) --> failed.
  3. BT_spp_send() may return “SPP_ERR_INVALID_STATE”  . What is the condition that would return this state? What should I check under this state?

Thank you for you help,

 

SPP Send
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Balaji Jeyaraman
    Posted by Balaji Jeyaraman
    on Jun 06 2011 06:59 AM
    Verified Answer
    Verified by Miguel
    Intellectual440 points

    1 & 2 :

    If BT_spp_send() is failing frequently, it typically points to incorrect handling of RTS. The BT controller is unable to send anything back to the MSP430 leading to memory allocation failures since the application is still trying to pump data to the controller. As part of the demo application, RTS is enabled only as part of the Idle hook and is disabled elsewhere.

    You can try the following:

    a. Check if RTS is being handled correctly as part of the application customizations

    b. Try to increase the number of allocated BT buffers as part of heap_bt.c to see if this makes any difference. However, note that this should not be required since we have validated the SDK behavior with 110 bytes of payload.

     

    3:

    SPP_ERR_INVALID_STATE is returned for the following conditions:

    a. If BT_spp_start() is called without required initialization

    b. If BT_spp_connect() is called without required initialization

    c. If BT_spp_disconnect() is called without required initialization

    d. If BT_spp_send() is called without required initialization

    Please initialize SPP and then call the required SPP API functions.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • 1879031
    Posted by 1879031
    on Dec 21 2011 21:11 PM
    Prodigy80 points

    Another help needed using the api BT_spp_send():

    i wanna send a test array with measured signal values. They including also negativ values.

    i take a look at the API :

    API_RESULT BT_spp_send (

       IN SPP_HANDLE spp_handle,

       IN UCHAR *data,

       IN UINT16 data_len

    )

    with UCHAR *data I can only send values between 0...255. And i didnt understand, why data so send is 1Byte and data length of data send is 2Byte.

    What kind of modifications are needed to send value of e.g. short int.?

    I am working on the demo accel-app...

    regards,

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • srisenthilkumar chandrasekaran
    Posted by srisenthilkumar chandrasekaran
    on Jan 26 2012 23:48 PM
    Verified Answer
    Verified by Miguel
    Intellectual425 points

    UCHAR data Signifies byte information and payload could be anything, but it needs to be encoded before transmission and decoded after receives.

    ex. To transmit short int data(X = 0x1234)

     in transmission,

    data[0] = X / 0x100; /* MSB of variable 'X' */

    data[1] = X % 0x100; /* LSB of variable 'X' */

    in Receiver,

    Y = (int)(data[0] * 0x100) + data[1];

    So application data signals needs to be encoded and decoded based on the application data range.

     

    Regards

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • 1879031
    Posted by 1879031
    on Feb 20 2012 08:09 AM
    Prodigy80 points

    I have problem with decoding data < 256, especially sending zero ... the receviing data is diffrent according to data >= 256

    any idea about this?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Miguel
    Posted by Miguel
    on Feb 20 2012 14:27 PM
    Genius11780 points

    Kire,

    Could you provide more details on the issue? Could you put an example of what you are getting vs what you are expecting?

    Regards,

    Miguel

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • srisenthilkumar chandrasekaran
    Posted by srisenthilkumar chandrasekaran
    on Feb 27 2012 00:12 AM
    Intellectual425 points

    Hi Kire,

    Could you please give us more details about "I have problem with decoding data < 256, especially sending zero ... the receviing data is diffrent according to data >= 256"

    anyway decoding and encoding logic is based on the developer and an application.Here our question is " In the bluetooth(stack) level are you getting any data/byte corruption or missing" ?

    Thanks
    Senthil.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use