I read from a characteristic of a ble peripheral on IoS some data, and when I try to print them, it just says 2 bytes. Looking at the type it is a optional Data type (Data?).
My question is, to convert that value to a readable integer, what is the best as fastest practice in swift 5?
If I try to print characteristic.value it just says "2 bytes". characteristic.value is an optional Data type.
switch characteristic.uuid:
   case accelerometerUUID:
      if characteristic.value != nil {
            let accelValue = ???
            print(accelValue)
      }
Thank you very much!
 
    