XYOracleNetwork/sdk-xyo-client-swift

View on GitHub
Sources/XyoClient/XyoWitness/SystemInfo/SystemInfoNetworkCellularPayloadStruct.swift

Summary

Maintainability
A
0 mins
Test Coverage
import Foundation
import CoreTelephony

struct XyoSystemInfoNetworkCellularPayloadStruct: Encodable {
    var ip: String?
    var provider = XyoSystemInfoCellularProviderPayloadStruct()
    var radio: String?
    init(_ wifiInfo: WifiInformation?) {
        #if os(iOS)
        let networkInfo = CTTelephonyNetworkInfo()
        radio = networkInfo.serviceCurrentRadioAccessTechnology?.first?.value
        #endif
        ip = wifiInfo?.pathMonitor?.ip
    }
}