Hi Gerard,
> The string is
> "$GPGGA,070250.00,4159.08406,N,00301.18212,E,1,08,1.34,00048,M,050,M,,*62"
> (pointed by char *buffer)
> token = strtok_r(buffer,"*", &save_ptr);
> if(token == NULL) return S_ERR;
>
> //The following lines send the content using usart, so I can see the values
> usart_send(*token);
> usart_send(*(token+1));
>
> The values sent trough usart, are "$G". If I use save_ptr instead of token
> in the usart_send calls, the result is "62" (as it should be using
> token...). The * character is always replaced by 0, so it seems to work.
>
> Maybe I'm missing something?
Based on your description, it seems to be working perfectly.
If you're trying to break things up on the commas, then you need to
pass the comma in as a delimiter.
And the second and subsequent times, you'd pass in NULL instead of the buffer.
--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/