• 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 » reading the Bluetooth peripheral device name
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

reading the Bluetooth peripheral device name

This question is not answered
Timothy Mulrooney
Posted by Timothy Mulrooney
on May 03 2012 09:57 AM
Prodigy175 points

I am using both the SmartRF05 board and the mini DK keyfob. I have loaded several different TI examples into each of them. All of them have the code shown below that looks like it sets the name. I also have code running on an Iphone 4S (IOS 5.1) and a MAC mini (MAC OS).


// GAP GATT Attributes
static uint8 attDeviceName[GAP_DEVICE_NAME_LEN] = "CC2540DK-mini Keyfob";

 
  // Set the GAP Attributes
  GGS_SetParameter( GGS_DEVICE_NAME_ATT, GAP_DEVICE_NAME_LEN, attDeviceName );

I use the following to read the device name when running from the iPhone 4S or the MAC mini.

printf("Name: %s\n",[peripheral.name UTF8String]);

My questions are the following:

1. the name seen does not seem to match what is in quotes. keyfob example printed "Keyfobdemo". other examples were similar. They seemd to correspond to the file name but not exactly.

2. the name did not change when I flashed a different  example into the smartrf board or the keyfob.

3. the names were not the same depending on whether they were read on the iPhone 4S or the MAC mini. MAC Mini would read "null" a lot for the name.

4. how can I set this name based on the example I am running. It is essential to my application that I read a unique device name so as to make sure it is the proper BLE hardware before I try to connect.

yes I can make a characteristic in my device and try to read that to verify but that requires that I connect first. I could have several BLE devices in the vicinity. I want to ensure I have the correct one by name before I connect.



Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Fred Visticot
    Posted by Fred Visticot
    on May 03 2012 16:09 PM
    Intellectual700 points

    Timothy,

    My view is that you are changing the device name and NOT the deviceName exposed when the device broadcast is info (RSP_DATA)

    To Change the name visible from your iPhone, you need to set this name with the following fonction:

    GAPRole_SetParameter( GAPROLE_SCAN_RSP_DATA, sizeof ( deviceName ), deviceName );

    In the Keyfob demo, this value is set to:

    // GAP - SCAN RSP data (max size = 31 bytes)
    static uint8 deviceName[] =
    {
    // complete name
    0x0b, // length of first data structure (11 bytes excluding length byte)
    0x09, // AD Type = Complete local name
    0x4b, // 'K'
    0x65, // 'e'
    0x79, // 'y'
    0x66, // 'f'
    0x6f, // 'o'
    0x62, // 'b'
    0x64, // 'd'
    0x65, // 'e'
    0x6d, // 'm'
    0x6f, // 'o'
    };

    I hope it is the good answer :)

    -Fred

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Timothy Mulrooney
    Posted by Timothy Mulrooney
    on May 04 2012 06:43 AM
    Prodigy175 points

    Fred

    Thanks for the quick response. You are exactly right. The data that is advertised is the value that is set to CBPeripheral peripheral.name. That answers what I see when I print the name. This matches for my device as well as keyfob and simpleBLE Peripheral examples as well.

    The iPhone "remembered" the first device name it saw when I changed the device name time and time again. The only way I was able to get the device name to change as seen by the iPhone was to COMPLETELY power down the iPhone and power up again. It would then see the new name. I think it is because the iPhone saw the same UUID and only the name changed so it must have ignored it. Is there a way to clear out all Bluetooth UUID so that it will always use the current scanned in device name.

    The MAC mini worked the same way. the MAC OS application did not see the device name change. iT remebered the "first" name it saw for the smartRF board.

    I am still confused how to guarantee that the name change is seen even though the device itself (UUID) remains the same. I am loading several different exampels and applications into the smartrf and keyfob. they all have different names obviously. the iPhone and mac min seem to "remember" the first one it sees.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Senthil kumar103423
    Posted by Senthil kumar103423
    on May 16 2012 02:06 AM
    Prodigy250 points

    Hi Fred ,

    Is there any way so that we can change this name from the Server ,not in the source code as mentioned by you ?

    Thanks 

    Senthil kumar .I

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Fred Visticot
    Posted by Fred Visticot
    on May 16 2012 02:18 AM
    Intellectual700 points

    Hello Kumar,

    I have tried and read all the forum but no complete info to change the name :(

    We really need to get support from Texas Instrument !!!

    @TI support: Can you please help us ?

    - Fred

    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