Neonode zForce(TM) SDK

Classes | Functions
Device.h File Reference

Base Device class. More...

`#include <PlatformDevice.h>`
`#include <SensorDevice.h>`
`#include <CoreDevice.h>`
`#include <AirDevice.h>`
`#include <PlusDevice.h>`
`#include <LightingDevice.h>`
Include dependency graph for Device.h:

Go to the source code of this file.

## Classes
struct | Device
| Device base class. More...

## Functions
DLLINTERNAL Device * | Device_GetInstance (Connection *connection, DeviceType deviceType, uint32_t deviceIndex)
| Internal call to get a new Device with the specified Type and Index. More...
DLLINTERNAL Device * | Device_New (Connection *connection, DeviceType deviceType, uint32_t deviceIndex, size_t size)
| Internal call used only by Device and subclasses to create a new base Device. More...

## Detailed Description

Base Device class.

Base Device class. A Device is used to make requests to the unit. Subclasses of this implement the actual functionality.

Copyright
  COPYRIGHT NOTICE: (c) 2017-2022 Neonode Technologies AB. All rights reserved.

## Function Documentation

## ◆ Device_GetInstance()

DLLINTERNAL Device* Device_GetInstance | ( | Connection * | connection,
|  | DeviceType | deviceType,
|  | uint32_t | deviceIndex
| ) |  |

Internal call to get a new Device with the specified Type and Index.

Internal call to get a new Device with the specified Type and Index.
On failure, errno is set.

- EOUTOFMEMORY - Out of memory.
- EBADCONNECTION - Bad Connection pointer.
- EUNKNOWNDEVICETYPE - Unknown device type. Make sure USE_XXX is defined.

Parameters

  connection | The Connection the Device is associated with.
  deviceType | Which DeviceType to create.
  deviceIndex | Which Device Index to set.

Returns
  A pointer to the new Device.

## ◆ Device_New()

DLLINTERNAL Device* Device_New | ( | Connection * | connection,
|  | DeviceType | deviceType,
|  | uint32_t | deviceIndex,
|  | size_t | size
| ) |  |

Internal call used only by Device and subclasses to create a new base Device.

Internal call used only by Device and subclasses to create a new base Device.
On failure, errno is set.

- EOUTOFMEMORY - Out of memory.
- EINVALIDSIZE - Invalid size.

Parameters

  connection | The Connection the Device is associated with.
  deviceType | Which DeviceType to create.
  deviceIndex | Which Device Index to set.
  size | If this is used as a base class for another class, set size to non-zero.

Returns
  A pointer to the new Device.