Build Output File Select

This commit is contained in:
2025-05-19 20:59:15 +02:00
parent aff454c277
commit 853fda9814
3 changed files with 41 additions and 4 deletions
+4
View File
@@ -34,6 +34,7 @@ type Proto struct {
ProtocolHeader ProtocolHeader `json:"protocol"`
ESP_TO_PC []ProtoMessage `json:"messages_esp_to_pc"`
PC_TO_ESP []ProtoMessage `json:"messages_pc_to_esp"`
FileName string `json:"filename,omitempty"`
}
func (h *HexByte) UnmarshalJSON(data []byte) error {
@@ -62,6 +63,7 @@ type PayloadStruct struct {
}
type CStyleData struct {
FileName string
CenumPCTOESP Cenum
CenumESPTOPC Cenum
PayloadStructs []PayloadStruct
@@ -105,6 +107,7 @@ func CreateCStyleHeader(proto *Proto) (string, error) {
}
var data = CStyleData{
FileName: proto.FileName,
CenumPCTOESP: Cenum{
EnumName: "PC_TO_ESP_MESSAGE_IDS",
Entries: proto.PC_TO_ESP,
@@ -148,6 +151,7 @@ func CreateCStyleSource(proto *Proto) (string, error) {
}
var data = CStyleData{
FileName: proto.FileName,
CenumPCTOESP: Cenum{
EnumName: "PC_TO_ESP_MESSAGE_IDS",
Entries: proto.PC_TO_ESP,