diff options
author | Uros Majstorovic <majstor@majstor.org> | 2023-04-21 21:18:57 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2023-04-21 21:18:57 +0200 |
commit | 34f60314bedce036f982aa6591b5473ea4b0fa8b (patch) | |
tree | 9a779a703c7c8a2d4905bd0a7c06cb1ec36c9fb5 /fw/fe310/phone/sms.c | |
parent | 9cb8a37e71945800da5aa6fc05a9a32dc7bd0b69 (diff) |
fixed SMS app
Diffstat (limited to 'fw/fe310/phone/sms.c')
-rw-r--r-- | fw/fe310/phone/sms.c | 22 |
1 files changed, 13 insertions, 9 deletions
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); } |