I am writing C# code to program geo-fences on a GPS tracker (Sinowell G102). The geo-fences are rectangular. I basically have to take the top-left corner coordinate, and bottom-right corner coordinate, and program it into the tracker. Now, the tracker expects these coordinates in BCD format (Binary-Coded Decimal). Each coordinate being 4 bytes long. Now, I figured how to convert a positive latitude or longitude coordinate into BCD - according to the tracker's protocol manual, a coordinate such as:
22° 33.995′ (i.e. 22 degrees North, 33.995 minutes East)
becomes the four bytes 02 23 39 95
Which is pretty straight forward. My problem, however, is that I don't know how to tackle the negative coordinates of the Southern Hemisphere (such as -25° 33.995′, as we have here in South Africa)
I managed to get in touch with the manufacturers of this tracker, but unfortunately it's a Chinese firm, and their English is not very good. They did however send me the following image:
Unfortunately, I don't fully understand this code. I would greatly appreciate any help.... Thank you.