Read RUN_APPLICATION from sdk

This commit is contained in:
Francois Beutin
2024-01-15 17:17:29 +01:00
parent 6fe2d92d3b
commit 6430c8f463
8 changed files with 71 additions and 26 deletions

View File

@@ -147,23 +147,3 @@ bool amountToString(const uint8_t *amount,
out_buffer[out_buffer_size - 1] = '\0';
return true;
}
bool parse_swap_config(const uint8_t *config, uint8_t config_len, char *ticker, uint8_t *decimals) {
uint8_t ticker_len, offset = 0;
if (config_len == 0) {
return false;
}
ticker_len = config[offset++];
if (ticker_len == 0 || ticker_len > MAX_TICKER_LEN - 2 || config_len - offset < ticker_len) {
return false;
}
memcpy(ticker, config + offset, ticker_len);
offset += ticker_len;
ticker[ticker_len] = '\0';
if (config_len - offset < 1) {
return false;
}
*decimals = config[offset];
return true;
}