> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LampArrayCallback function reference

> Callback signature invoked when a LampArray peripheral is attached or detached; registered through RegisterLampArrayCallback in the GDK Lighting API.

# LampArrayCallback

Title defined callback for LampArray connected and disconnected events. This function is registered with [RegisterLampArrayCallback](/reference/lighting/lamparray/functions/registerlamparraycallback).

## Syntax

```cpp theme={null}
typedef void (CALLBACK * LampArrayCallback)(
    void * context,
    bool isAttached,
    ILampArray * lampArray);  
```

### Parameters

*context*   \_In\_opt\_\
Type: void\*

A pointer to an object containing relevant information for the callback. This pointer was passed to [RegisterLampArrayCallback](/reference/lighting/lamparray/functions/registerlamparraycallback).

*isAttached*\
Type: bool

Indicates whether the LampArray was attached to the system.

*lampArray*   \_In\_\
Type: ILampArray\*

Device which triggered the callback.

### Return value

Type: void

## Remarks

This function's definition is determined by the developer, but the parameters of that function must match in order for the callback to occur. This function is used to define the LampArray device callback registered with [RegisterLampArrayCallback](/reference/lighting/lamparray/functions/registerlamparraycallback). It will define the function that is called whenever a LampArray is attached or removed from the system.

## Requirements

**Header:** LampArray.h

**Library:** xgameplatform.lib

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

## See also

[Lighting API Overview](/build/core-features/common/lighting/gc-lighting-toc)\
[Lighting Basics](/build/core-features/common/lighting/lighting-basics)\
[RegisterLampArrayCallback](/reference/lighting/lamparray/functions/registerlamparraycallback)\
[UnregisterLampArrayCallback](/reference/lighting/lamparray/functions/unregisterlamparraycallback)


## Related topics

- [RegisterLampArrayCallback function reference](/reference/lighting/lamparray/functions/registerlamparraycallback.md)
- [UnregisterLampArrayCallback function reference](/reference/lighting/lamparray/functions/unregisterlamparraycallback.md)
- [LampArrayStatusCallback function reference](/reference/lighting/lamparray/functions/lamparraystatuscallback.md)
- [RegisterLampArrayStatusCallback function](/reference/lighting/lamparray/functions/registerlamparraystatuscallback.md)
- [LampArray API members reference](/reference/lighting/lamparray/lamparray_members.md)
