aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/heptagon_radio_transmitter/radiotrans_types.c
blob: cc62575d03a8420c111f82e6d79ff5d0d51277eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* --- Generated the 13/5/2019 at 10:21 --- */
/* --- heptagon compiler, version 1.05.00 (compiled mon. may. 13 10:18:8 CET 2019) --- */
/* --- Command line: /local/STATOR/packages/opam-root/4.07.1/bin/heptc -target c -hepts -s main -target ctrln radiotrans.ept --- */

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "radiotrans_types.h"

Radiotrans__st_3 Radiotrans__st_3_of_string(char* s) {
  if ((strcmp(s, "St_3_Tx")==0)) {
    return Radiotrans__St_3_Tx;
  };
  if ((strcmp(s, "St_3_Sleep")==0)) {
    return Radiotrans__St_3_Sleep;
  };
  if ((strcmp(s, "St_3_Rx_Packet")==0)) {
    return Radiotrans__St_3_Rx_Packet;
  };
  if ((strcmp(s, "St_3_Rx")==0)) {
    return Radiotrans__St_3_Rx;
  };
  if ((strcmp(s, "St_3_Idle")==0)) {
    return Radiotrans__St_3_Idle;
  };
  if ((strcmp(s, "St_3_Calibrate")==0)) {
    return Radiotrans__St_3_Calibrate;
  };
}

char* string_of_Radiotrans__st_3(Radiotrans__st_3 x, char* buf) {
  switch (x) {
    case Radiotrans__St_3_Tx:
      strcpy(buf, "St_3_Tx");
      break;
    case Radiotrans__St_3_Sleep:
      strcpy(buf, "St_3_Sleep");
      break;
    case Radiotrans__St_3_Rx_Packet:
      strcpy(buf, "St_3_Rx_Packet");
      break;
    case Radiotrans__St_3_Rx:
      strcpy(buf, "St_3_Rx");
      break;
    case Radiotrans__St_3_Idle:
      strcpy(buf, "St_3_Idle");
      break;
    case Radiotrans__St_3_Calibrate:
      strcpy(buf, "St_3_Calibrate");
      break;
    default:
      break;
  };
  return buf;
}

Radiotrans__st_2 Radiotrans__st_2_of_string(char* s) {
  if ((strcmp(s, "St_2_On")==0)) {
    return Radiotrans__St_2_On;
  };
  if ((strcmp(s, "St_2_Off")==0)) {
    return Radiotrans__St_2_Off;
  };
}

char* string_of_Radiotrans__st_2(Radiotrans__st_2 x, char* buf) {
  switch (x) {
    case Radiotrans__St_2_On:
      strcpy(buf, "St_2_On");
      break;
    case Radiotrans__St_2_Off:
      strcpy(buf, "St_2_Off");
      break;
    default:
      break;
  };
  return buf;
}

Radiotrans__st_1 Radiotrans__st_1_of_string(char* s) {
  if ((strcmp(s, "St_1_On")==0)) {
    return Radiotrans__St_1_On;
  };
  if ((strcmp(s, "St_1_Off")==0)) {
    return Radiotrans__St_1_Off;
  };
}

char* string_of_Radiotrans__st_1(Radiotrans__st_1 x, char* buf) {
  switch (x) {
    case Radiotrans__St_1_On:
      strcpy(buf, "St_1_On");
      break;
    case Radiotrans__St_1_Off:
      strcpy(buf, "St_1_Off");
      break;
    default:
      break;
  };
  return buf;
}

Radiotrans__st Radiotrans__st_of_string(char* s) {
  if ((strcmp(s, "St_Tx")==0)) {
    return Radiotrans__St_Tx;
  };
  if ((strcmp(s, "St_Sleep")==0)) {
    return Radiotrans__St_Sleep;
  };
  if ((strcmp(s, "St_Rx_Packet")==0)) {
    return Radiotrans__St_Rx_Packet;
  };
  if ((strcmp(s, "St_Rx")==0)) {
    return Radiotrans__St_Rx;
  };
  if ((strcmp(s, "St_Idle")==0)) {
    return Radiotrans__St_Idle;
  };
  if ((strcmp(s, "St_Calibrate")==0)) {
    return Radiotrans__St_Calibrate;
  };
}

char* string_of_Radiotrans__st(Radiotrans__st x, char* buf) {
  switch (x) {
    case Radiotrans__St_Tx:
      strcpy(buf, "St_Tx");
      break;
    case Radiotrans__St_Sleep:
      strcpy(buf, "St_Sleep");
      break;
    case Radiotrans__St_Rx_Packet:
      strcpy(buf, "St_Rx_Packet");
      break;
    case Radiotrans__St_Rx:
      strcpy(buf, "St_Rx");
      break;
    case Radiotrans__St_Idle:
      strcpy(buf, "St_Idle");
      break;
    case Radiotrans__St_Calibrate:
      strcpy(buf, "St_Calibrate");
      break;
    default:
      break;
  };
  return buf;
}