# fuchsia.hardware.gnss

<br />

Protocols and types related to GNSS locations.
Added: HEAD

## **PROTOCOLS**

## Device

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=34)*

Device protocol used to connect to a GPS device.

The GNSS (Global Navigation Satellite System) interface provides access to
location data obtained from GNSS receivers.

<br />

### Disable

Disable GNSS device and reset to initial status.
Clears any cached fix available
Calling this while the GNSS device is already enabled is a no-op.

## Errors

Returns `INTERNAL_ERROR` in case of any driver issue.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_Disable_Result` |

### Enable

Enable GNSS device and reset to initial status.
Calling this while the GNSS device is already enabled is a no-op.

## Errors

Returns MODEM_OFFLINE if modem is offline.
Returns INTERNAL_ERROR in case of any other driver issue.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_Enable_Result` |

### GetCapabilities

Get the device's supported capabilities.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_GetCapabilities_Result` |

### GetLastFix

Return location obtained in the most recent successful session.

## Errors

Returns `GNSS_DISABLED` if GNSS is disabled.
Returns `NO_FIX_AVAILABLE` if no fix is available.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_GetLastFix_Result` |

### GetSingleShotFix

Get a single shot time-limited position fix with a
specified accuracy.

## Errors

Returns `GNSS_DISABLED` if GNSS is disabled.
Returns `MISSING_PARAMETERS` if all required fix parameters
are not provided in the request.
Returns `ACTIVE_SESSION_ONGOING` if an active session is ongoing.
Returns `NOT_SUPPORTED` if this feature is not supported.
Returns `INTERNAL_ERROR` in case of any other driver issue.

#### Request

| Name | Type |
|---|---|
| `params` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#FixParams` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_GetSingleShotFix_Result` |

### StartTimeBasedLocationTracking

Start a location tracking session.

## Errors

Returns `GNSS_DISABLED` if GNSS is disabled.
Returns `MISSING_PARAMETERS` if all required fix parameters
are not provided in the request.
Returns `ACTIVE_SESSION_ONGOING` if an active session is ongoing.
Returns `NOT_SUPPORTED` if this feature is not supported.
Returns `INTERNAL_ERROR` in case of any other driver issue.

#### Request

| Name | Type |
|---|---|
| `params` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#FixParams` |
| `interval_msec` | `uint32` |
| `listener` | `server_end:https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#LocationListener` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_StartTimeBasedLocationTracking_Result` |

## LocationListener

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=12)*

Listener for location updates.

<br />

### GetNextLocation

Hanging-get to obtain next location in the tracking session.

This call blocks until a new location is is available.

## Errors

Returns `GNSS_DISABLED` if GNSS is disabled.
Returns `TIMEOUT` if time out occurred before obtaining an initial
location of desired accuracy.
Returns `INTERNAL_ERROR` in case of any unspecified issue.
Returns `BAD_STATE` when there is a pending GetNextLocation call.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#LocationListener_GetNextLocation_Result` |

## **STRUCTS**

### Device_Disable_Response

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=51)*

\<EMPTY\>

### Device_Enable_Response

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=42)*

\<EMPTY\>

### Device_GetCapabilities_Response

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=103)*

| Field | Type | Description | Default |
|---|---|---|---|
| `capabilities` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#Capabilities` | Capability bit mask. | No default |

### Device_GetLastFix_Response

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=97)*

| Field | Type | Description | Default |
|---|---|---|---|
| `location` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#Location` | GNSS location. | No default |

### Device_GetSingleShotFix_Response

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=67)*

| Field | Type | Description | Default |
|---|---|---|---|
| `location` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#Location` | GNSS location. | No default |

### Device_StartTimeBasedLocationTracking_Response

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=89)*

\<EMPTY\>

### LocationListener_GetNextLocation_Response

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=23)*

| Field | Type | Description | Default |
|---|---|---|---|
| `location` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#Location` |   | No default |

## **UNIONS**

### Device_Disable_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=51)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_Disable_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_Enable_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=42)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_Enable_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_GetCapabilities_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=103)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_GetCapabilities_Response` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_GetLastFix_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=97)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_GetLastFix_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_GetSingleShotFix_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=67)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_GetSingleShotFix_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Device_StartTimeBasedLocationTracking_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=89)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#Device_StartTimeBasedLocationTracking_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### LocationListener_GetNextLocation_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=23)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.hardware.gnss#LocationListener_GetNextLocation_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.location.gnss.types//https://fuchsia.dev/reference/fuchsia.location.gnss.types#Error` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

## **SERVICES**

### Service

*Defined in [fuchsia.hardware.gnss/gnss_device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=109)*

| Name | Type | Transport |
|---|---|---|
| [device](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.gnss/gnss_device.fidl;l=110) | `fuchsia.hardware.gnss/Device` | Channel |

<br />