nRF5 SDK v15.0.0
Experimental: Location and Navigation Application
This example requires one of the following SoftDevices: S132, S140

Important: Before you run this example, make sure to program the SoftDevice.

The Location and Navigation Service (LNS) Application is an example that implements the Location and Navigation Profile.

The application includes the three services in Location and Navigation Profile:

When the application starts, the Board Support Package is initialized. Timers are started to control the generation of various parts of the Location and Navigation Profile. Each time-out handler updates a simulation of sensor values. This includes updating

Note
This application is not power optimized!
The application will stop advertising after 3 minutes and go to system-off mode. Push Button 1 to restart advertising.

Setup

You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\ble_peripheral\experimental\ble_app_lns

Button assignments: BSP BLE Button Assignments

Testing

Test the Location and Navigation Application with nRF Connect by performing the following steps:

  1. Connect the board to the computer using a USB cable. The board is assigned a COM port, which is visible in the Device Manager.
  2. Start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
    • Baud rate: 115.200
    • 8 data bits
    • 1 stop bit
    • No parity
    • HW flow control: None
  3. Compile and program the application. Observe that the BSP_INDICATE_ADVERTISING state is indicated and that the device is advertising with the device name "Nordic_LNS".
  4. Observe that the text "APP:INFO:Fast advertising" is printed on the COM listener running on the computer.
  5. Connect to the device from nRF Connect. Observe that the BSP_INDICATE_CONNECTED state is indicated.
  6. Observe that the services are shown in the connected device.
  7. Observe:
    • Primary service 0x1819 is the Location and Navigation Service.
      • Characteristic 0x2A6A is the feature characteristic UUID.
      • Characteristic 0x2A69 is the position quality characteristic UUID.
      • Characteristic 0x2A67 is the location and speed characteristic UUID.
      • Characteristic 0x2A68 is the navigation characteristic UUID.
      • Characteristic 0x2A6B is the control point characteristic UUID.
    • Primary service 0x180F is the Battery Service.
    • Primary service 0x180A is the Device Information Service.
  8. Enable the services by clicking the 'Play' button.
  9. Observe that the text "Location/Speed: Notification enabled", "Control Point: Indication enabled", and "Navigation: Notification enabled" is printed on the COM listener running on the computer.
  10. In nRF Connect, observe that notifications are received from the location and speed characteristic. The control point is configured for indication. The navigation characteristic is configured for notification, but does not yet send notifications.
  11. Write '03 01' to the LNS Control Point characteristic (0x2A6B). This command corresponds to "navigation control" - "start". Verify that "NAV_EVT: Navigation state changed to 1" is printed on the COM listener.
  12. In nRF Connect, observe that the navigation characteristic sends notifications.
  13. Write '03 00' to the LNS Control Point characteristic (0x2A6B). This command represents "navigation control" - "stop". Verify that "NAV_EVT: Navigation state changed to 0" is printed on the COM listener.
  14. In nRF Connect, observe that the navigation characteristic stops sending notifications.
  15. Disconnect the device in nRF Connect. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
  16. If no peer connects to the application within 180 seconds (APP_ADV_TIMEOUT_IN_SECONDS), the application will put the chip into system-off mode.

Documentation feedback | Developer Zone | Subscribe | Updated