Skip to content

Instantly share code, notes, and snippets.

@blakemerryman
Last active August 29, 2015 14:07
Show Gist options
  • Save blakemerryman/6b24cfe3c43485af60de to your computer and use it in GitHub Desktop.
Save blakemerryman/6b24cfe3c43485af60de to your computer and use it in GitHub Desktop.
Adds property to NSData (in Swift) that calculates number of Core Bluetooth packets data will be split up into
public extension NSData {
// Calculates the number of packets it should be broken down into based on Core Bluetooth spec of 20 Bytes/Packet
var packetCount : Int { return Int( ceil( Double(self.length) / 20.0 ) ) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment