|
@@ -169,7 +169,8 @@ public class Nexilis: NSObject {
|
|
|
// }
|
|
|
Nexilis.ADDRESS = address.components(separatedBy: ":")[0]
|
|
|
Nexilis.PORT = Int(address.components(separatedBy: ":")[1]) ?? 0
|
|
|
- // //print("IP PORT \(Nexilis.ADDRESS) <> \(Nexilis.PORT)")
|
|
|
+// print("sGetVersion \(API.sGetVersion())")
|
|
|
+// print("IP PORT \(Nexilis.ADDRESS) <> \(Nexilis.PORT)")
|
|
|
var id = Utils.getConnectionID()
|
|
|
// if let device_id = UserDefaults.standard.string(forKey: "device_id") {
|
|
|
// try API.initConnection(bSwitchIP: false, sAPIK: apiKey, aAppMain: nil, cbiI: Callback(), sTCPAddr: Nexilis.ADDRESS, nTCPPort: Nexilis.PORT, sUserID: device_id, sStartWH: "09:00")
|
|
@@ -181,7 +182,8 @@ public class Nexilis: NSObject {
|
|
|
// id = uuid
|
|
|
// }
|
|
|
if id.isEmpty {
|
|
|
- id = UIDevice.current.identifierForVendor?.uuidString ?? "UNK-DEVICE"
|
|
|
+ let sDID = UIDevice.current.identifierForVendor?.uuidString ?? "UNK-DEVICE"
|
|
|
+ id = String(sDID[sDID.index(sDID.endIndex, offsetBy: -5)...])
|
|
|
Utils.setConnectionID(value: id)
|
|
|
}
|
|
|
try API.initConnection(bSwitchIP: false, sAPIK: apiKey, aAppMain: nil, cbiI: Callback(), sTCPAddr: Nexilis.ADDRESS, nTCPPort: Nexilis.PORT, sUserID: id, sStartWH: "09:00")
|