Fix ttn_wait_for_idle for MAC cmd processing

This commit is contained in:
Manuel Bl
2021-09-28 22:38:05 +02:00
parent e71d584fca
commit 0130928601
6 changed files with 78 additions and 74 deletions

View File

@ -49,6 +49,14 @@ const char *appKey = "????????????????????????????????";
static uint8_t msgData[] = "Hello, world";
void messageReceived(const uint8_t* message, size_t length, ttn_port_t port)
{
printf("Message of %d bytes received on port %d:", length, port);
for (int i = 0; i < length; i++)
printf(" %02x", message[i]);
printf("\n");
}
void app_main(void)
{
esp_err_t err;
@ -80,6 +88,9 @@ void app_main(void)
// The below line can be commented after the first run as the data is saved in NVS
ttn_provision(devEui, appEui, appKey);
// Register callback for received messages
ttn_on_message(messageReceived);
// ttn_set_adr_enabled(false);
// ttn_set_data_rate(TTN_DR_US915_SF7);
// ttn_set_max_tx_pow(14);