29 lines
765 B
C
29 lines
765 B
C
//
|
|
// Created by cfif on 04.10.2022.
|
|
//
|
|
|
|
#include "ComIntCmd/Vars.h"
|
|
|
|
uint8_t XfcProtMethod_VarsTable(tXfcArray *request, tXfcArray *response, tVariablesTable *varsTab) {
|
|
|
|
XFC_CMD_TX_ADD_RAW(varsTab->count);
|
|
|
|
for (uint16_t count = 0; count < varsTab->count; ++count) {
|
|
|
|
XFC_CMD_TX_ADD_RAW(varsTab->items[count].name.length);
|
|
XFC_CMD_TX_ADD_ARR(varsTab->items[count].name.str,
|
|
varsTab->items[count].name.length);
|
|
|
|
// Описание переменной
|
|
uint8_t zero = 0;
|
|
XFC_CMD_TX_ADD_RAW(zero);
|
|
|
|
// Тип переменной
|
|
uint16_t type = varsTab->items[count].typeId;
|
|
XFC_CMD_TX_ADD_RAW(type);
|
|
|
|
}
|
|
|
|
return XFC_TRANSPORT_PROTOCOL_RESPONSE_RESULT_OK;
|
|
}
|