Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8566793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:44:14+00:00 2026-06-11T17:44:14+00:00

I tried to create a 128Bit with the iOS CoreBluetooth framework. The code that

  • 0

I tried to create a 128Bit with the iOS CoreBluetooth framework.

The code that I have written is here:

//16Bit Value-String
static NSString * const ADVERTISING_SERVICE_16=@"FFC0";

//Var for 128Bit String
static NSString * ADVERTISING_SERVICE;


//A Base UUID 
static NSString * const BASE_UUID=@"0405060708090A0B0C0D0E0F";

+ (NSString*) get128BitUUID:(NSString*)uuid{
    return [[NSString alloc] initWithFormat:@"0000%@%@",uuid,BASE_UUID];
}

ADVERTISING_SERVICE = [UUIDFuncs get128BitUUID:ADVERTISING_SERVICE_16];

And now when I try to get a UUID with this:

if([service.UUID isEqual:[CBUUID UUIDWithString:ADVERTISING_SERVICE] ]){
    [peripheral discoverCharacteristics:nil forService:service];
}

I get this error message:

2012-09-04 14:18:06.127 blukiiFirmwareTest[3154:707] *** Terminating app due to uncaught
exception 'Invalid UUID string', reason: 'String 0000FFC00405060708090A0B0C0D0E0F 
does not represent a valid UUID'

I don’t understand why; the string is a 16 Byte long UUID, this is 128 Bit so why am i getting this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:44:16+00:00Added an answer on June 11, 2026 at 5:44 pm

    On the command line type uuidgen to create a new random uuid:

    0C50D390-DC8E-436B-8AD0-A36D1B304B18
    

    You’ll see it is the form of 8-4-4-4-12 as mentioned by the wikipedia page linked by @PenguinCoder too.

    Creating a CBUUID with a string in this format will work:

    CBUUID *uuid = [CBUUID UUIDWithString:@"0C50D390-DC8E-436B-8AD0-A36D1B304B18"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to create a code that adds 2 percent each time a component
I have some encryption code that has been written in Perl (also a code
I have tried create this table, but nothing I have tried works from FKs.
I tried to create jar file using command line that I inserted into java
I tried to create one more new ASP.NET MVC application (with Entity Framework) and
Tried to create this Extension method. Works except that the helper is rendering text,
I tried to create a HelloWorld App that will update a text field with
I tried to create a container for posible metadata that can be attached to
I tried to create a code to execute something at the end of a
Hello! I tried create an app from that website: http://www.appcoda.com/customize-table-view-cells-for-uitableview/ There we created a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.