• 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 » Low Power RF Bluetooth® Low Energy & ANT Forum » Connectab;e directed adverisement not working
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Connectab;e directed adverisement not working

Connectab;e directed adverisement not working

This question is not answered
senthil kumar69729
Posted by senthil kumar69729
on Jul 30 2012 06:55 AM
Expert1075 points

Hi all ,

Am using keyfobdemo with BLE dongle (HostTestreleaseall) ,connectable undirected adverisement is working fine ,but when i modify the code for connectable directed advertisement , i could not able to see the directed advertisement,.

This is what the change i made ,

In Peripheral.c (GAPRole_Init( ) ) ,i have modified the 

  gapRole_AdvEventType = GAP_ADTYPE_ADV_DIRECT_IND;

i have updated this global variable with my BLE dongle address , but i cannot able to see any advertisement ! Kindly help me to resolve this.

static uint8  gapRole_AdvDirectAddr[B_ADDR_LEN] = {0x3C,0x2D,0xB7,0x85,0xEE,0xFE};

I have searched the forum thoroughly but anywhere i cannot able to find "connectable directed advertisement " working ! 

Thanks in advance for the help. 

Regards,

Senthil

 

NiceDay,

Senthil

cc2540 directed advertisement
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Tim C
    Posted by Tim C
    on Aug 03 2012 18:50 PM
    Prodigy85 points

    Hello.

    It appears as if your code is correct.  It is preferable, however, to do this at the application level (keyfobdemo.c).  In a similar fashion to the other parameters, you could do:

    uint8 desired_adv_event_type = GAP_ADTYPE_ADV_DIRECT_IND;
    uint8 desired_adv_direct_addr[] =
      {
        0x3C,
        0x2D,
        0xB7,
        0x85,
        0xEE,
        0xFE
      };

      GAPRole_SetParameter( GAPROLE_ADV_EVENT_TYPE, sizeof( uint8 ), &desired_adv_event_type );
      GAPRole_SetParameter( GAPROLE_ADV_DIRECT_ADDR, B_ADDR_LEN, desired_adv_direct_addr );

    Regardless, I think your issue may be how you are interacting with the direct advertisements.  When you are performing direct advertising, you are only in the advertising state for a maximum of 1.28 seconds.  Also, you can not scan for direct advertisements; you must initiate a connection with them.  Therefore, you must call GAP_EstablishLinkReq either before or during this 1.28 seconds period.

    You can accomplish this in BTool with the following steps:

    1. Enter the keyfob's BD_ADDR into the slave BDA field on the Discover / Connect tab.  You must do this manually since you will not find it during a scan.

    2. Click establish.  This will send the GAP_EstablishLinkReq to the keyfob.

    3. Perform the directed connectable advertising with the keyfob.  You should now be in a connected state.

    You can find more information about directed connectable advertising on page 2225 of the Bluetooth 4.0 Spec.

    Best wishes,

    Tim

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • senthil kumar69729
    Posted by senthil kumar69729
    on Aug 06 2012 04:01 AM
    Expert1075 points

    Hi Timothy,

    Thanks for your information about "Directed advertisement".

    I have tried your procedure but i cannot able to connect to Keyfob.

    1.You said that i have to enter the BD_ADDR manually in the Btool,but manual enter option is not available in the Btool .( Am using the Btool comes with the version 1.2.1 )

    So ,what i did is I make my keyfob advertise ,connectable undirected advertisement and i will scan using Btool ,once the slave address appeared in the Btool , I have flashed my code ( for connectable directed advertisement ) and i will establish the connection by directly clicking on the "Establish " (Immediately after flashing the code using IAR )icon in the Btool.

    2.The B-tool will struck after receiving the GAP_HCI_ExtensionCommandStatus as shown below.

    [1] : <Tx> - 02:11:55.356
    -Type : 0x01 (Command)
    -Opcode : 0xFE09 (GAP_EstablishLinkRequest)
    -Data Length : 0x09 (9) byte(s)
    HighDutyCycle : 0x00 (Disable)
    WhiteList : 0x00 (Disable)
    AddrTypePeer : 0x00 (Public)
    PeerAddr : F0:5D:B2:EB:D7:90
    Dump(Tx):
    01 09 FE 09 00 00 00 F0 5D B2 EB D7 90

    ------------------------------------------------------------------------------------------------------------------------
    [2] : <Rx> - 02:11:55.466
    -Type : 0x04 (Event)
    -EventCode : 0xFF (HCI_LE_ExtEvent)
    -Data Length : 0x06 (6) bytes(s)
    Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
    Status : 0x00 (Success)
    OpCode : 0xFE09 (GAP_EstablishLinkRequest)
    DataLength : 0x00 (0)
    Dump(Rx):
    04 FF 06 7F 06 00 09 FE 00

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

    /* Will struck here */

    3.Upon pressing the cancel button in the B-tool , am getting "Connection not accepted " in the B-tool.

    4.I am running "Packet sniffer " in other PC , Where i can able to see "Directed adverisement PDU " with FCS error.

    NiceDay,

    Senthil

    cc2540 directed advertisement
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • senthil kumar69729
    Posted by senthil kumar69729
    on Aug 06 2012 04:04 AM
    Expert1075 points

    HI Timothy ,

    7776.DirectAdv.psd

    PFA for the log from Packet Sniffer.

    Regards,

    Senthil

    NiceDay,

    Senthil

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Tim C
    Posted by Tim C
    on Aug 06 2012 12:50 PM
    Prodigy85 points

    It turns out that you have to reverse the byte ordering when you are initializing the address of the device you are trying to direct advertise to.

    For example, if I wanted to use the address 00:18:31:85:2A:62, in the project code I would write

      uint8 desired_adv_direct_addr[] =
      {
        0x62,
        0x2A,
        0x85,
        0x31,
        0x18,
        0x00
      };

    It is not necessary to do this in BTool.  Also, I am using BTool 1.20c and I am able to to enter an address manually by entering text into the Slave BDA field.  I believe this should be the case for version 1.21 also.

    Best wishes,

    TIm

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • senthil kumar69729
    Posted by senthil kumar69729
    on Aug 07 2012 05:19 AM
    Expert1075 points

    Hi Tim,

    Thanks for your support , I can able to establish the connection :) 

    In this we are hard coding the dongle address , how can i make it generic ?

    I can change this dongle address once i established the connection through the handle from Btool ,but assume am selling a product with directed advertisement  (like keyfob which can be used with the smart phone for proximity ) so when the device is first power ON , i have to give the Smart phone address as the input to the Keyfob .How can i do this ? 

    Regards,

    Senthil 

    NiceDay,

    Senthil

    cc2540 connectable directed advertisement
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Tim C
    Posted by Tim C
    on Aug 07 2012 11:38 AM
    Prodigy85 points

    In this scenario, you will need to acquire the address of the smartphone somehow.  One method could be to initially use undirected advertisement.  You could use connectable undirected to actually establish a connection or use discoverable undirected to simply receive a scan request and send a response telling the smartphone that you want to directly advertise towards it.  Then, for every other connection after the first one, you can use directed advertising towards the smartphone.  As you can see, directed connectable advertising is generally used for fast reconnection.  If this isn't necessary for you, I would consider just using undirected advertising as it is much more flexible.

    -Tim

    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