Hi Guys! I am new to C Programming and I currently tasked to write a function that can "decode" the following quad site protocol received. However I am stuck as to how to continue with the function. Here is the protocol.

rs 1,1,1,10

rs 10,1,1,10

rs 1,1,1,10

rs 1,1,1,1

rs 10,1,10,7

rs 1,1,7,10

rs 1,1,10,1

rs 10,1,10,10

rs 1,10,10,1

rs 1,10,7,1

rs 1,1,1,5

rs 1,1,1,1

rs 1,1,1,1

rs 1,1,1,7

rs 1,1,1,5

rs 1,1,1,1

rs 1,10,1,1

rs 1,1,1,1

rs 1,1,1,5

rs 1,1,1,1

rs 1,1,1,5

rs 6,1,7,1

rs 6,1,1,1

rs 1,1,1,1

rs 1,7,1,1

rs 6,1,1,1

rs 1,1,1,5

rs 1,1,1,1

rs 1,1,10,5

rs 1,10,1,10

rs 1,10,1,10

rs 10,10,1,10

rs 1,10,1,10

rs 1,1,1,1

rs 1,1,10,5

rs 1,1,1,10

Currently my function can only support receiving dual site protocols. Like the following:

rs 1,,,1

rs 10,,,1

rs 1,,,10

rs 1,,,1

rs 1,,,1

rs 1,,,7

rs 1,,,1

rs 1,,,7

Attached is my c code. I have tried using case to handle the extra quad site protocols but it seems like it is unable to support. I complie my code using SDCC. Attached are my original code for the dual site and code for the quad site. I would appreciate if someone could help me out on this. Thanks alot!