> For the complete documentation index, see [llms.txt](https://portal-integracao.intelbras.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portal-integracao.intelbras.com.br/linha-android/peripheral/alarmmanager.md).

# AlarmManager

Interface Principal de CallBack: `AlarmManager2`

Path: `com.lamy.peripheral.sdk.asi.AlarmManager2`

```java
// Construction method, single example

public static AlarmManager2 getInstance()

/**
* Alarm-in
*
* @param alarm type 1=External alarm 1 2=External alarm 2 3=Both 2-ch
simultaneously 0=Cancel alarm
* @return 0 means success, means failure, means Error Code
*/
public int writeAlarm(int alarm)

/**
* Add alarm listening
*
* @param listener listening added
* @return boolean whether added successfully
*/
public synchronized boolean addListener(OnAlarmListener2 listener)

/**
* Remove alarm listening
*
* @param listener removed listening
* @return boolean whether removed successfully
*/
public synchronized boolean removeListener(OnAlarmListener2 listener)

/**
* @Description: New device alarm monitoring callback, extended to 64 bit
*/
public interface OnAlarmListener2 {
long DEFAULT_VALUE = 1l;
/**
* Tampering Alarm
*/
long REMOVE_ALARM = DEFAULT_VALUE << 1;
/**
* Alarm when Door Closes
*/
long OUTDOOR_ALARM = DEFAULT_VALUE << 3;
/**
* Magnetic door alarm
*/
long MAG_DOOR_ALARM = DEFAULT_VALUE << 4;
/**
* External alarm 1
*/
long EXT_ALARM_1 = DEFAULT_VALUE << 8;
/**
* External alarm 2 or door opening alarm
*/
long EXT_ALARM_2 = DEFAULT_VALUE << 9;
/**
* External alarm 3
*/
long EXT_ALARM_3 = DEFAULT_VALUE << 34;
/**
* External alarm 4
*/
long EXT_ALARM_4 = DEFAULT_VALUE << 35;
/**
* External alarm 5
*/
long EXT_ALARM_5 = DEFAULT_VALUE << 36;
/**
* External alarm 6
*/
long EXT_ALARM_6 = DEFAULT_VALUE << 37;
/**
* External alarm 7
*/
long EXT_ALARM_7 = DEFAULT_VALUE << 38;
/**
* External alarm 8
*/
long EXT_ALARM_8 = DEFAULT_VALUE << 39;
/**
* External alarm 9
*/
long EXT_ALARM_9 = DEFAULT_VALUE << 40;
/**
* External alarm 10
*/
long EXT_ALARM_10 = DEFAULT_VALUE << 41;
/**
* External alarm 11
*/
long EXT_ALARM_11 = DEFAULT_VALUE << 42;
/**
* External alarm 12
*/
long EXT_ALARM_12 = DEFAULT_VALUE << 43;
/**
* External alarm 13
*/
long EXT_ALARM_13 = DEFAULT_VALUE << 44;
/**
* External alarm 14
*/
long EXT_ALARM_14 = DEFAULT_VALUE << 45;
/**
* @param alarm Alarm input
* Note: Bitwise operation (&) is required to determine whether an alarm
exists.
*/
void onAlarm(long alarm);
}
```

Interface Principal de AlarmeManager \[discarded]： `AlarmManager` (Deprecated ⚠️)

Path： `com.lamy.peripheral.sdk.asi.AlarmManager`

```java

// Construction method, single example
@Deprecated
public static AlarmManager getInstance()

/**
* Alarm-in
*
* @param alarm type 1=External alarm 1 2=External alarm 2 3=Both 2-ch
simultaneously 0=Cancel alarm
* @return 0 means success, means failure, means Error Code
*/
public int writeAlarm(int alarm)

/**
* Add alarm listening
*
* @param listener listening added
* @return boolean whether added successfully
*/
public synchronized boolean addListener(OnAlarmListener listener)

/**
* Remove alarm listening
*
* @param listener removed listening
* @return boolean whether removed successfully
*/
public synchronized boolean removeListener(OnAlarmListener listener)

@Deprecated
public interface OnAlarmListener {
/**
* Tampering Alarm
*/
int REMOVE_ALARM = 1 << 1;
/**
* Alarm when Door Closes
*/
int OUTDOOR_ALARM = 1 << 3;
/**
* Magnetic door alarm
*/
int MAG_DOOR_ALARM = 1 << 4;
/**
* External alarm 1
*/
int EXT_ALARM_1 = 1 << 8;
/**
* External alarm 2 or door opening alarm
*/
int EXT_ALARM_2 = 1 << 9;
/**
* @param alarm Alarm info
* Note: Bitwise operation (&) is required to determine whether an alarm
exists.
*/
void onAlarm(int alarm);

}

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://portal-integracao.intelbras.com.br/linha-android/peripheral/alarmmanager.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
