예제 #1
0
// CPUTemp return cpu temp.
func (r *Raspberry) CPUTemp(data string) []byte {
	cpuTemp := cpu.Clean(cmd.Exec("vcgencmd", "measure_temp"), "temp=", "'C")
	if cpuTemp == "" {
		return nil
	}
	return ctrl.GetMessage("RPI1_CPU_TEMP", cpuTemp)
}
예제 #2
0
// CPUCoreVolt return core volt.
func (r *Raspberry) CPUCoreVolt(data string) []byte {

	cpuCoreVolt := cpu.Clean(cmd.Exec("vcgencmd", "measure_volts", "core"), "volt=", "V")
	if cpuCoreVolt == "" {
		return nil
	}
	return ctrl.GetMessage("RPI1_CPU_CORE_VOLT", cpuCoreVolt)
}
예제 #3
0
// CPUMemory return cpu memory.
func (r *Raspberry) CPUMemory(data string) []byte {

	cpuMem := cpu.Clean(cmd.Exec("vcgencmd", "get_mem", "arm"), "arm=", "M")
	if cpuMem == "" {
		return nil
	}
	return ctrl.GetMessage("RPI1_CPU_MEM", cpuMem)
}