Engage Engine API  1.246.9086
Loading...
Searching...
No Matches
EngageNetworkDevice.h File Reference

Custom Network Devices. More...

Go to the source code of this file.

Macros

#define ENGAGE_API   __attribute__ ((visibility ("default")))
 

Typedefs

typedef int(* PFN_ENGAGE_NETWORK_DEVICE_CTL) (int16_t deviceId, EngageNetworkDeviceCtlOp_t op, const char *jsonMetaData, uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4, uintptr_t p5)
 Network Device Control instance control pointer.
 

Enumerations

enum  EngageNetworkDeviceCtlOp_t { enetStart , enetStop , enetSend , enetRecv }
 Network Device Control Operation enum. More...
 

Functions

ENGAGE_API int16_t engageNetworkDeviceRegister (const char *jsonConfiguration, PFN_ENGAGE_NETWORK_DEVICE_CTL pfnCtl)
 [SYNC] Registers a network device with the Engine
 
ENGAGE_API int16_t engageNetworkDeviceUnregister (int16_t deviceId)
 [SYNC] Unregisters a network device
 

Variables

static const int ENGAGE_NETWORK_DEVICE_RESULT_OK = 0
 Everything is fine.
 
static const int ENGAGE_NETWORK_DEVICE_GENERAL_ERROR = -1
 A general error occurred.
 
static const int ENGAGE_NETWORK_DEVICE_INVALID_CONFIGURATION = -2
 Unable to register device due to invalid configuration.
 
static const int ENGAGE_NETWORK_DEVICE_INVALID_DEVICE_ID = -3
 Invalid deviceId.
 
static const int ENGAGE_NETWORK_DEVICE_INVALID_INSTANCE_ID = -4
 Invalid instanceId.
 
static const int ENGAGE_NETWORK_DEVICE_INVALID_COMBINED_DEVICE_ID_AND_INSTANCE_ID = -5
 Invalid deviceId and instanceId.
 
static const int ENGAGE_NETWORK_DEVICE_INVALID_OPERATION = -6
 An invalid operation has been attempted.
 

Detailed Description

Custom Network Devices.

Definition in file EngageNetworkDevice.h.

Macro Definition Documentation

◆ ENGAGE_API

#define ENGAGE_API   __attribute__ ((visibility ("default")))

Definition at line 28 of file EngageNetworkDevice.h.

Typedef Documentation

◆ PFN_ENGAGE_NETWORK_DEVICE_CTL

typedef int(* PFN_ENGAGE_NETWORK_DEVICE_CTL) (int16_t deviceId, EngageNetworkDeviceCtlOp_t op, const char *jsonMetaData, uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4, uintptr_t p5)

Network Device Control instance control pointer.

Parameters
deviceIdThe device identifier
opThe operation to carry out
jsonMetaDataJSON metadata associated with the operation
p1Variable type based on op
p2Variable type based on op
p3Variable type based on op
p4Variable type based on op
p5Variable type based on op

When:


op | jsonMetadata | p1 | p2 | p3 | p4 | p5 |


enetStart | ? | | | | | | enetStop | ? | | | | | | enetSend | ? | buff | buffSz | timeoutMs | | | enetRecv | ? | buff | maxBuffSz | timeoutMs | | |


Definition at line 123 of file EngageNetworkDevice.h.

Enumeration Type Documentation

◆ EngageNetworkDeviceCtlOp_t

Network Device Control Operation enum.

More detailed enum description.

Enumerator
enetStart 

Start operation.

enetStop 

Stop operation.

enetSend 

Send a buffer.

enetRecv 

Read a buffer.

Definition at line 36 of file EngageNetworkDevice.h.

Function Documentation

◆ engageNetworkDeviceRegister()

ENGAGE_API int16_t engageNetworkDeviceRegister ( const char * jsonConfiguration,
PFN_ENGAGE_NETWORK_DEVICE_CTL pfnCtl )

[SYNC] Registers a network device with the Engine

The jsonConfiguration JSON configuration object contains the configuration for the network device and the pfnCtl is a pointer to a control structure used to manage the device's instance.

Parameters
jsonConfigurationpointer to JSON Network Device configuration object ConfigurationObjects::NetworkDeviceDescriptor
pfnCtlpointer to an Network Device Control instance
See also
PFN_ENGAGE_NETWORK_DEVICE_CTL
Returns
ENGAGE_NETWORK_DEVICE_RESULT_OK if successful

◆ engageNetworkDeviceUnregister()

ENGAGE_API int16_t engageNetworkDeviceUnregister ( int16_t deviceId)

[SYNC] Unregisters a network device

Unregisters the network device created by engageNetworkDeviceRegister

Parameters
deviceIddevice identifier returned engageNetworkDeviceRegister
Returns
ENGAGE_NETWORK_DEVICE_RESULT_OK

Variable Documentation

◆ ENGAGE_NETWORK_DEVICE_GENERAL_ERROR

const int ENGAGE_NETWORK_DEVICE_GENERAL_ERROR = -1
static

A general error occurred.

This could be due to a number of reasons. See debug output logs for more information.

Definition at line 62 of file EngageNetworkDevice.h.

◆ ENGAGE_NETWORK_DEVICE_INVALID_COMBINED_DEVICE_ID_AND_INSTANCE_ID

const int ENGAGE_NETWORK_DEVICE_INVALID_COMBINED_DEVICE_ID_AND_INSTANCE_ID = -5
static

Invalid deviceId and instanceId.

Both deviceId and instanceId used are no longer valid. See debug output logs for more information.

Definition at line 90 of file EngageNetworkDevice.h.

◆ ENGAGE_NETWORK_DEVICE_INVALID_CONFIGURATION

const int ENGAGE_NETWORK_DEVICE_INVALID_CONFIGURATION = -2
static

Unable to register device due to invalid configuration.

This could be due to a number of reasons. See debug output logs for more information.

Definition at line 69 of file EngageNetworkDevice.h.

◆ ENGAGE_NETWORK_DEVICE_INVALID_DEVICE_ID

const int ENGAGE_NETWORK_DEVICE_INVALID_DEVICE_ID = -3
static

Invalid deviceId.

The deviceId used is no longer valid. See debug output logs for more information.

Definition at line 76 of file EngageNetworkDevice.h.

◆ ENGAGE_NETWORK_DEVICE_INVALID_INSTANCE_ID

const int ENGAGE_NETWORK_DEVICE_INVALID_INSTANCE_ID = -4
static

Invalid instanceId.

The instanceId used is no longer valid. See debug output logs for more information.

Definition at line 83 of file EngageNetworkDevice.h.

◆ ENGAGE_NETWORK_DEVICE_INVALID_OPERATION

const int ENGAGE_NETWORK_DEVICE_INVALID_OPERATION = -6
static

An invalid operation has been attempted.

An invalid operation was attempted, please make sure you use a valid operation from EngageNetworkDeviceCtlOp_t enum and that the device is in the correct state. See debug output logs for more information.

Definition at line 97 of file EngageNetworkDevice.h.

◆ ENGAGE_NETWORK_DEVICE_RESULT_OK

const int ENGAGE_NETWORK_DEVICE_RESULT_OK = 0
static

Everything is fine.

The operation executed without any errors.

Definition at line 55 of file EngageNetworkDevice.h.