         }
     }
     
-
+    //***************************************************************************************************
+    // Common
+    //***************************************************************************************************
+    struct UInt8Period : DeserializedStruct {
+        var periodRaw   : UInt8
+        var period      : Int
+        static func fromRawValues(values:[UInt8]) -> UInt8Period? {
+            var period = 10*Int(values[0])
+            if period < 10 {
+                period = 10
+            }
+            return UInt8Period(periodRaw:values[0], period:period)
+        }
+        static func fromStrings(values:Dictionary<String, String>) -> UInt8Period? {
+            if let period = values["period"]?.toInt() {
+                let rawPeriod = self.periodRawFromPeriod(period)
+                return UInt8Period(periodRaw:rawPeriod, period:10*period)
+            } else {
+                return nil
+            }
+        }
+        static func periodRawFromPeriod(period:Int) -> UInt8 {
+            let scaledPeriod = period/10
+            if scaledPeriod > 255 {
+                return 255
+            } else if scaledPeriod < 10 {
+                return 10
+            } else {
+                return UInt8(scaledPeriod)
+            }
+        }
+        var stringValues : Dictionary<String,String> {
+        return ["periodRaw":"\(periodRaw)", "period":"\(period)"]
+        }
+        func toRawValues() -> [UInt8] {
+            return [periodRaw]
+        }
+    }
+    
+    enum Enabled: UInt8, DeserializedEnum {
+        case No     = 0
+        case Yes    = 1
+        static func fromRaw(value:UInt8) -> Enabled? {
+            switch value {
+            case 0:
+                return Enabled.No
+            case 1:
+                return Enabled.Yes
+            default:
+                return nil
+            }
+        }
+        static func fromString(value:String) -> Enabled? {
+            switch value {
+            case "No":
+                return Enabled.No
+            case "Yes":
+                return Enabled.Yes
+            default:
+                return nil
+            }
+        }
+        static func stringValues() -> [String] {
+            return ["No", "Yes"]
+        }
+        var stringValue : String {
+        switch self {
+        case .No:
+            return "No"
+        case .Yes:
+            return "Yes"
+            }
+        }
+        func toRaw() -> UInt8 {
+            switch self {
+            case .No:
+                return 0
+            case .Yes:
+                return 1
+            }
+        }
+    }
 }
 
 class TISensorTagServiceProfiles {

        struct Data {
            static let uuid = "f000aa31-0451-4000-b000-000000000000"
            static let name = "Magnetometer Data"
        }
        struct Enabled {
            static let uuid = "f000aa32-0451-4000-b000-000000000000"

        struct Enabled {
            static let uuid = "F000AA12-0451-4000-B000-000000000000"
            static let name = "Accelerometer Enabled"
        }
        // Accelerometer Update Period
        struct UpdatePeriod {
            static let uuid = "F000AA13-0451-4000-B000-000000000000"
            static let name = "Accelerometer Update Period"
        }
    }
    
    //***************************************************************************************************
    // Magnetometer Service: units are uT
    //***************************************************************************************************
    struct MagnetometerService {
        static let uuid = "F000AA30-0451-4000-B000-000000000000"
