# Emergency Features

This guide explains the emergency features available in RadioLink-P25 and how to use them effectively.

## Emergency Feature Overview

The emergency feature in RadioLink-P25 simulates real P25 radio emergency functionality, providing a way to signal distress or urgent situations to other radio users.

Key emergency functions include:

* Sending an emergency alert to other users on the same channel
* Automatic retry of emergency signals if not acknowledged
* Priority for emergency transmissions
* Visual and audio alerts

## Activating an Emergency

### Radio Interface

To activate emergency mode using the radio interface:

1. Locate the emergency button on your radio (typically an orange button)
2. Press and hold the button
3. The radio will indicate emergency activation with visual and audio feedback

### Keyboard Shortcut

You can also activate emergency mode using the configured keyboard shortcut:

* Press the emergency key (F6 by default, as configured in Config.KeyBindings.Emergency)

## Emergency Behavior

When an emergency is activated:

1. The radio sends an emergency alert signal
2. Other users on the channel receive an alert notification
3. The radio will retry the emergency alert if not acknowledged (based on MaxRetries setting)
4. Emergency transmissions receive priority

## Emergency Configuration

The emergency functionality is configured in two places:

### 1. Config.lua Settings

```lua
Emergency = {
    MaxRetries = 5,                  -- Maximum retry attempts for emergency transmission
    RetryInterval = 3000,            -- Time between emergency retries (milliseconds)
    AcknowledgmentTimeout = 15000,   -- Timeout waiting for acknowledgment (milliseconds)
    AudioInterval = 5000,            -- Interval between emergency alert tones (milliseconds)
    ProtectionDelay = 750            -- Delay to prevent accidental activation (milliseconds)
}
```

These settings control:

* How many times the radio will retry emergency alerts if not acknowledged
* The timing between retries and alerts
* Safeguards to prevent accidental activation

### 2. Codeplug Channel Settings

In the codeplug file, each channel can have emergency capability enabled or disabled:

```json
{
    "id": 1,
    "name": "DISP MAIN",
    "rxFrequency": 851.0125,
    "txFrequency": 806.0125,
    "type": "digital",
    "mode": "trunked",
    "color": "#1A75FF",
    "talkgroup": 1001,
    "priority": 1,
    "emergency": true     // Emergency capability enabled
}
```

When `"emergency": true` is set, the channel can be used for emergency calls.

## Responding to an Emergency

When someone activates an emergency:

1. **Emergency Tone**
   * All users on the channel will hear an emergency tone
   * The tone repeats at intervals defined by AudioInterval setting
2. **Emergency Notification**
   * A notification appears with information about the emergency
   * The radio display shows emergency status
3. **Acknowledging**
   * Dispatchers or authorized users can acknowledge the emergency
   * Once acknowledged, the retry attempts stop

## Canceling an Emergency

To cancel an active emergency:

1. Press the emergency button again
2. Use the radio menu to navigate to the emergency cancellation option
3. The emergency will be canceled and normal operations will resume

## Emergency Feature in Codeplug

The emergency feature is enabled in the codeplug's features section:

```json
"radio": {
    "features": {
        "encryption": true,
        "gps": true,
        "emergency": true,  // Emergency feature enabled
        "scan": true,
        "privateCall": true,
        "textMessaging": true
    }
}
```

If `"emergency": false` is set in the codeplug features, the emergency functionality will be disabled for that radio.

## Best Practices for Emergency Use

1. **Training**: Ensure all users understand how to properly use the emergency feature
2. **Prevention**: Use the protection delay feature to prevent accidental activation
3. **Testing**: Regularly test emergency functionality in controlled environments
4. **Protocol**: Establish clear protocols for emergency responses
5. **Documentation**: Document all emergency activations and responses


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.everest-community.net/fivem-resources/fivem-resources/radiolink-p25/basic-usage/emergency.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
