public convenience init(ip: String, port: String , using: NWParameters)
ip (String): endpoint of machine where CoreTempServer is running.
port (String): the port number where CoreTempServer is publishing the data.
using (NWParameters): enumerated that defines the protocol to read data.
Entities
All data info has been strcutured in following objects
//
import Foundation
struct CpuInfo: Codable {
var uiLoad: [Int]?
var uiTjMax: [Int]?
var uiCoreCnt: Int?
var uiCPUCnt: Int?
var fTemp: [Int]?
var fVID: Float?
var fCPUSpeed: Float?
var fFSBSpeed: Float?
var fMultiplier: Int?
var CPUName: String?
var ucFahrenheit: Int?
var ucDeltaToTjMax: Int?
var ucTdpSupported: Int?
var ucPowerSupported: Int?
var uiStructVersion: Int?
var uiTdp: [Int]?
var fPower: [Float]?
var fMultipliers: [Int]?
}
struct MemoryInfo: Codable {
var TotalPhys: Int64?
var FreePhys: Int64?
var TotalPage: Int64?
var FreePage: Int64?
var TotalVirtual: Int64?
var FreeVirtual: Int64?
var FreeExtendedVirtual: Int?
var MemoryLoad: Int?
}
public struct CoreTempObject: Codable {
var CpuInfo: CpuInfo?
var MemoryInfo: MemoryInfo?
}
CoreTempMonitorSwift
Installation
CoreTemp + CoreTempRemoteServer Addon
Firstly, install CoreTemp and CoreTempRemoteServer addon for start to receive data by net socket from following URLs: CoreTemp main program: https://www.alcpu.com/CoreTemp/Core-Temp-setup.exe RemoteServer Addon: https://www.alcpu.com/CoreTemp/AddOns/CoreTempRemoteServer.zip
Configure port number of RemoteServer and start it.
Swift size
Add the Swift Package to your project from url: https://github.com/CodeNationDev/CoreTempMonitorSwift.git
Definition & Interface
Entities
All data info has been strcutured in following objects
The most relevant info for this objects is:
Use each one for design your monitor.
Usage example
Initialize
Object instance runs the socket read. If you want to stop the reading call stop() function directly.
Meta
David Martin Saiz – @deividmarshall – davms81@gmail.com
Distributed under the MIT license. See
LICENSE
for more information.https://github.com/CodeNationDev/
Version History