![]() |
ParaLib 2.0.15-master SHA: 2e03d68caa
|
Parameter-Interface for connection with a PC. More...
#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "PARA_Lib.h"Functions | |
| int32_t | StreamReadParameterData_Value (Parameter_InfoHeader *info, uint8_t *destination, int32_t MaxCount, uint32_t offset, ParameterAccessSource Access, uint8_t AccessLevel) |
| Read Parameter-data into buffer (Variant 1) The Data of the selected parameter is read and stored into a given buffer address. More... | |
| __WEAK void | OnParameterWrite (Parameter_InfoHeader *info, uint8_t *source) |
| Hook which is called before parameter-value is changed. More... | |
| int32_t | StreamWriteParameterData_Value (Parameter_InfoHeader *info, uint8_t *source, uint32_t offset, ParameterAccessSource Access, uint8_t AccessLevel) |
| Write Parameter-data from buffer (Variant 1) The Data of the given buffer is written to parameter. More... | |
| int32_t | StreamReadParameterData_Value2 (Parameter *p, uint16_t subID, unsigned char *destination, int MaxCount, uint32_t offset, ParameterAccessSource Access, unsigned char AccessLevel) |
| Read Parameter-data into buffer (Variant 2) The Data of the selected parameter is read and stored into a given buffer address. More... | |
| int32_t | StreamWriteParameterData_Value2 (Parameter *p, uint16_t subID, unsigned char *source, uint32_t offset, ParameterAccessSource Access, unsigned char AccessLevel, uint16_t count) |
| Write Parameter-data from buffer (Variant 2) The Data of the given buffer is written to parameter. More... | |
| int32_t | StreamWriteStringParameter (Parameter *p, uint16_t StartSubID, uint16_t count, unsigned char *destination, uint32_t *MaxCount, ParameterAccessSource Access, unsigned char AccessLevel) |
| Read String Parameter-data into buffer (Variant 1) The Data of the selected string-parameter is read and stored into a given buffer address. More... | |
| int32_t | StreamWriteStringParameter2 (Parameter *p, uint16_t StartSubID, uint16_t count, unsigned char *destination, uint32_t *MaxSize, ParameterAccessSource Access, unsigned char AccessLevel, unsigned int *StrPos) |
| Read String Parameter-data into buffer (Variant 2) The Data of the selected string-parameter is read and stored into a given buffer address. More... | |
Variables | |
| uint16_t | g_ui16FlashModified |
| Flag to show if the remanent storage is modified. More... | |
Parameter-Interface for connection with a PC.
Stream Access to Parameter Values.
© Copyright 2017-2022 Copyright: Retostronik GmbH Stütingstraße 30 58285 Gevelsberg
| __WEAK void OnParameterWrite | ( | Parameter_InfoHeader * | info, |
| uint8_t * | source | ||
| ) |
Hook which is called before parameter-value is changed.
This Function is a weak empty function, which can be used to run a hook before the patameter value is changed. It can be used to log every parameter change into a logfile. It is called before the data change is performed, in this function the old parameter-value can be accessed. The new value is given in the parameter source -> new and old value can be written ot the logfile if neccessary.
| info | Parameter_InfoHeader which contains Parameter-id and Sub-id of the processed parameter. |
| source | Data to write into the parameter. |
| int32_t StreamReadParameterData_Value | ( | Parameter_InfoHeader * | info, |
| uint8_t * | destination, | ||
| int32_t | MaxCount, | ||
| uint32_t | offset, | ||
| ParameterAccessSource | Access, | ||
| uint8_t | AccessLevel | ||
| ) |
Read Parameter-data into buffer (Variant 1) The Data of the selected parameter is read and stored into a given buffer address.
The buffer must be in device memory. The size of the buffer must be at least MaxCount bytes. The data-size can be limited and an offset (start) can be set. with these parameters it is possible to split the data into several smaller buffer portions to transmit data with an interface with smaller pacjet size than parameter-data size. If access is not permitted, data size 0 is returned. In this variant the Parameter-id and sub-id is given, the parameter is searched in memory with these vaules.
| info | Parameter_InfoHeader which contains Parameter-id and Sub-id of the processed parameter. |
| destination | Buffer to store the data. |
| MaxCount | Buffer size of the output buffer / maximum stpored data size into output buffer. |
| offset | Start position of the data. |
| Access | Source of access (see Access restrictions). |
| AccessLevel | Actual AccessLevel (see Access restrictions). |
| int32_t StreamReadParameterData_Value2 | ( | Parameter * | p, |
| uint16_t | subID, | ||
| unsigned char * | destination, | ||
| int | MaxCount, | ||
| uint32_t | offset, | ||
| ParameterAccessSource | Access, | ||
| unsigned char | AccessLevel | ||
| ) |
Read Parameter-data into buffer (Variant 2) The Data of the selected parameter is read and stored into a given buffer address.
The buffer must be in device memory. The size of the buffer must be at least MaxCount bytes. The data-size can be limited and an offset (start) can be set. with these parameters it is possible to split the data into several smaller buffer portions to transmit data with an interface with smaller pacjet size than parameter-data size. If access is not permitted, data size 0 is returned. In this variant a pointer to the Parameter is given, the parameter has not to be searched in memory withparameter-id and therefore it is faster than variant 1.
| p | Pointer to the Parameter. |
| subID | Sub-ID to be read. |
| destination | Buffer to store the data. |
| MaxCount | Buffer size of the output buffer / maximum stored data size into output buffer. |
| offset | Start position of the data. |
| Access | Source of access (see Access restrictions). |
| AccessLevel | Actual AccessLevel (see Access restrictions). |
| int32_t StreamWriteParameterData_Value | ( | Parameter_InfoHeader * | info, |
| uint8_t * | source, | ||
| uint32_t | offset, | ||
| ParameterAccessSource | Access, | ||
| uint8_t | AccessLevel | ||
| ) |
Write Parameter-data from buffer (Variant 1) The Data of the given buffer is written to parameter.
The buffer must be in device memory. The buffer may not contain the complete parameter data, even portions are possible. Due to this, the start offset and the data size can be given with parameters. If access is not permitted, data size 0 is returned. In this variant the Parameter-id and sub-id is given, the parameter is searched in memory with these vaules.
| info | Parameter_InfoHeader which contains Parameter-id and Sub-id of the processed parameter. |
| source | Buffer containing the parameter data to be written |
| offset | Start position of the data. |
| Access | Source of access (see Access restrictions). |
| AccessLevel | Actual AccessLevel (see Access restrictions). |
| int32_t StreamWriteParameterData_Value2 | ( | Parameter * | p, |
| uint16_t | subID, | ||
| unsigned char * | source, | ||
| uint32_t | offset, | ||
| ParameterAccessSource | Access, | ||
| unsigned char | AccessLevel, | ||
| uint16_t | count | ||
| ) |
Write Parameter-data from buffer (Variant 2) The Data of the given buffer is written to parameter.
The buffer must be in device memory. The buffer may not contain the complete parameter data, even portions are possible. Due to this, the start offset and the data size can be given with parameters. If access is not permitted, data size 0 is returned. In this variant a pointer to the Parameter is given, the parameter has not to be searched in memory withparameter-id and therefore it is faster than variant 1.
| p | Pointer to the Parameter. |
| subID | Sub-ID to be write. |
| source | Buffer containing the parameter data to be written. |
| offset | Start position of the data. |
| Access | Source of access (see Access restrictions). |
| AccessLevel | Actual AccessLevel (see Access restrictions). |
| count | Number of SubIDs to process |
| int32_t StreamWriteStringParameter | ( | Parameter * | p, |
| uint16_t | StartSubID, | ||
| uint16_t | count, | ||
| unsigned char * | destination, | ||
| uint32_t * | MaxCount, | ||
| ParameterAccessSource | Access, | ||
| unsigned char | AccessLevel | ||
| ) |
Read String Parameter-data into buffer (Variant 1) The Data of the selected string-parameter is read and stored into a given buffer address.
In this function not only one sub-id is read, but the complete data of all sub-ids. The data of one sub-id is not cut -> the length of the buffer mist be larger of every sub-id length. If the next sub-id datalength is larger, than remaining buffer size, the functions returns. It is mainly used by an ethernet-interface, bacause one ethernet-frame can be store normally much more data that one sub-id and therefore it is more efficient to process all sub-ids at once. The buffer must be in device memory. The size of the buffer must be at least MaxCount bytes. The data-size can be limited and an offset (start) can be set. with these parameters it is possible to split the data into several smaller buffer portions to transmit data with an interface with smaller packet size than parameter-data size. If access is not permitted, data size 0 is returned.
| p | Pointer to the Parameter. |
| StartSubID | Sub-ID to start the data read. |
| count | Number of sub-ids to process. |
| destination | Buffer to store the data. |
| MaxCount | Pointer to the Buffer size of the output buffer / maximum stpored data size into output buffer. After processing this function the pointer haleds the data size of the destination-buffer which is used. |
| Access | Source of access (see Access restrictions). |
| AccessLevel | Actual AccessLevel (see Access restrictions). |
| int32_t StreamWriteStringParameter2 | ( | Parameter * | p, |
| uint16_t | StartSubID, | ||
| uint16_t | count, | ||
| unsigned char * | destination, | ||
| uint32_t * | MaxSize, | ||
| ParameterAccessSource | Access, | ||
| unsigned char | AccessLevel, | ||
| unsigned int * | StrPos | ||
| ) |
Read String Parameter-data into buffer (Variant 2) The Data of the selected string-parameter is read and stored into a given buffer address.
In this function not only one sub-id is read, but the complete data of all sub-ids. The data of one sub-id is cut, if the buffer-size is not large enough to held the complete data of the actual sub-id, the matching part is copied to the buffer. The string position is returned in the parameter StrPos. This Variant should be used, if strings are large, even larger than buffer size. It is mainly used by an ethernet-interface, bacause one ethernet-frame can be store normally much more data that one sub-id and therefore it is more efficient to process all sub-ids at once. The buffer must be in device memory. The size of the buffer must be at least MaxCount bytes. The data-size can be limited and an offset (start) can be set. with these parameters it is possible to split the data into several smaller buffer portions to transmit data with an interface with smaller packet size than parameter-data size. If access is not permitted, data size 0 is returned.
| p | Pointer to the Parameter. |
| StartSubID | Sub-ID to start the data read. |
| count | Number of sub-ids to process. |
| destination | Buffer to store the data. |
| MaxSize | Pointer to the Buffer size of the output buffer / maximum stpored data size into output buffer. After processing this function the pointer haleds the data size of the destination-buffer which is used. |
| Access | Source of access (see Access restrictions). |
| AccessLevel | Actual AccessLevel (see Access restrictions). |
| StrPos | Position of the last Sub-ID which does not match completely into buffer. |
| uint16_t g_ui16FlashModified |
Flag to show if the remanent storage is modified.
On each modification of the stored value, this flag is set. It is displayed in parameter-editor on PC. The flag is resetted on a "save to NV" operation.