• 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 » BLE CC2540 SimpleBLEPeripheral - Default Notifications On
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

BLE CC2540 SimpleBLEPeripheral - Default Notifications On

This question is not answered
Erik Hammer
Posted by Erik Hammer
on May 06 2012 02:04 AM
Prodigy40 points

Hello,

Basically what I'am trying to do is to, upon initialization, write a value of 0x01 to the characteristic configuration at handle 0x0034 of the simple keys profile to turn on key press notifications. This will eliminate the need for me to do this in BTool every time i connect the dongle to the key fob. I just want the notifications to be on as soon as I establish a connection. I thought this would be pretty simple, and it probably is but don't fully understand how the handles work. It looks to me that in simplekeys.c, all the handles are initialized to zero? shouldn't they already be initialized with values like 0x0033, 0x0034?

// Characteristic Value- Key Pressed
{
{ ATT_BT_UUID_SIZE, keyPressedUUID },    // keyPressedUUID = 0xFFE1
0,                                                                             // Permissions
0,                                                                             // Handle
&skKeyPressed                                                   // pValue
},

// Characteristic configuration
{
{ ATT_BT_UUID_SIZE, clientCharCfgUUID },       // clientCharCfgUUID = 0x2902
GATT_PERMIT_READ | GATT_PERMIT_WRITE,
0,                              // <- 0x0034???
(uint8 *)skConfig   // <- 0x01???
},

If someone could explain to me how handles are initialized and where and I can change the default characteristic configuration value to 0x01 that would be great.

bStatus_t SK_AddService( uint32 services )
{
uint8 status = SUCCESS;

// Initialize Client Characteristic Configuration attributes
for ( uint8 i = 0; i < GATT_MAX_NUM_CONN; i++ )
{                                                                                                     I tried changing values 
skConfig[i].connHandle = INVALID_CONNHANDLE;         <-here 0x0034
skConfig[i].value = GATT_CFG_NO_OPERATION;             <-and here 0x01

}                                                                                                     doesn't work.

CC2540 BLE SimpleBLEPeripheral notification Characteristic Configuration Handle Key Press
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Drave Dravenburgh
    Posted by Drave Dravenburgh
    on May 06 2012 07:10 AM
    Prodigy200 points

    Good question, would like to know either.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • 1960865
    Posted by 1960865
    on May 07 2012 09:40 AM
    Intellectual775 points

    Eric

    The handles are assigned at compile time and incrementally whenever you add a service.  For the Simple Keys, the method SK_AddService is calling 'GATTServApp_RegisterService' to register the services and I believe it is there where it is assigned a handle. Maybe TI personnel can confirm that. Depending on the call structure, the handles can be different based on services registered.  see keyfobdemo.c in function 'KeyFobApp_Init'.  Hope that helps.

    I am interested in knowing how to auto turn on notification if you figured it out.

    ~LD

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Erik Hammer
    Posted by Erik Hammer
    on May 14 2012 19:34 PM
    Prodigy40 points

    Some Ti support would be appreciated.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Leo Bodnar
    Posted by Leo Bodnar
    on May 15 2012 12:53 PM
    Intellectual410 points

    I think it is a BLE question, not TI question...

    http://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml

    1. The default value for the Client Characteristic Configuration descriptor is 0x00.
    2. Upon connection of non-binded clients, this descriptor is set to the default value.
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Pierre Bouchet
    Posted by Pierre Bouchet
    on May 18 2012 05:14 AM
    Prodigy60 points

    Notifications can be enabled after a link has been established.

    One way to do this is to register a callback for GAP profile state change - you can pass it to GAPRole_StartDevice - and in this callback you enable notifications for the desired characteristic whenever the gap role_State_t parameter passed to it is equal to GAPROLE_CONNECTED.

    To enable notifications I call the GATTServApp_WriteCharCfg function, I don't know if there is another way.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • 1960865
    Posted by 1960865
    on May 23 2012 08:29 AM
    Intellectual775 points

    Pierre

    Using the BTool, we first have to use service discovery to acquire the profile handle; then enable the notification.  You suggest that once connected, you can do that which is true but how to tell which profile notification we the master is turning ON?

    Maybe a TI's personnel can help point out the documentation where this is stated more clearly on how to do it.

    thanks

    ~LD

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Pierre Bouchet
    Posted by Pierre Bouchet
    on May 23 2012 11:05 AM
    Prodigy60 points

    Hi,

    The information available about GATTServApp_WriteCharCfg in the GATT server API documentation is rather succinct, but you should take a look at it nonetheless :)

    I suppose somewhere in your source code you have an array of gattAttribute_t that defines the attributes of your profile. Well, a gattAttribute_t structure has a handle member which is described as follows in gatt.h: "Attribute handle - assigned internally by attribute server". So that's how you retrieve an attribute handle.

    Otherwise I think what you really need is GATTServApp_WriteCharCfg which only needs a pointer to the gattCharCfg_t structure you want to target.

    Best Regards,

    Pierre

    P.S: I edited my answer after noticing I was confusing GATTServApp_WriteCharCfg with GATTServApp_ProcessCCCWriteReq.

    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