• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Question about getBytes:length:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about getBytes:length:


  • Subject: Re: Question about getBytes:length:
  • From: Wim Lewis <email@hidden>
  • Date: Tue, 24 Nov 2015 10:58:56 -0800

On Nov 23, 2015, at 8:57 PM, Charles Srstka <email@hidden> wrote:
> Is there a possible typo here? It looks like you’re reading in 16 *bytes* of data, and then comparing it against an integer that is 16 *bits* in size. Is that what you meant to do?

Bluetooth has a number of "short form" UUIDs where most of the UUID is fixed and the remainder is assigned by a central authority.

    https://www.bluetooth.org/en-us/specification/assigned-numbers/service-discovery

(I'd argue that -compareCBUUIDToInt:UUID2: should probably be making sure that the remaining fourteen bytes have the expected value, and OSReadBigInt16() is probably less likely to break in the future than swap-and-memcmp, but that's all by-the-way.)



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Question about getBytes:length:
      • From: Charles Srstka <email@hidden>
References: 
 >Question about getBytes:length: (From: "Eric E. Dolecki" <email@hidden>)
 >Re: Question about getBytes:length: (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: Swift - internal class conforming to public protocol
  • Next by Date: Re: Question about getBytes:length:
  • Previous by thread: Re: Question about getBytes:length:
  • Next by thread: Re: Question about getBytes:length:
  • Index(es):
    • Date
    • Thread