This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong.
xxxxxxxxxx
====== SDK Script gps2serial-GNSStoGPS.are ======
<code c gps2serial-gnsstogps.are>
/* DESC: This script sends the local GPS NMEA stream to the serial interface.
* DESC: It checks for the correct CR/LF end of line characters and convert messages $GN to $GP
* Copyright (C) 2013-2021) NetModule AG, Switzerland
*/
/* Options to configure by user*/
SER_SPEED = (int) argv[2]; /* Serial Baud Rate 4800, 9600, 19200, 38400, 57600, 115200 */
SER_DATABIT = 8; /* number of data bits (5, 6, 7, 8) */
SER_STOPBIT = 1; /* number of stop bits (1, 2) */
SER_PARITY = 0; /* parity (0=no parity, 1=odd parity, 2=even parity) */
SER_FLOW = 0; /* flow control (0=none, 1=xon/xoff, 2=hardware) */
DEV = "SERIAL1"; /* name of the Serial Interface */
โ
/* default values */
local_ip = "127.0.0.1";
local_port = (int) nb_config_get("gpsd.0.port");
gpsd = -1;
// start serial connection
int start_serial() {
if (nb_config_get("serial.0.status") != "2") {
nb_syslog("serial not assinged to SDK\n");
exit(2);
}
// printf("set serial attributes\n");
if ((rc = nb_serial_setattr(DEV, SER_SPEED, SER_DATABIT, SER_STOPBIT, SER_PARITY, SER_FLOW)) != 0) {