Swift3 UInt8 转 Int

    //接收到Data类型的蓝牙数据
    let data = characteristic.value
    
    //将数据转存到[UInt8]数组
    let resultByte = (data?.withUnsafeBytes {
        [UInt8](UnsafeBufferPointer(start: $0, count: (data?.count)!))
        })! as [UInt8]
    
    //以数据长度进行for循环遍历
    for i:Int in 0..

你可能感兴趣的:(Swift3 UInt8 转 Int)