| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021 | 
							- /*
 
-  * private_mib_bt6709.c
 
-  *
 
-  *  Created on: 03.10.2018
 
-  *      Author: balbekova
 
-  */
 
- #if defined HARDWARE_BT6709
 
- #include "stm32f4xx.h"
 
- #include "private_mib.h"
 
- #include "parameters.h"
 
- #include "settings_api.h"
 
- #include "log.h"
 
- #include "megatec.h"
 
- #include "control_symbol.h"
 
- #include "sntp_api.h"
 
- #include "web_params_api.h"
 
- #include "hal.h"
 
- #include "FreeRTOS.h"
 
- #include "task.h"
 
- #include <ctype.h>
 
- #ifdef PRINTF_STDLIB
 
- #include <stdio.h>
 
- #endif
 
- #ifdef PRINTF_CUSTOM
 
- #include "tinystdio.h"
 
- #endif
 
- #include "lwip/apps/snmp_scalar.h"
 
- #include "lwip/apps/snmp.h"
 
- //#include "snmp_core.h"
 
- #define MUL100          100
 
- #define MUL10           10
 
- extern struct snmp_mib mib2;
 
- /**
 
-   * @brief  Общая структура настроек
 
-   */
 
- extern SETTINGS_t sSettings;
 
- static s16_t signal_get_value(struct snmp_node_instance *instance, void *value);
 
- static snmp_err_t signal_set_value(struct snmp_node_instance *instance, u16_t len, void *value);
 
- static snmp_err_t signal_set_test(struct snmp_node_instance *instance, u16_t len, void *value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.49  */
 
- static const struct snmp_scalar_node signal49 = SNMP_SCALAR_CREATE_NODE_READONLY(49, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.48  */
 
- static const struct snmp_scalar_node signal48 = SNMP_SCALAR_CREATE_NODE(48, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.47  */
 
- static const struct snmp_scalar_node signal47 = SNMP_SCALAR_CREATE_NODE_READONLY(47, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.46  */
 
- static const struct snmp_scalar_node signal46 = SNMP_SCALAR_CREATE_NODE_READONLY(46, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.45  */
 
- static const struct snmp_scalar_node signal45 = SNMP_SCALAR_CREATE_NODE_READONLY(45, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.44  */
 
- static const struct snmp_scalar_node signal44 = SNMP_SCALAR_CREATE_NODE_READONLY(44, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.43  */
 
- static const struct snmp_scalar_node signal43 = SNMP_SCALAR_CREATE_NODE(43, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.42  */
 
- static const struct snmp_scalar_node signal42 = SNMP_SCALAR_CREATE_NODE(42, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.41  */
 
- static const struct snmp_scalar_node signal41 = SNMP_SCALAR_CREATE_NODE(41, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.40  */
 
- static const struct snmp_scalar_node signal40 = SNMP_SCALAR_CREATE_NODE(40, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.39  */
 
- static const struct snmp_scalar_node signal39 = SNMP_SCALAR_CREATE_NODE(39, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.38  */
 
- static const struct snmp_scalar_node signal38 = SNMP_SCALAR_CREATE_NODE(38, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.37  */
 
- static const struct snmp_scalar_node signal37 = SNMP_SCALAR_CREATE_NODE(37, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.36  */
 
- static const struct snmp_scalar_node signal36 = SNMP_SCALAR_CREATE_NODE(36, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.35  */
 
- static const struct snmp_scalar_node signal35 = SNMP_SCALAR_CREATE_NODE(35, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.34  */
 
- static const struct snmp_scalar_node signal34 = SNMP_SCALAR_CREATE_NODE(34, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.33  */
 
- static const struct snmp_scalar_node signal33 = SNMP_SCALAR_CREATE_NODE(33, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.32  */
 
- static const struct snmp_scalar_node signal32 = SNMP_SCALAR_CREATE_NODE(32, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.31  */
 
- static const struct snmp_scalar_node signal31 = SNMP_SCALAR_CREATE_NODE(31, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.30  */
 
- static const struct snmp_scalar_node signal30 = SNMP_SCALAR_CREATE_NODE(30, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.29  */
 
- static const struct snmp_scalar_node signal29 = SNMP_SCALAR_CREATE_NODE(29, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.28  */
 
- static const struct snmp_scalar_node signal28 = SNMP_SCALAR_CREATE_NODE(28, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.27  */
 
- static const struct snmp_scalar_node signal27 = SNMP_SCALAR_CREATE_NODE_READONLY(27, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.26  */
 
- static const struct snmp_scalar_node signal26 = SNMP_SCALAR_CREATE_NODE_READONLY(26, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.25  */
 
- static const struct snmp_scalar_node signal25 = SNMP_SCALAR_CREATE_NODE_READONLY(25, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.24  */
 
- static const struct snmp_scalar_node signal24 = SNMP_SCALAR_CREATE_NODE_READONLY(24, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.23  */
 
- static const struct snmp_scalar_node signal23 = SNMP_SCALAR_CREATE_NODE_READONLY(23, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.22  */
 
- static const struct snmp_scalar_node signal22 = SNMP_SCALAR_CREATE_NODE(22, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.21  */
 
- static const struct snmp_scalar_node signal21 = SNMP_SCALAR_CREATE_NODE(21, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.20  */
 
- static const struct snmp_scalar_node signal20 = SNMP_SCALAR_CREATE_NODE(20, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.19  */
 
- static const struct snmp_scalar_node signal19 = SNMP_SCALAR_CREATE_NODE(19, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.18  */
 
- static const struct snmp_scalar_node signal18 = SNMP_SCALAR_CREATE_NODE(18, SNMP_NODE_INSTANCE_READ_WRITE,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, signal_get_value, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.17  */
 
- static const struct snmp_scalar_node signal17 = SNMP_SCALAR_CREATE_NODE_READONLY(17, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.16  */
 
- static const struct snmp_scalar_node signal16 = SNMP_SCALAR_CREATE_NODE_READONLY(16, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.15  */
 
- static const struct snmp_scalar_node signal15 = SNMP_SCALAR_CREATE_NODE_READONLY(15, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.14  */
 
- static const struct snmp_scalar_node signal14 = SNMP_SCALAR_CREATE_NODE_READONLY(14, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.13  */
 
- static const struct snmp_scalar_node signal13 = SNMP_SCALAR_CREATE_NODE_READONLY(13, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.12  */
 
- static const struct snmp_scalar_node signal12 = SNMP_SCALAR_CREATE_NODE_READONLY(12, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.11  */
 
- static const struct snmp_scalar_node signal11 = SNMP_SCALAR_CREATE_NODE_READONLY(11, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.10  */
 
- static const struct snmp_scalar_node signal10 = SNMP_SCALAR_CREATE_NODE_READONLY(10, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.9  */
 
- static const struct snmp_scalar_node signal9 = SNMP_SCALAR_CREATE_NODE_READONLY(9, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.8  */
 
- static const struct snmp_scalar_node signal8 = SNMP_SCALAR_CREATE_NODE(8, SNMP_NODE_INSTANCE_WRITE_ONLY,
 
-         SNMP_ASN1_TYPE_OCTET_STRING, NULL, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.7  */
 
- static const struct snmp_scalar_node signal7 = SNMP_SCALAR_CREATE_NODE(7, SNMP_NODE_INSTANCE_WRITE_ONLY,
 
-         SNMP_ASN1_TYPE_INTEGER, NULL, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.6  */
 
- static const struct snmp_scalar_node signal6 = SNMP_SCALAR_CREATE_NODE_READONLY(6, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.5  */
 
- static const struct snmp_scalar_node signal5 = SNMP_SCALAR_CREATE_NODE_READONLY(5, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.4  */
 
- static const struct snmp_scalar_node signal4 = SNMP_SCALAR_CREATE_NODE_READONLY(4, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.3  */
 
- static const struct snmp_scalar_node signal3 = SNMP_SCALAR_CREATE_NODE(3, SNMP_NODE_INSTANCE_WRITE_ONLY,
 
-         SNMP_ASN1_TYPE_INTEGER, NULL, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.2  */
 
- static const struct snmp_scalar_node signal2 = SNMP_SCALAR_CREATE_NODE(2, SNMP_NODE_INSTANCE_WRITE_ONLY,
 
-         SNMP_ASN1_TYPE_INTEGER, NULL, signal_set_test, signal_set_value);
 
- /* signal .1.3.6.1.4.1.41752.911.10.1.1  */
 
- static const struct snmp_scalar_node signal1 = SNMP_SCALAR_CREATE_NODE_READONLY(1, SNMP_ASN1_TYPE_OCTET_STRING,
 
-         signal_get_value);
 
- // signals .1.3.6.1.4.1.41752.911.10.1
 
- static const struct snmp_node *const signals_nodes[] = {
 
-     &signal1.node.node,
 
-     &signal2.node.node,
 
-     &signal3.node.node,
 
-     &signal4.node.node,
 
-     &signal5.node.node,
 
-     &signal6.node.node,
 
-     &signal7.node.node,
 
-     &signal8.node.node,
 
-     &signal9.node.node,
 
-     &signal10.node.node,
 
-     &signal11.node.node,
 
-     &signal12.node.node,
 
-     &signal13.node.node,
 
-     &signal14.node.node,
 
-     &signal15.node.node,
 
-     &signal16.node.node,
 
-     &signal17.node.node,
 
-     &signal18.node.node,
 
-     &signal19.node.node,
 
-     &signal20.node.node,
 
-     &signal21.node.node,
 
-     &signal22.node.node,
 
-     &signal23.node.node,
 
-     &signal24.node.node,
 
-     &signal25.node.node,
 
-     &signal26.node.node,
 
-     &signal27.node.node,
 
-     &signal28.node.node,
 
-     &signal29.node.node,
 
-     &signal30.node.node,
 
-     &signal31.node.node,
 
-     &signal32.node.node,
 
-     &signal33.node.node,
 
-     &signal34.node.node,
 
-     &signal35.node.node,
 
-     &signal36.node.node,
 
-     &signal37.node.node,
 
-     &signal38.node.node,
 
-     &signal39.node.node,
 
-     &signal40.node.node,
 
-     &signal41.node.node,
 
-     &signal42.node.node,
 
-     &signal43.node.node,
 
-     &signal44.node.node,
 
-     &signal45.node.node,
 
-     &signal46.node.node,
 
-     &signal47.node.node,
 
-     &signal48.node.node,
 
-     &signal49.node.node,
 
- };
 
- static const struct snmp_tree_node signals_node = SNMP_CREATE_TREE_NODE(1, signals_nodes);
 
- // bt_6703 .1.3.6.1.4.1.41752.911.10
 
- static const struct snmp_node *const bt6709_nodes[] = {
 
-     &signals_node.node
 
- };
 
- static const struct snmp_tree_node bt6709_node = SNMP_CREATE_TREE_NODE(SNMP_DEV_ROOT_OID, bt6709_nodes);
 
- // swt .1.3.6.1.4.1.41752.911
 
- static const struct snmp_node *const swt_nodes[] = {
 
-     &bt6709_node.node
 
- };
 
- static const struct snmp_tree_node swt_node = SNMP_CREATE_TREE_NODE(911, swt_nodes);
 
- // rotek .1.3.6.1.4.1.41752
 
- static const struct snmp_node *const rotek_nodes[] = {
 
-     &swt_node.node
 
- };
 
- static const struct snmp_tree_node rotek_node = SNMP_CREATE_TREE_NODE(41752, rotek_nodes);
 
- // enterprises .1.3.6.1.4.1
 
- static const struct snmp_node *const enterprises_nodes[] = {
 
-     &rotek_node.node
 
- };
 
- static const struct snmp_tree_node enterprises_node = SNMP_CREATE_TREE_NODE(1, enterprises_nodes);
 
- // private .1.3.6.1.4
 
- static const struct snmp_node *const private_nodes[] = {
 
-     &enterprises_node.node
 
- };
 
- static const struct snmp_tree_node private_root = SNMP_CREATE_TREE_NODE(0, private_nodes);
 
- static const u32_t prvmib_base_oid[] = { 1, 3, 6, 1, 4 };
 
- static const struct snmp_mib private_mib = SNMP_MIB_CREATE(prvmib_base_oid, &private_root.node);
 
- void lwip_privmib_init(void)
 
- {
 
-     static const struct snmp_mib *my_snmp_mibs[] = {&mib2, &private_mib};
 
-     snmp_set_mibs(my_snmp_mibs, LWIP_ARRAYSIZE(my_snmp_mibs));
 
- }
 
- uint32_t check_netsettings(char *addr, uint8_t len)
 
- {
 
-     uint32_t val = 0;
 
-     uint8_t i, j;
 
-     uint8_t cnt_dot = 0;
 
-     uint8_t digit = 0;
 
-     uint8_t c = *addr;
 
-     for (j = 0; j <= len; j ++) {
 
-         if (isdigit(c)) {
 
-             val = (val * 10) + (int)(c - '0');
 
-         } else if (c == '.' || c == 0) {
 
-             if (val > 0xff) {
 
-                 return 0;
 
-             }
 
-             cnt_dot ++;
 
-             val = 0;
 
-         } else {
 
-             return 0;
 
-         }
 
-         c = *++addr;
 
-     }
 
-     if (cnt_dot != 4) {
 
-         return 0;
 
-     }
 
-     return 1;
 
- }
 
- static s16_t signal_get_value(struct snmp_node_instance *instance, void *value)
 
- {
 
-     u8_t *paramStr = (u8_t *)value;
 
-     s32_t *paramInt = (u8_t*)value;
 
-     u8_t paramLength = 0;
 
-     float val = 0;
 
-     int32_t int_val = 0;
 
-     u32_t oid = instance->node->oid; // id сигнала
 
-     switch (oid) {
 
-         case 1: /* FWVersion */
 
-             GetVersionStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 4: /* UPSModel*/
 
-             GetUPSModelStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 5: /* UPSSerial*/
 
-             GetUPSSerialStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 6: /* UPSVersion*/
 
-             GetUPSVersionStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 9: /* IntTemp */
 
-             GetInternalTempStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 10: /* InFreq */
 
-             GetInputFreqStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 11: /* InVoltVAC */
 
-             GetInputVoltageStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 12: /* OutVoltVAC */
 
-             GetOutputVoltageStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 13: /* Power */
 
-             GetPowerStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 14: /* BatCap */
 
-             GetBatCapacityStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 15: /* BatTime */
 
-             GetRuntimeStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 16: /* ConnectMonitor */
 
-             GetConnectMonitorStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 17: /* Alarms */
 
-             GetAlarmStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 18: /* IP server1 (traps) */
 
-             GetManagerIp((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 19: /* IP server2 (traps) */
 
-             GetManagerIp2((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 20: /* IP server3 (traps) */
 
-             GetManagerIp3((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 21: /* IP server4 (traps) */
 
-             GetManagerIp4((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 22: /* IP server5 (traps) */
 
-             GetManagerIp5((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 23: /* WhiteList range 1 */
 
-             GetWhiteListSTR((char *)paramStr, ¶mLength, 0);
 
-             break;
 
-         case 24: /* WhiteList range 2 */
 
-             GetWhiteListSTR((char *)paramStr, ¶mLength, 1);
 
-             break;
 
-         case 25: /* WhiteList range 3 */
 
-             GetWhiteListSTR((char *)paramStr, ¶mLength, 2);
 
-             break;
 
-         case 26: /* WhiteList range 4 */
 
-             GetWhiteListSTR((char *)paramStr, ¶mLength, 3);
 
-             break;
 
-         case 27: /* WhiteList range 5 */
 
-             GetWhiteListSTR((char *)paramStr, ¶mLength, 4);
 
-             break;
 
-         case 28: /* UPSVoltCellMin */
 
-             GetUPSVoltCellMinStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 29: /* UPSVoltCellMax */
 
-             GetUPSVoltCellMaxStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 30: /* VACAlarmHighRange */
 
-             GetVACAlarmHighRangeStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 31: /* VACAlarmLowRange */
 
-             GetVACAlarmLowRangeStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 32: /* VACAlarmHistRange */
 
-             GetVACAlarmHisteStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 33: /* TemperatureAlarmHighRange */
 
-             GetTemperatureAlarmHighRangeStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 34: /* TemperatureAlarmLowRange */
 
-             GetTemperatureAlarmLowRangeStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 35: /* TemperatureAlarmHistRange */
 
-             GetTemperatureAlarmHisteStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 36: /* LoadAlarmHighRange */
 
-             GetLoadAlarmHighRangeStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 37: /* LoadAlarmHistRange */
 
-             GetLoadAlarmHisteStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 38: /* SntpTimeZone */
 
-             GetSntpTimeZoneStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 39: /* SntpState */
 
-             GetSntpStateStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 40: /* SntpServerIp */
 
-             GetSntpServerIpStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 41: /* SntpLastData */
 
-             GetSntpLastDataStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 42: /* Date */
 
-             GetDateStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 43: /* Time */
 
-             GetTimeStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 44: /* AKBTimeWork */
 
-             GetAKBWorktimeStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 45: /* InputCurrent */
 
-             GetInputCurrentStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 46: /* OutputCurrent */
 
-             GetOutputCurrentStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 47: /* VoltageAKB */
 
-             GetVoltageAKBtStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 48: /*  CapacityNominalAKB*/
 
-             GetCapacityNominalAKBStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         case 49: /*  DataNextChangeAKB*/
 
-             GetDataNextChangeAKBStr((char *)paramStr, ¶mLength);
 
-             break;
 
-         default:
 
-             break;
 
-     }
 
-     return paramLength;
 
- }
 
- static snmp_err_t signal_set_value(struct snmp_node_instance *instance, u16_t len, void *value)
 
- {
 
-     u32_t oid = instance->node->oid; // id сигнала
 
-     char *val_string;
 
-     char str[20];
 
-     int8_t res = 0;
 
-     s32_t val;
 
-     float setVal;
 
-     bool enable_old_sntp;
 
-     memset(str, 0, 20);
 
-     switch (oid) {
 
-         case 2: /* RestoreSignal */
 
-             val = *(s32_t *)value;
 
-             if (val == 1) {
 
-                 //    SNMP_SendUserTrap(DEVICE_RESTORED);
 
-                 log_event_data(LOG_SYSTEM_DEFCONFIG, "Администратор");
 
-                 vTaskDelay(500);
 
-                 SETTINGS_SetPartDefault();
 
-                 SETTINGS_Save();
 
-             }
 
-             break;
 
-         case 3: /* RebootSignal */
 
-             val = *(s32_t *)value;
 
-             if (val == 1) {
 
-                 HTTP_StartResetTask(false);
 
-             }
 
-             break;
 
-         case 7: /* BatTest */
 
-             val = *(s32_t *)value;
 
-             if (val == 0) {
 
-                 res = ups_metac_service_pdu(ups_cancel_test);
 
-                 if (res == 1) {
 
-                     log_event_data(LOG_TEST_UPS, "Администратор (Останов)");
 
-                 }
 
-             } else if (val > 0 && val < 100) {
 
-                 TimeParam = val;
 
-                 res = ups_metac_service_pdu(ups_test_time);
 
-                 set_act_source(SNMP_ACT);
 
-             } else if (val == 100) {
 
-                 res = ups_metac_service_pdu(ups_test_10sec);
 
-                 set_act_source(SNMP_ACT);
 
-             } else if (val == 999) {
 
-                 res = ups_metac_service_pdu(ups_test_low_bat);
 
-                 set_act_source(SNMP_ACT);
 
-             }
 
-             break;
 
-         case 8: /* Shutdown UPS */
 
-             val_string = (char *)value;
 
-             float shtdn_val = atof(val_string);
 
-             if (shtdn_val == 0) {
 
-                 res = ups_metac_service_pdu(ups_cancel_shut_down);
 
-                 if (res == 1) {
 
-                     log_event_data(LOG_SHUTDOWN_UPS, "Администратор (Останов)");
 
-                 }
 
-             } else {
 
-                 TimeParamFloat = shtdn_val;
 
-                 res = ups_metac_service_pdu(ups_shutdown);
 
-                 if (res == 1) {
 
-                     log_event_data(LOG_SHUTDOWN_UPS, "Администратор");
 
-                 }
 
-             }
 
-             break;
 
-         case 18:
 
-             val_string = (char *)value;
 
-             SetManagerIp(val_string);
 
-             break;
 
-         case 19:
 
-             val_string = (char *)value;
 
-             SetManagerIp2(val_string);
 
-             break;
 
-         case 20:
 
-             val_string = (char *)value;
 
-             SetManagerIp3(val_string);
 
-             break;
 
-         case 21:
 
-             val_string = (char *)value;
 
-             SetManagerIp4(val_string);
 
-             break;
 
-         case 22:
 
-             val_string = (char *)value;
 
-             SetManagerIp5(val_string);
 
-             break;
 
-         case 28:
 
-             val_string = (char *)value;
 
-             SetUPSVoltCellMinStr(val_string);
 
-             break;
 
-         case 29:
 
-             val_string = (char *)value;
 
-             SetUPSVoltCellMaxStr(val_string);
 
-             break;
 
-         case 30:
 
-             val_string = (char *)value;
 
-             SetVACAlarmHighRangeStr(val_string);
 
-             break;
 
-         case 31:
 
-             val_string = (char *)value;
 
-             SetVACAlarmLowRangeStr(val_string);
 
-             break;
 
-         case 32:
 
-             val_string = (char *)value;
 
-             SetVACAlarmHisteStr(val_string);
 
-             break;
 
-         case 33:
 
-             val_string = (char *)value;
 
-             SetTemperatureAlarmHighRangeStr(val_string);
 
-             break;
 
-         case 34:
 
-             val_string = (char *)value;
 
-             SetTemperatureAlarmLowRangeStr(val_string);
 
-             break;
 
-         case 35:
 
-             val_string = (char *)value;
 
-             SetTemperatureAlarmHisteStr(val_string);
 
-             break;
 
-         case 36:
 
-             val_string = (char *)value;
 
-             SetLoadAlarmHighRangeStr(val_string);
 
-             break;
 
-         case 37:
 
-             val_string = (char *)value;
 
-             SetLoadAlarmHistStr(val_string);
 
-             break;
 
-         case 38:
 
-             val_string = (char *)value;
 
-             SetSntpTimeZoneStr(val_string);
 
-             break;
 
-         case 39:
 
-             enable_old_sntp = sSettings.sSNTP.sntpEnable;
 
-             val_string = (char *)value;
 
-             SetSntpStateStr(val_string);
 
-             if (sSettings.sSNTP.sntpEnable != enable_old_sntp) {
 
-                 SETTINGS_Save();
 
-                 log_event_data(LOG_SETTING_SAVE, "Администратор (SNMP)");
 
-             }
 
-             break;
 
-         case 40:
 
-             val_string = (char *)value;
 
-             if (strncmp(val_string, sSettings.sSNTP.ip, strlen(val_string)) != 0) {
 
-                 SetSntpServerIpStr(val_string);
 
-                 SETTINGS_Save();
 
-                 log_event_data(LOG_SETTING_SAVE, "Администратор (SNMP)");
 
-                 SNTP_Init();
 
-                 //vTaskDelay(7000);
 
-                 SNTP_Poll();
 
-             }
 
-             break;
 
-         case 41:
 
-             break;
 
-         case 42:
 
-             val_string = (char *)value;
 
-             SetDateStr(val_string);
 
-             break;
 
-         case 43:
 
-             val_string = (char *)value;
 
-             SetTimeStr(val_string);
 
-             break;
 
-         case 48:
 
-             val_string = (char *)value;
 
-             SetCapacityNominalAKBStr(val_string);
 
-             break;
 
-         default :
 
-             return SNMP_ERR_GENERROR;
 
-             break;
 
-     };
 
-     if ((oid >= 18 && oid <= 22)
 
-         || (oid >= 28 && oid <= 38)) {
 
-         SETTINGS_Save();
 
-         log_event_data(LOG_SETTING_SAVE, "Администратор (SNMP)");
 
-     }
 
-     return SNMP_ERR_NOERROR;
 
- }
 
- static snmp_err_t signal_set_test(struct snmp_node_instance *instance, u16_t len, void *value)
 
- {
 
-     snmp_err_t ret = SNMP_ERR_WRONGVALUE;
 
-     char *val_string;
 
-     int32_t val;
 
-     float tmp_value;
 
-     uint8_t j;
 
-     u32_t oid = instance->node->oid; // id сигнала
 
-     bool fail = false;
 
-     switch (oid) {
 
-         case 2:
 
-         case 3:
 
-             if ( len == sizeof(s32_t) ) {
 
-                 val = *((s32_t *)value);
 
-                 if (val == 1) {
 
-                     ret = SNMP_ERR_NOERROR;
 
-                 }
 
-             }
 
-             break;
 
-         case 7: /* BatTest */
 
-             val = *((s32_t *)value);
 
-             if ((val >= 0 && val <= 100) || val == 999) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 8: /* Shutdown UPS */
 
-             if ( len <= 3 ) {
 
-                 val_string = (char *)value;
 
-                 val_string[len] = 0;
 
-                 if (atof(val_string) <= 10) {
 
-                     ret = SNMP_ERR_NOERROR;
 
-                 }
 
-             }
 
-             break;
 
-         case 18:
 
-         case 19:
 
-         case 20:
 
-         case 21:
 
-         case 22:
 
-         case 40:
 
-             if ( len <= 15 ) {
 
-                 val_string = (char *)value;
 
-                 val_string[len] = 0;
 
-                 if (check_netsettings(val_string, len)) {
 
-                     ret = SNMP_ERR_NOERROR;
 
-                 }
 
-             }
 
-             break;
 
-         case 28:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isfloatdigit(val_string[j])) {
 
-                     return ret;
 
-                 }
 
-             }
 
-             tmp_value = atof(val_string);
 
-             if (tmp_value < sSettings.UPS_Setting.Ucellmax && tmp_value > MIN_VOLT_CELL_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 29:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isfloatdigit(val_string[j])) {
 
-                     return ret;
 
-                 }
 
-             }
 
-             tmp_value = atof(val_string);
 
-             if (tmp_value > sSettings.UPS_Setting.Ucellmin && tmp_value <= MAX_VOLT_CELL_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 30:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isdigit_int(val_string[j])) {
 
-                     return ret;
 
-                 }
 
-             }
 
-             tmp_value = atof(val_string);
 
-             if (tmp_value >= MAX_VAC_MIN_RANGE && tmp_value <= MAX_VAC_MAX_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 31:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isdigit_int(val_string[j])) {
 
-                     return ret;
 
-                 }
 
-             }
 
-             tmp_value = atof(val_string);
 
-             if (tmp_value >= MIN_VAC_MIN_RANGE && tmp_value <= MIN_VAC_MAX_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 32:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isdigit_int(val_string[j])) {
 
-                     return ret;
 
-                 }
 
-             }
 
-             tmp_value = atof(val_string);
 
-             if (tmp_value >= HIST_VAC_MIN_RANGE && tmp_value <= HIST_VAC_MAX_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 33:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isdigit_int(val_string[j])) {
 
-                     return ret;
 
-                 }
 
-             }
 
-             tmp_value = atof(val_string);
 
-             if (tmp_value >= MAX_TEMP_MIN_RANGE && tmp_value <= MAX_TEMP_MAX_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 34:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isdigit_int(val_string[j])) {
 
-                     if (j == 0 && val_string[j] == '-') {
 
-                         continue;
 
-                     } else {
 
-                         return ret;
 
-                     }
 
-                 }
 
-             }
 
-             tmp_value = atof(val_string);
 
-             if (tmp_value >= MIN_TEMP_MIN_RANGE && tmp_value <= MIN_TEMP_MAX_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 35:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isfloatdigit(val_string[j])) {
 
-                     return ret;
 
-                 }
 
-             }
 
-             tmp_value = atof(val_string);
 
-             if (tmp_value >= HIST_TEMP_MIN_RANGE && tmp_value <= HIST_TEMP_MAX_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 36:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isdigit_int(val_string[j])) {
 
-                     return ret;
 
-                 }
 
-             }
 
-             tmp_value = atof(val_string);
 
-             if (tmp_value >= MAX_LOAD_MIN_RANGE && tmp_value <= MAX_LOAD_MAX_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 37:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isfloatdigit(val_string[j])) {
 
-                     return ret;
 
-                 }
 
-             }
 
-             tmp_value = atof(val_string);
 
-             if (tmp_value >= HIST_LOAD_MIN_RANGE && tmp_value <= HIST_LOAD_MAX_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-         case 38:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             if (len > 1 && len < 5) {
 
-                 bool fail = false;
 
-                 if (val_string[0] != '-' && val_string[0] != '+') {
 
-                     fail = true;
 
-                 }
 
-                 if (!isdigit_int(val_string[1]) && (!isdigit_int(val_string[2]) && val_string[2] != '.')
 
-                     && (!isdigit_int(val_string[3]) && val_string[3] != '.')) {
 
-                     fail = true;
 
-                 }
 
-                 if (len == 5) {
 
-                     if (!isdigit_int(val_string[4])) {
 
-                         fail = true;
 
-                     }
 
-                 }
 
-                 if (!fail) {
 
-                     tmp_value = atof(val_string);
 
-                     if (tmp_value >= -12.0 && tmp_value <= 12.0) {
 
-                         ret = SNMP_ERR_NOERROR;
 
-                     }
 
-                 }
 
-             }
 
-             break;
 
-         case 39:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             if (len == 1) {
 
-                 if (val_string[0] == '0' || val_string[0] == '1') {
 
-                     ret = SNMP_ERR_NOERROR;
 
-                 }
 
-             }
 
-             break;
 
-         case 42:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             if (len == 10) {
 
-                 for (j = 0; j < len; j++) {
 
-                     if (j != 4 && j != 7) {
 
-                         if (val_string[j] > 0x39 || val_string[j] < 0x30) {
 
-                             fail = true;
 
-                             break;
 
-                         }
 
-                     } else if (j == 4 || j == 7) {
 
-                         if (val_string[j] != '-') {
 
-                             fail = true;
 
-                             break;
 
-                         }
 
-                     }
 
-                 }
 
-                 if (!fail) {
 
-                     uint16_t temp = 0;
 
-                     temp = 1000 * (val_string[0] - 0x30) + 100 * (val_string[1] - 0x30) + 10 * (val_string[2] - 0x30) + val_string[3] -
 
-                         0x30;
 
-                     if (temp > 2099 || temp < 2000) {
 
-                         fail = true;
 
-                     }
 
-                     temp = 0;
 
-                     temp = 10 * (val_string[5] - 0x30) + (val_string[6] - 0x30);
 
-                     if (temp > 12) {
 
-                         fail = true;
 
-                     }
 
-                     temp = 0;
 
-                     temp = 10 * (val_string[8] - 0x30) + (val_string[9] - 0x30);
 
-                     if (temp > 31) {
 
-                         fail = true;
 
-                     }
 
-                 }
 
-                 if (!fail) {
 
-                     ret = SNMP_ERR_NOERROR;
 
-                 }
 
-             }
 
-             break;
 
-         case 43:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             if (len == 5) {
 
-                 for (j = 0; j < len; j++) {
 
-                     if (j != 2) {
 
-                         if (val_string[j] > 0x39 || val_string[j] < 0x30) {
 
-                             fail = true;
 
-                             break;
 
-                         }
 
-                     } else if (j == 2) {
 
-                         if (val_string[j]  != ':') {
 
-                             fail = true;
 
-                             break;
 
-                         }
 
-                     }
 
-                 }
 
-                 if (!fail) {
 
-                     uint16_t temp = 0;
 
-                     temp = 10 * (val_string[0] - 0x30) + (val_string[1] - 0x30);
 
-                     if (temp > 23) {
 
-                         fail = true;
 
-                     }
 
-                     temp = 0;
 
-                     temp = 10 * (val_string[3] - 0x30) + (val_string[4] - 0x30);
 
-                     if (temp > 59) {
 
-                         fail = true;
 
-                     }
 
-                 }
 
-                 if (!fail) {
 
-                     ret = SNMP_ERR_NOERROR;
 
-                 }
 
-             }
 
-             break;
 
-         case 48:
 
-             val_string = (char *)value;
 
-             val_string[len] = 0;
 
-             for (j = 0; j < len; j ++) {
 
-                 if (!isdigit_int(val_string[j])) {
 
-                     return ret;
 
-                 }
 
-             }
 
-             val = atoi(val_string);
 
-             if (val >= CAPACITY_MIN_RANGE && val <= CAPACITY_MAX_RANGE) {
 
-                 ret = SNMP_ERR_NOERROR;
 
-             }
 
-             break;
 
-     };
 
-     return ret;
 
- }
 
- #endif
 
 
  |