/* USER CODE BEGIN 2 */
GNSS_Init(&GNSS_Handle, &huart1);
HAL_Delay(1000);
GNSS_LoadConfig(&GNSS_Handle);
uint32_t Timer = HAL_GetTick();
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1) {
if ((HAL_GetTick() - Timer) > 1000) {
GNSS_GetUniqID(&GNSS_Handle);
GNSS_ParseBuffer(&GNSS_Handle);
HAL_Delay(250);
GNSS_GetPVTData(&GNSS_Handle);
GNSS_ParseBuffer(&GNSS_Handle);
HAL_Delay(250);
GNSS_SetMode(&GNSS_Handle,Automotiv);
HAL_Delay(250);
printf("Day: %d-%d-%d \r\n", GNSS_Handle.day, GNSS_Handle.month,GNSS_Handle.year);
printf("Time: %d:%d:%d \r\n", GNSS_Handle.hour, GNSS_Handle.min,GNSS_Handle.sec);
printf("Status of fix: %d \r\n", GNSS_Handle.fixType);
printf("Latitude: %f \r\n", GNSS_Handle.fLat);
printf("Longitude: %f \r\n",(float) GNSS_Handle.lon / 10000000.0);
printf("Height above ellipsoid: %d \r\n", GNSS_Handle.height);
printf("Height above mean sea level: %d \r\n", GNSS_Handle.hMSL);
printf("Ground Speed (2-D): %d \r\n", GNSS_Handle.gSpeed);
printf("Unique ID: %04X %04X %04X %04X %04X \n\r",
GNSS_Handle.uniqueID[0], GNSS_Handle.uniqueID[1],
GNSS_Handle.uniqueID[2], GNSS_Handle.uniqueID[3],
GNSS_Handle.uniqueID[4], GNSS_Handle.uniqueID[5]);
Timer = HAL_GetTick();
}
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
//Setting input and output only for UBX standard
static uint8_t configUBX[]={0xB5,0x62,0x06,0x00,0x14,0x00,0x01,0x00,0x00,0x00,0xD0,0x08,0x00,0x00,0x80,0x25,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x9A,0x79};
//Changing the NMEA version to 4.10
static uint8_t setNMEA410[]={0xB5,0x62,0x06,0x17,0x14,0x00,0x00,0x41,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x75,0x57};
//Activation of navigation system: Galileo, Glonass, GPS, SBAS, IMES
static uint8_t setGNSS[]={0xB5,0x62,0x06,0x3E,0x24,0x00,0x00,0x00,0x20,0x04,0x00,0x08,0x10,0x00,0x01,0x00,0x01,0x01,0x01,0x01,0x03,0x00,0x01,0x00,0x01,0x01,0x02,0x04,0x08,0x00,0x01,0x00,0x01,0x01,0x06,0x08,0x0E,0x00,0x01,0x00,0x01,0x01,0xDF,0xFB};