From 34f60314bedce036f982aa6591b5473ea4b0fa8b Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Fri, 21 Apr 2023 21:18:57 +0200 Subject: fixed SMS app --- fw/fe310/phone/sms.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'fw/fe310/phone') diff --git a/fw/fe310/phone/sms.c b/fw/fe310/phone/sms.c index d2819c9..2594464 100644 --- a/fw/fe310/phone/sms.c +++ b/fw/fe310/phone/sms.c @@ -33,7 +33,8 @@ static void handle_cell_sms(unsigned char type, unsigned char *buffer, uint16_t APP_LOG(APP_LOG_ERR, "SMS PARSE ERR:%d\n", rv); break; } - APP_LOG(APP_LOG_DEBUG, "SMS From:%s\n%s\n", num, text); + APP_LOG(APP_LOG_DEBUG, "SMS From:%s\n", num); + APP_LOG(APP_LOG_DEBUG, "%s\n", text); break; } } @@ -58,21 +59,24 @@ void sms_init(void) { int sms_app(EVEWindow *window, EVEViewStack *stack) { EVEFormSpec spec[] = { { - .label.title = "Text:", + .label.title = "To:", .widget.type = EVE_WIDGET_TYPE_STR, - .widget.tspec.str.str_size = EOS_CELL_MAX_SMS_TEXT + 1, + .widget.tspec.str.str_size = EOS_CELL_MAX_DIAL_STR + 1, }, APP_SPACERW(APP_SCREEN_W, 50), { - .label.title = "Phone:", + .label.title = "Text:", + .label.g.w = APP_SCREEN_W, - .widget.type = EVE_WIDGET_TYPE_STR, - .widget.tspec.str.str_size = EOS_CELL_MAX_DIAL_STR + 1, + .widget.type = EVE_WIDGET_TYPE_TEXT, + .widget.g.w = APP_SCREEN_W, + .widget.tspec.text.text_size = EOS_CELL_MAX_SMS_TEXT + 1, + .widget.tspec.text.line_size = 5, }, }; - EVEPage *page = eve_form_create(window, stack, spec, APP_SPEC_SIZE(spec), NULL, sms_close); + EVEPage *page = eve_form_create(window, stack, spec, APP_SPEC_SIZE(spec), sms_uievt, sms_close); if (page == NULL) { APP_LOG(APP_LOG_ERR, "OUT OF MEMORY\n"); return EVE_ERR_NOMEM; @@ -87,8 +91,8 @@ int sms_uievt(EVEPage *page, uint16_t evt, void *param) { switch (evt) { case EVE_UIEVT_WIDGET_FOCUS_OUT: { if (param == eve_page_widget(page, 1)) { - EVEStrWidget *num = param; - EVEStrWidget *text = (EVEStrWidget *)eve_page_widget(page, 0); + EVEStrWidget *num = (EVEStrWidget *)eve_page_widget(page, 0); + EVEStrWidget *text = param; send(num->str, text->str); } -- cgit v1.2.3