# HAL Integration Setup

This guide covers the three things your Manufacturer Service App needs before the Middleware App can bind to it. You need the correct package name, the required interfaces, and a service declaration that matches the binding Intent.

## Before you begin

Get `libhalservice.aar` from Getnet. It contains the AIDL interfaces you implement — see the [service interfaces reference](/en/pos-manufacturers/reference-pos-mfg/service-interfaces) for the full list before you start.

## Step 1: Name your service package

The Middleware App only binds to a service named `com.pagonxt.hal.platform.service`. Use this exact name for your Manufacturer Service App.

## Step 2: Implement the required interfaces

`libhalservice.aar` defines one interface per hardware area. Implement the ones your device supports:

| Interface | Covers |
| :--- | :--- |
| `IMainService` | The entry point. Exposes every other interface below. |
| `ICardService` | Chip, magnetic stripe, and NFC card reads. |
| `IMifareService` | Mifare card reads and sector/block operations. |
| `IPrinterService` | Receipt printing. |
| `IBeeperService` | Audible feedback. |
| `ILedService` | Status LEDs. |
| `ICameraService` | Device camera. |
| `IStatService` | Usage statistics, per app and device-wide. |
| `IInfoService` | Device identification (serial number, IMEI, model). |

`libhalservice.aar` also declares an `IInitService` import, alongside the interfaces above. Getnet's manufacturer kit does not document its methods yet — treat it as reserved until Getnet publishes its contract.

See the [service interfaces reference](/en/pos-manufacturers/reference-pos-mfg/service-interfaces) for every method signature, including the maintenance and encryption interfaces. It also documents the EMV interface used by the [EMV state machine](/en/pos-manufacturers/core-concept-pos-mfg/emv-state-machine).

## Step 3: Match the binding Intent

The Middleware App binds to your service with this Intent:

```kotlin
intent.action = "com.pagonxt.hal.platform.service"
intent.setPackage("com.pagonxt.hal.platform")
```

Declare your service's intent filter to match this action and package so the bind succeeds. Once bound, the Middleware App gets your `IMainService` implementation as:

```kotlin
mainService = com.pagonxt.hal.platform.service.IMainService.Stub.asInterface(binder)
```

Every call your service receives afterward — `mainService.getCard()`, `mainService.getPrinter()`, and so on — goes through this same connection.

## Verify the integration

Confirm your service is bindable and every implemented interface responds correctly before moving to the Devkit.

| Check | What to expect |
| :--- | :--- |
| Package name | Your service's manifest declares `com.pagonxt.hal.platform.service`. |
| Bind | The Middleware App's bind succeeds and returns a valid `IMainService` stub. |
| Interface coverage | Every interface your device supports (see Step 2) returns a working implementation, not `null`. |

## Next steps

* [Quick Start: run the Devkit](/en/pos-manufacturers/first-steps-pos-mfg/quick-start-devkit) — validate your implementation against Getnet's test tools.
* [HAL architecture](/en/pos-manufacturers/core-concept-pos-mfg/hal-architecture) — how this connection fits the rest of the platform.
* [Service interfaces reference](/en/pos-manufacturers/reference-pos-mfg/service-interfaces) — full method signatures for every interface.