Mercurial > ublox > ublox8
changeset 96:a79efd17d4d6
capture: switch to UBX before issuing UBX commands
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Thu, 07 Sep 2023 20:08:50 -0400 |
parents | 2a518c6d77c6 |
children | 3dd7fcec17e5 |
files | capture.c |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/capture.c Thu Sep 07 20:07:59 2023 -0400 +++ b/capture.c Thu Sep 07 20:08:50 2023 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> + * Copyright (c) 2019-2021,2023 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -140,6 +140,12 @@ panic("unknown ubxport number"); } + /* disable NMEA, enable UBX */ + ret = send_ubx_with_ack(fd, UBX_CFG_PRT, prt, + sizeof(struct ubx_cfg_prt_uart)); + if (ret) + return ret; + /* request version info */ ret = send_ubx(fd, UBX_MON_VER, NULL, 0); if (ret) @@ -150,12 +156,6 @@ if (ret) return ret; - /* disable NMEA, enable UBX */ - ret = send_ubx_with_ack(fd, UBX_CFG_PRT, prt, - sizeof(struct ubx_cfg_prt_uart)); - if (ret) - return ret; - /* set dynamics mode */ ret = send_ubx_with_ack(fd, UBX_CFG_NAV5, &nav5, sizeof(struct ubx_cfg_nav5));