From 0a99036cbfd79a80d30070cb45ced9b246bf47af Mon Sep 17 00:00:00 2001 From: fengzero Date: Thu, 2 Jun 2022 08:39:58 +0000 Subject: [PATCH] remove tty --- include/neuron/json/neu_json_tty.h | 47 ------------------------ plugins/mqtt/command/common.h | 1 - plugins/restful/normal_handle.c | 1 - src/parser/neu_json_tty.c | 59 ------------------------------ 4 files changed, 108 deletions(-) delete mode 100644 include/neuron/json/neu_json_tty.h delete mode 100644 src/parser/neu_json_tty.c diff --git a/include/neuron/json/neu_json_tty.h b/include/neuron/json/neu_json_tty.h deleted file mode 100644 index 79816e60..00000000 --- a/include/neuron/json/neu_json_tty.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * NEURON IIoT System for Industry 4.0 - * Copyright (C) 2020-2021 EMQ Technologies Co., Ltd All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - **/ - -/* - * DO NOT EDIT THIS FILE MANUALLY! - * It was automatically generated by `json-autotype`. - */ - -#ifndef _NEU_JSON_API_NEU_JSON_TTY_H_ -#define _NEU_JSON_API_NEU_JSON_TTY_H_ - -#include "json/json.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef char *neu_json_get_tty_resp_tty_t; - -typedef struct { - int n_tty; - neu_json_get_tty_resp_tty_t *ttys; -} neu_json_get_tty_resp_t; - -int neu_json_encode_get_tty_resp(void *json_object, void *param); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/plugins/mqtt/command/common.h b/plugins/mqtt/command/common.h index d8a2b1e8..052e4831 100644 --- a/plugins/mqtt/command/common.h +++ b/plugins/mqtt/command/common.h @@ -33,7 +33,6 @@ extern "C" { #include "json/neu_json_plugin.h" #include "json/neu_json_rw.h" #include "json/neu_json_tag.h" -#include "json/neu_json_tty.h" #define UNUSED(x) (void) (x) diff --git a/plugins/restful/normal_handle.c b/plugins/restful/normal_handle.c index 2c491aef..1ee3b477 100644 --- a/plugins/restful/normal_handle.c +++ b/plugins/restful/normal_handle.c @@ -32,7 +32,6 @@ #include "json/neu_json_fn.h" #include "json/neu_json_login.h" -#include "json/neu_json_tty.h" #include "file.h" #include "handle.h" diff --git a/src/parser/neu_json_tty.c b/src/parser/neu_json_tty.c deleted file mode 100644 index 35349d82..00000000 --- a/src/parser/neu_json_tty.c +++ /dev/null @@ -1,59 +0,0 @@ -/** - * NEURON IIoT System for Industry 4.0 - * Copyright (C) 2020-2021 EMQ Technologies Co., Ltd All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - **/ - -/* - * DO NOT EDIT THIS FILE MANUALLY! - * It was automatically generated by `json-autotype`. - */ - -#include -#include - -#include "json/json.h" - -#include "json/neu_json_tty.h" - -int neu_json_encode_get_tty_resp(void *json_object, void *param) -{ - int ret = 0; - neu_json_get_tty_resp_t *resp = (neu_json_get_tty_resp_t *) param; - - void * tty_array = neu_json_array(); - neu_json_get_tty_resp_tty_t *p_tty = resp->ttys; - for (int i = 0; i < resp->n_tty; i++) { - neu_json_elem_t tty_elems[] = { { - .name = NULL, - .t = NEU_JSON_STR, - .v.val_str = *p_tty, - } }; - tty_array = neu_json_encode_array_value(tty_array, tty_elems, - NEU_JSON_ELEM_SIZE(tty_elems)); - p_tty++; - } - - neu_json_elem_t resp_elems[] = { { - .name = "ttys", - .t = NEU_JSON_OBJECT, - .v.val_object = tty_array, - } }; - ret = neu_json_encode_field(json_object, resp_elems, - NEU_JSON_ELEM_SIZE(resp_elems)); - - return ret; -}