rsmp-nordic / rsmp_sxl_traffic_lights

RSMP Signal Exchange List (SXL) for Traffic Controllers
MIT License
12 stars 4 forks source link

skip trailing zeroes in digit strings #89

Closed emiltin closed 3 years ago

emiltin commented 4 years ago

Some status messages values use a string of digits, e.g. S0003. Here's an example from a Swarco TLC, with "s" containing a lot of zeroes:

2020-04-07 13:02:41 UTC  KK+AG9998     -->  3a86  Received StatusUpdate {"mType":"rSMsg","type":"StatusUpdate","mId":"3a86ced2-6ad3-46a9-9ffe-ef4463540fde","ntsOId":"KK+AG9998=001TC000","xNId":"","cId":"KK+AG9998=001TC000","sTs":"2020-04-07T13:02:41.000Z","sS":[{"sCI":"S0003","n":"inputstatus","s":"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","q":"recent"}]}

If the number of digits is not significant, e.g. you already know what number of detector logics are present, this could be shortened by leaving out trailing zeros (or whatever is the most comment state).

emiltin commented 3 years ago

not reaally need to optimize this at the moment