Skip to content

Commit 75e16f9

Browse files
authored
Merge pull request #26 from DocSystem/dev
Update Opus bus list + show unknown lines in hex
2 parents db9ff3c + fe74eba commit 75e16f9

File tree

2 files changed

+92
-8
lines changed

2 files changed

+92
-8
lines changed

api/calypso/transit/opus.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ const char* get_opus_transport_line(int route_number) {
4141
if(OPUS_LINES_LIST[route_number]) {
4242
return OPUS_LINES_LIST[route_number];
4343
} else {
44-
char* line = malloc(4 * sizeof(char));
45-
if(!line) {
44+
// Return hex
45+
char* route_str = malloc(9 * sizeof(char));
46+
if(!route_str) {
4647
return "Unknown";
4748
}
48-
snprintf(line, 4, "%d", route_number);
49-
return line;
49+
snprintf(route_str, 9, "0x%02X", route_number);
50+
return route_str;
5051
}
5152
}
5253

api/calypso/transit/opus_lists.h

+87-4
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,93 @@
230230
#define OPUS_LISTS_H
231231

232232
static const char* OPUS_LINES_LIST[512] = {
233-
[1] = "Green",
234-
[2] = "Orange",
235-
[3] = "Yellow",
236-
[4] = "Blue",
233+
[1] = "Green", [2] = "Orange", [3] = "Yellow", [4] = "Blue",
234+
235+
[13] = "18",
236+
237+
[15] = "24", [16] = "25", [231] = "26", [17] = "27", [18] = "28",
238+
239+
[22] = "32", [23] = "33", [24] = "34",
240+
241+
[26] = "37",
242+
243+
[226] = "41", [29] = "43", [30] = "44", [31] = "45",
244+
245+
[33] = "47", [34] = "48", [35] = "49", [36] = "51",
246+
247+
[40] = "55",
248+
249+
[44] = "61",
250+
251+
[46] = "64",
252+
253+
[48] = "67", [49] = "68", [50] = "69", [51] = "70",
254+
255+
[59] = "80", [60] = "85", [61] = "86", [63] = "90",
256+
257+
[65] = "93",
258+
259+
[68] = "97",
260+
261+
[73] = "103", [74] = "104", [75] = "105",
262+
263+
[77] = "107",
264+
265+
[79] = "109", [80] = "110", [81] = "112", [82] = "113",
266+
267+
[87] = "121", [89] = "124", [90] = "125",
268+
269+
[92] = "128", [93] = "129", [94] = "131",
270+
271+
[234] = "136", [97] = "138", [98] = "139", [99] = "140", [100] = "141",
272+
273+
[103] = "146",
274+
275+
[108] = "161", [109] = "162", [110] = "164", [111] = "165",
276+
277+
[113] = "168",
278+
279+
[116] = "171",
280+
281+
[120] = "177", [121] = "179",
282+
283+
[126] = "185",
284+
285+
[128] = "187",
286+
287+
[130] = "189",
288+
289+
[132] = "191", [134] = "192/193",
290+
291+
[136] = "195",
292+
293+
[138] = "197",
294+
295+
[141] = "201",
296+
297+
[145] = "205",
298+
299+
[147] = "207", [148] = "208", [149] = "209",
300+
301+
[151] = "211",
302+
303+
[155] = "216", [156] = "217",
304+
305+
[237] = "401", [261] = "405",
306+
307+
[165] = "410",
308+
309+
[242] = "419",
310+
311+
[218] = "427",
312+
313+
[211] = "467",
314+
315+
[169] = "470",
316+
317+
[253] = "487",
318+
319+
[255] = "495", [256] = "496", [257] = "715",
237320

238321
[219] = "747",
239322
};

0 commit comments

Comments
 (0)