From d894eb01e9c979d0eb51f9495a7cf7281c213302 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 4 Sep 2022 18:39:21 +0200 Subject: removed old test --- fw/fe310/test/cell_pdp.c | 105 ----------------------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 fw/fe310/test/cell_pdp.c (limited to 'fw/fe310/test/cell_pdp.c') diff --git a/fw/fe310/test/cell_pdp.c b/fw/fe310/test/cell_pdp.c deleted file mode 100644 index e67ddb2..0000000 --- a/fw/fe310/test/cell_pdp.c +++ /dev/null @@ -1,105 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include "app/app_root.h" -#include "app/app_status.h" - -#include "cell_pdp.h" - -static void cell_pdp_connect(char *apn, char *user, char *pass) { - unsigned char *buffer, *p; - - buffer = eos_net_alloc(); - buffer[0] = EOS_CELL_MTYPE_PDP | EOS_CELL_MTYPE_PDP_CONFIG; - p = buffer + 1; - strcpy(p, user); - p += strlen(user) + 1; - strcpy(p, user); - p += strlen(user) + 1; - strcpy(p, pass); - p += strlen(pass) + 1; - eos_net_send(EOS_NET_MTYPE_CELL, buffer, p - buffer); - - buffer[0] = EOS_CELL_MTYPE_PDP | EOS_CELL_MTYPE_PDP_CONNECT; - eos_net_send_async(EOS_NET_MTYPE_CELL, buffer, 1, 0); -} - -static void cell_pdp_disconnect(void) { - unsigned char *buffer = eos_net_alloc(); - buffer[0] = EOS_CELL_MTYPE_PDP | EOS_CELL_MTYPE_PDP_DISCONNECT; - eos_net_send_async(EOS_NET_MTYPE_CELL, buffer, 1, 0); -} - -static void cell_pdp_handler(unsigned char type, unsigned char *buffer, uint16_t size) { - switch (type) { - case EOS_CELL_MTYPE_PDP_CONNECT: - app_status_msg_set("Cell data connected", 1); - break; - - case EOS_CELL_MTYPE_PDP_DISCONNECT: - app_status_msg_set("Cell data disconnected", 1); - break; - - default: - break; - } - eos_net_free(buffer, 0); -} - -void app_cell_pdp(EVEWindow *window, EVEViewStack *stack) { - EVEFormSpec spec[] = { - { - .label.g.w = APP_SCREEN_W / 3, - .label.title = "APN:", - - .widget.type = EVE_WIDGET_TYPE_STR, - .widget.tspec.str.str_size = 128, - }, - { - .label.g.w = APP_SCREEN_W / 3, - .label.title = "User:", - - .widget.type = EVE_WIDGET_TYPE_STR, - .widget.tspec.str.str_size = 128, - }, - { - .label.g.w = APP_SCREEN_W / 3, - .label.title = "Pass:", - - .widget.type = EVE_WIDGET_TYPE_STR, - .widget.tspec.str.str_size = 128, - }, - }; - - EVEForm *form = eve_form_create(window, stack, spec, 3, NULL, app_cell_pdp_action, app_cell_pdp_close); -} - -void app_cell_pdp_action(EVEForm *form) { - EVEStrWidget *apn = (EVEStrWidget *)eve_page_widget(&form->p, 0); - EVEStrWidget *user = (EVEStrWidget *)eve_page_widget(&form->p, 1); - EVEStrWidget *pass = (EVEStrWidget *)eve_page_widget(&form->p, 2); - - cell_pdp_connect(apn->str, user->str, pass->str); -} - -void app_cell_pdp_close(EVEForm *form) { - eve_form_destroy(form); -} - -void app_cell_pdp_init(void) { - eos_cell_set_handler(EOS_CELL_MTYPE_PDP, cell_pdp_handler); -} -- cgit v1.2.3