Skip to content

Commit ba35e68

Browse files
fixup! defining interface settings in a struct
1 parent eef2674 commit ba35e68

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

src/settings/settings.h

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ namespace models {
4444

4545
typedef CellularSetting GSMSetting;
4646
typedef CellularSetting NBSetting;
47-
typedef CellularSetting CATM1Setting;
47+
48+
struct CATM1Setting {
49+
char pin[8];
50+
char apn[101]; // Max length of apn is 100 + \0
51+
char login[32];
52+
char pass[32];
53+
int rat; // FIXME verify this type is correct
54+
uint32_t band;
55+
};
4856

4957
struct LoraSetting {
5058
char appeui[17]; // appeui is 8 octets * 2 (hex format) + \0
@@ -54,12 +62,33 @@ namespace models {
5462
struct NetworkSetting {
5563
NetworkAdapter type;
5664
union {
65+
#if defined(BOARD_HAS_WIFI)
5766
WiFiSetting wifi;
58-
CATM1Setting catM1;
59-
GSMSetting gsm;
60-
NBSetting nb;
67+
#endif
68+
69+
#if defined(BOARD_HAS_ETHERNET)
6170
EthernetSetting eth;
71+
#endif
72+
73+
#if defined(BOARD_HAS_NB)
74+
NBSetting nb;
75+
#endif
76+
77+
#if defined(BOARD_HAS_GSM)
78+
GSMSetting gsm;
79+
#endif
80+
81+
#if defined(BOARD_HAS_CATM1_NBIOT)
82+
CATM1Setting catm1;
83+
#endif
84+
85+
#if defined(BOARD_HAS_CELLULAR)
86+
CellularSetting cell;
87+
#endif
88+
89+
#if defined(BOARD_HAS_LORA)
6290
LoraSetting lora;
91+
#endif
6392
};
6493
};
6594
}

0 commit comments

Comments
 (0)