Skip to content

File ns_rpc_generic_data.h

FileList > includes-api > ns_rpc_generic_data.h

Go to the source code of this file

API for using generic data RPC interface. More...

  • #include "GenericDataOperations_EvbToPc.h"
  • #include "GenericDataOperations_PcToEvb.h"
  • #include "erpc_server_setup.h"
  • #include "ns_core.h"

Classes

Type Name
struct ns_rpc_config_t
RPC Configuration Struct.

Public Types

Type Name
typedef status(* ns_rpc_data_computeOnEVB_cb
typedef status(* ns_rpc_data_fetchBlockFromEVB_cb
typedef status(* ns_rpc_data_sendBlockToEVB_cb
enum rpcGenericDataMode_e

Public Attributes

Type Name
const ns_core_api_t ns_rpc_gdo_V0_0_1
const ns_core_api_t ns_rpc_gdo_V1_0_0
const ns_core_api_t ns_rpc_gdo_current_version
const ns_core_api_t ns_rpc_gdo_oldest_supported_version

Public Functions

Type Name
void ns_rpc_data_clientDoneWithBlockFromPC (const dataBlock * block)
Helper function to be called after processing the block from ns_rpc_data_fetchBlockFromPC or result block from ns_rpc_data_computeOnPC. This will free() the description and buffer.data block struct members, so only do it after you're done with those!
uint16_t ns_rpc_genericDataOperationsClient_reset (ns_rpc_config_t * cfg)
void ns_rpc_genericDataOperations_disableServerPoll (ns_rpc_config_t * cfg)
Disable RPC server and stop receiving RPC calls.
void ns_rpc_genericDataOperations_enableServerPoll (ns_rpc_config_t * cfg)
Enable RPC server and prepare to receive RPC calls.
uint16_t ns_rpc_genericDataOperations_init (ns_rpc_config_t * cfg)
Initialize the GenericDataOperations RPC system.
void ns_rpc_genericDataOperations_pollServer (ns_rpc_config_t * cfg)
Polls the server for incoming RPC calls. Must be called to handle incoming RPC calls (for example, when a USB or timer event occurs)
void ns_rpc_genericDataOperations_printDatablock (const dataBlock * block)
Helper function for printing a block's contents.

Macros

Type Name
define NS_RPC_GDO_API_ID 0xCA0100
define NS_RPC_GDO_CURRENT_VERSION NS_RPC_GDO_V1_0_0
define NS_RPC_GDO_OLDEST_SUPPORTED_VERSION NS_RPC_GDO_V0_0_1
define NS_RPC_GDO_V0_0_1 { .major = 0, .minor = 0, .revision = 1 }
define NS_RPC_GDO_V1_0_0 { .major = 1, .minor = 0, .revision = 0 }
define NS_RPC_MALLOC_SIZE_IN_K 8

Detailed Description

Author:

Carlos Morales

Version:

0.1

Date:

2022-08-26

Copyright:

Copyright (c) 2022

Public Types Documentation

typedef ns_rpc_data_computeOnEVB_cb

typedef status(* ns_rpc_data_computeOnEVB_cb) (const dataBlock *in_block, dataBlock *result_block);

typedef ns_rpc_data_fetchBlockFromEVB_cb

typedef status(* ns_rpc_data_fetchBlockFromEVB_cb) (dataBlock *block);

typedef ns_rpc_data_sendBlockToEVB_cb

typedef status(* ns_rpc_data_sendBlockToEVB_cb) (const dataBlock *block);

enum rpcGenericDataMode_e

enum rpcGenericDataMode_e {
    NS_RPC_GENERICDATA_CLIENT,
    NS_RPC_GENERICDATA_SERVER
};

Public Attributes Documentation

variable ns_rpc_gdo_V0_0_1

const ns_core_api_t ns_rpc_gdo_V0_0_1;

variable ns_rpc_gdo_V1_0_0

const ns_core_api_t ns_rpc_gdo_V1_0_0;

variable ns_rpc_gdo_current_version

const ns_core_api_t ns_rpc_gdo_current_version;

variable ns_rpc_gdo_oldest_supported_version

const ns_core_api_t ns_rpc_gdo_oldest_supported_version;

Public Functions Documentation

function ns_rpc_data_clientDoneWithBlockFromPC

Helper function to be called after processing the block from ns_rpc_data_fetchBlockFromPC or result block from ns_rpc_data_computeOnPC. This will free() the description and buffer.data block struct members, so only do it after you're done with those!

void ns_rpc_data_clientDoneWithBlockFromPC (
    const dataBlock * block
) 

Parameters:

  • block Block to be freed

function ns_rpc_genericDataOperationsClient_reset

uint16_t ns_rpc_genericDataOperationsClient_reset (
    ns_rpc_config_t * cfg
) 

function ns_rpc_genericDataOperations_disableServerPoll

Disable RPC server and stop receiving RPC calls.

void ns_rpc_genericDataOperations_disableServerPoll (
    ns_rpc_config_t * cfg
) 

Parameters:

  • cfg

function ns_rpc_genericDataOperations_enableServerPoll

Enable RPC server and prepare to receive RPC calls.

void ns_rpc_genericDataOperations_enableServerPoll (
    ns_rpc_config_t * cfg
) 

Parameters:

  • cfg

function ns_rpc_genericDataOperations_init

Initialize the GenericDataOperations RPC system.

uint16_t ns_rpc_genericDataOperations_init (
    ns_rpc_config_t * cfg
) 

Parameters:

  • cfg

Returns:

uint16_t Status

function ns_rpc_genericDataOperations_pollServer

Polls the server for incoming RPC calls. Must be called to handle incoming RPC calls (for example, when a USB or timer event occurs)

void ns_rpc_genericDataOperations_pollServer (
    ns_rpc_config_t * cfg
) 

Parameters:

  • cfg

function ns_rpc_genericDataOperations_printDatablock

Helper function for printing a block's contents.

void ns_rpc_genericDataOperations_printDatablock (
    const dataBlock * block
) 

Parameters:

  • block to be printed

Macro Definition Documentation

define NS_RPC_GDO_API_ID

#define NS_RPC_GDO_API_ID 0xCA0100

define NS_RPC_GDO_CURRENT_VERSION

#define NS_RPC_GDO_CURRENT_VERSION NS_RPC_GDO_V1_0_0

define NS_RPC_GDO_OLDEST_SUPPORTED_VERSION

#define NS_RPC_GDO_OLDEST_SUPPORTED_VERSION NS_RPC_GDO_V0_0_1

define NS_RPC_GDO_V0_0_1

#define NS_RPC_GDO_V0_0_1 { .major = 0, .minor = 0, .revision = 1 }

define NS_RPC_GDO_V1_0_0

#define NS_RPC_GDO_V1_0_0 { .major = 1, .minor = 0, .revision = 0 }

define NS_RPC_MALLOC_SIZE_IN_K

#define NS_RPC_MALLOC_SIZE_IN_K 8

The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-rpc/includes-api/ns_rpc_generic_data.h