|
@@ -1069,6 +1069,85 @@ void GetWhiteListIP(uint32_t *value, uint8_t num)
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef PORTGW_ENABLE
|
|
|
|
+// ************************************************************************** //
|
|
|
|
+// Параметры прозрачного порта
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Включен/Выключен
|
|
|
|
+ */
|
|
|
|
+void GetPortGwEnabledStr(char *str, uint8_t *len)
|
|
|
|
+{
|
|
|
|
+ if (sSettings.sPortGw.enabled) {
|
|
|
|
+ sprintf(str, "%s", "true");
|
|
|
|
+ } else {
|
|
|
|
+ sprintf(str, "%s", "false");
|
|
|
|
+ }
|
|
|
|
+ *len = strlen(str);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief IP-адрес
|
|
|
|
+ */
|
|
|
|
+void GetPortGwIpStr(char *str, uint8_t *len)
|
|
|
|
+{
|
|
|
|
+ sprintf(str, "%s", sSettings.sPortGw.ip);
|
|
|
|
+ *len = strlen(str);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Сетевой порт
|
|
|
|
+ */
|
|
|
|
+void GetPortGwPortnumStr(char *str, uint8_t *len)
|
|
|
|
+{
|
|
|
|
+ sprintf(str, "%d", sSettings.sPortGw.port);
|
|
|
|
+ *len = strlen(str);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Скорость передачи данных
|
|
|
|
+ */
|
|
|
|
+void GetPortGwBaudStr(char *str, uint8_t *len)
|
|
|
|
+{
|
|
|
|
+ sprintf(str, "%d", sSettings.sPortGw.baud);
|
|
|
|
+ *len = strlen(str);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Четность
|
|
|
|
+ */
|
|
|
|
+void GetPortGwParityStr(char *str, uint8_t *len)
|
|
|
|
+{
|
|
|
|
+ if (sSettings.sPortGw.parity == GW_EVEN_PAR) {
|
|
|
|
+ sprintf(str, "%s", "ev");
|
|
|
|
+ } else if (sSettings.sPortGw.parity == GW_ODD_PAR) {
|
|
|
|
+ sprintf(str, "%s", "od");
|
|
|
|
+ } else {
|
|
|
|
+ sprintf(str, "%s", "no");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ *len = strlen(str);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Число бит данных
|
|
|
|
+ */
|
|
|
|
+void GetPortGwDatabitsStr(char *str, uint8_t *len)
|
|
|
|
+{
|
|
|
|
+ sprintf(str, "%d", sSettings.sPortGw.databits);
|
|
|
|
+ *len = strlen(str);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Число стоп-бит
|
|
|
|
+ */
|
|
|
|
+void GetPortGwStopbitsStr(char *str, uint8_t *len)
|
|
|
|
+{
|
|
|
|
+ sprintf(str, "%d", sSettings.sPortGw.stopbits);
|
|
|
|
+ *len = strlen(str);
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
// ************************************************************************** //
|
|
// ************************************************************************** //
|
|
// Параметры SNMP
|
|
// Параметры SNMP
|
|
|
|
|
|
@@ -1751,6 +1830,82 @@ void SetWhiteList5STR(char *str)
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef PORTGW_ENABLE
|
|
|
|
+// ************************************************************************** //
|
|
|
|
+// Параметры прозрачного порта
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Включен/Выключен
|
|
|
|
+ */
|
|
|
|
+void SetPortGwEnabledStr(char *str)
|
|
|
|
+{
|
|
|
|
+ if (strncmp(str, "on", 2) == 0) {
|
|
|
|
+ sSettings.sPortGw.enabled = true;
|
|
|
|
+ } else {
|
|
|
|
+ sSettings.sPortGw.enabled = false;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief IP-адрес
|
|
|
|
+ */
|
|
|
|
+void SetPortGwIpStr(char *str)
|
|
|
|
+{
|
|
|
|
+ char temp[16];
|
|
|
|
+
|
|
|
|
+ if (strlen(str) <= sizeof(temp)) {
|
|
|
|
+ ip_strip(str, temp);
|
|
|
|
+ SET_STR_VALUE(sSettings.sPortGw.ip, temp);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Сетевой порт
|
|
|
|
+ */
|
|
|
|
+void SetPortGwPortnumStr(char *str)
|
|
|
|
+{
|
|
|
|
+ sSettings.sPortGw.port = atoi(str);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Скорость передачи данных
|
|
|
|
+ */
|
|
|
|
+void SetPortGwBaudStr(char *str)
|
|
|
|
+{
|
|
|
|
+ sSettings.sPortGw.baud = atoi(str);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Четность
|
|
|
|
+ */
|
|
|
|
+void SetPortGwParityStr(char *str)
|
|
|
|
+{
|
|
|
|
+ if (strncmp(str, "no", 2) == 0) {
|
|
|
|
+ sSettings.sPortGw.parity = GW_NO_PAR;
|
|
|
|
+ } else if (strncmp(str, "od", 2) == 0) {
|
|
|
|
+ sSettings.sPortGw.parity = GW_ODD_PAR;
|
|
|
|
+ } else if (strncmp(str, "ev", 2) == 0) {
|
|
|
|
+ sSettings.sPortGw.parity = GW_EVEN_PAR;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Число бит данных
|
|
|
|
+ */
|
|
|
|
+void SetPortGwDatabitsStr(char *str)
|
|
|
|
+{
|
|
|
|
+ sSettings.sPortGw.databits = atoi(str);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief Число стоп-бит
|
|
|
|
+ */
|
|
|
|
+void SetPortGwStopbitsStr(char *str)
|
|
|
|
+{
|
|
|
|
+ sSettings.sPortGw.stopbits = atoi(str);
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
// ************************************************************************** //
|
|
// ************************************************************************** //
|
|
// Параметры SNMP
|
|
// Параметры SNMP
|
|
|
|
|