Logo
UNICENS V2.1.0-3491
User Manual and API Reference
Programming

Introduction

The Programming API allows to program the ConfigString and/or the IdentString of a single node in the system.

Initialization

The Programming API has no initialization parameters.

Operation

Start

The Programming service assumes that the target node has received a Hello.Get command. Programming is started by calling Ucs_Prog_Start(). It requires the following parameters:

self

Reference to the UNICENS instance (Ucs_Inst_t).

node_id

The node position address of the the node to be programmed.

signature

Signature of the the node to be programmed as it was reported by Hello.Status during the Node Discovery (Ucs_Signature_t).

session_type

Defines the set of MemIDs (see command_list) (Ucs_Prg_SessionType_t).

command_list

Array of programming tasks of type Ucs_Prg_Command_t. Currently each entry corresponds to one ExtendedNetworkControl.MemoryWrite command. The array ends with an entry whose data_length is 0 or data is NULL .

mem_id

Represents the memory resource to be written.

address

Defines the memory location at which the writing operation starts.

unit_length

Sets the number of memory units to be written. Memory units can be unsigned bytes, unsigned words or unsigned masked data depending on the memory type.

data_length

Total length of data.

data
Contains the actual data written to the memory resource and formatted as memory units.

result_fptr

Callback providing the result of the Programming task (Ucs_Prg_ReportCb_t).

Result

When the Programming service finishes, it provides its result via the result_fptr callback function.

code

Result values of the Programming service (Ucs_Prg_ResCode_t).

function

Describes the function where an error occurred (Ucs_Prg_Func_t).

ret_len

Length of the following error parameter field parm. It is 0 if no error occurred.

parm

Pointer to the parameters of a potential error message. The meaning of these parameters can be derived from function and the respective EXC functions.

user_ptr

User reference as provided in Ucs_InitData_t::user_ptr