/// Convert a CBUUID object to the standard Uuid type.
Convert a CBUUID object to the standard Uuid type.
Convert a CBUUID object to the standard Uuid type .
pub fn cbuuid_to_uuid(cbuuid: id) -> Uuid {
    // NOTE: CoreBluetooth tends to return uppercase UUID strings, and only 4
    // character long if the UUID is short (16 bits). It can also return 8
    // character strings if the rest of the UUID matches the generic UUID.
    let uuid = nsstring_to_string(cb::uuid_uuidstring(cbuuid)).unwrap();
    let long = if uuid.len() == 4 {
        format!("0000{}-0000-1000-8000-00805f9b34fb", uuid)
    } else if uuid.len() == 8 {
        format!("{}-0000-1000-8000-00805f9b34fb", uuid)
    } else {
        uuid
    };
    let uuid_string = long.to_lowercase();
    uuid_string.parse().unwrap()
}
pub fn cbuuid_to_uuid ( cbuuid : id ) -> Uuid { // NOTE: CoreBluetooth tends to return uppercase UUID strings, and only 4 // character long if the UUID is short (16 bits). It can also return 8 // character strings if the rest of the UUID matches the generic UUID. let uuid = nsstring_to_string ( cb :: uuid_uuidstring ( cbuuid ) ) . unwrap ( ) ; let long = if uuid . len ( ) == 4 { format ! ( " " uuid ) } else if uuid . len ( ) == 8 { format ! ( " " uuid ) } else { uuid } ; let uuid_string = long . to_lowercase ( ) ; uuid_string . parse ( ) . unwrap ( ) }
Convert a CBUUID object to the standard Uuid type.
Convert a CBUUID object to the standard Uuid type .
cbuuid
id