Neonode zForce(TM) SDK

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

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
| Brief 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.

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

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

## Function Documentation

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

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 - Uknown 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.

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.

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.