This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Device change for GNSS only: remove device from global list when no p…
…oweroff (#147) The following code should be valid to recover from a situation in which the GNSS device is disconnected/connected or powered up. while((uret = uDeviceOpen(&gDeviceCfg, &device_handle)) != U_ERROR_COMMON_SUCCESS) { uPortTaskBlock(5000); } The current implementation fails with U_ERROR_COMMON_INVALID_PARAMETER with no recovery option, this loop is infinite connecting GNSS will have no affect. The reason is that the static function removeDevice() is called with powerOff=false and this results in not removing the device from the global device list. When the device is opened again it is already found within the list by pGetGnssInstanceTransportHandle(), which is called by uGnssAdd(); uGnssAdd() then returns U_ERROR_COMMON_INVALID_PARAMETER. The software should release any resources attached to a device regardless of poweron/poweroff, the resources are logical and may be created when required. This commit removes the device from the list in the case that poweroff was not requested. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
- Loading branch information