hi all,
the latest master fw-nrfconnect-nrf.
asset_tracker project gps_controller.
asset_tracker project gps_controller.
now ,i try add gps_control module to my project.
but it now work correct that gps_controller to callback gps_trigger_handler()
how to do it ?
but it now work correct that gps_controller to callback gps_trigger_handler()
how to do it ?
HW:nrf9160-DK 0.8.5
SDK:latest master fw-nrfconnect-nrf.
SDK:latest master fw-nrfconnect-nrf.
prj :
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#
# General config
CONFIG_NRF9160_GPS=y
CONFIG_NRF9160_GPS_LOG_LEVEL_DBG=y
CONFIG_GPS_USE_EXTERNAL=y
CONFIG_GPS_DEV_NAME="NRF9160_GPS"
CONFIG_GPS_CONTROL=y
CONFIG_GPS_CONTROL_FIRST_FIX_CHECK_DELAY=10
CONFIG_GPS_CONTROL_FIX_CHECK_INTERVAL=30
CONFIG_GPS_CONTROL_FIX_TRY_TIME=90
CONFIG_GPS_CONTROL_PSM_DISABLE_ON_STOP=n
# Network
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y
# BSD library
CONFIG_BSD_LIBRARY=y
Kconfig:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# Copyright (c) 2018 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#
menu "GPS"
choice
prompt "GPS device"
default GPS_USE_SIM
help
Select from which device GPS data will be fetched.
config GPS_USE_SIM
bool "Use GPS simulator"
select GPS_SIM
select GPS_SIM_TRIGGER
help
Use simulated GPS data.
config GPS_USE_EXTERNAL
bool "User provided GPS device"
help
Provide a GPS device that location data will be fetched from and
main:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* Copyright (c) 2018 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
*/
#include <zephyr.h>
#include <misc/printk.h>
#include <gps.h>
#include "gps_controller.h"
static struct k_delayed_work long_press_button_work;
static atomic_val_t send_data_enable;
static void gps_trigger_handler(struct device *dev, struct gps_trigger *trigger)
{
static u32_t fix_count;
ARG_UNUSED(trigger);
printk("get GPS count%d\n",fix_count);
if (++fix_count < CONFIG_GPS_CONTROL_FIX_COUNT) {
return;
}