RDS Radiotext should make receiver happier (missing end char)

String-ized text entry
This commit is contained in:
furrtek
2017-04-18 18:12:32 +01:00
parent 62b90942ac
commit 555201b780
24 changed files with 138 additions and 165 deletions

View File

@@ -24,17 +24,17 @@
namespace ui {
bool textentry(NavigationView& nav, char * str, const size_t max_length, const std::function<void(char *)> on_done) {
bool text_entry(NavigationView& nav, std::string& str, const size_t max_length, const std::function<void(std::string)> on_done) {
if (portapack::persistent_memory::ui_config_textentry() == 0) {
auto te_view = nav.push<AlphanumView>(str, max_length);
te_view->on_changed = [str, max_length, on_done](char * value) {
te_view->on_changed = [str, max_length, on_done](std::string value) {
//memcpy(str, value, max_length + 1);
if (on_done) on_done(value);
};
} else {
auto te_view = nav.push<HandWriteView>(str, max_length);
te_view->on_changed = [str, max_length, on_done](char * value) {
te_view->on_changed = [str, max_length, on_done](std::string value) {
//memcpy(str, value, max_length + 1);
if (on_done) on_done(value);
};