Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended Format ($TRCCR) Format Issue #16

Open
usman427 opened this issue Dec 18, 2014 · 4 comments
Open

Extended Format ($TRCCR) Format Issue #16

usman427 opened this issue Dec 18, 2014 · 4 comments

Comments

@usman427
Copy link

Hi Traccar, Why there is no extended protocol ($TRCCR) for iPhone app ?
I have implemented it but not working correctly, also it fetch the wrong longitude and latitude.
For example if the long and lat is 54.34234, 25.3434. but in my extended format it fetch 5434.234 and 2534.34.

Can you please tell me where I am doing mistake?

return [NSString stringWithFormat:@"$TRCCR,%02d%02d%02d%02d%02d%02d.000,A,%02d%07.4f,%03d%07.4f,%.2f,%.2f,%.2f,%03d,*00\r\n",
(int) components.year, (int) components.month, (int) components.day, (int) components.hour, (int) components.minute, (int) components.second,
(int) trunc(fabs(lat)), fmod(fabs(lat), 1.0) * 60.0,
(int) trunc(fabs(lon)), fmod(fabs(lon), 1.0) * 60.0,
(location.speed > 0) ? location.speed * 1.943844 : 0.0,
(location.course > 0) ? location.course : 0.0,
0.0,100]; //where 100 is for battery value

Can anyone tell me Is the string format is correct or not ?

@tananaev
Copy link
Member

You need to send latitude and longitude in degrees.

@usman427
Copy link
Author

Can you tell me how to do it ?
I have this string now
stringWithFormat:@"$TRCCR,%02d%02d%02d%02d%02d%02d.000,A,%02d%08.4f,%03d%08.4f,%.2f,%.2f,%.2f,%03d,*00\r\n",

can you tell me what will be the format for sending in degrees ?

@usman427
Copy link
Author

Thanks for the help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants