package main

import (
	"cicv-data-closedloop/kinglong_msgs"
	"fmt"
)

func Topic() string {
	return "/nodefault_info"
}

func Label() string {
	return "controlfault"
}

func Rule(data *kinglong_msgs.FaultInfo) string {
	if string(Hex(int(data.ErrorCode))[2]) == "3" {
		return "controlfault"
	}
	return ""
}

func Hex(num int) string {
	return fmt.Sprintf("0x%x", num)
}
