Skip to content

Commit

Permalink
255 bytes are not working reliable in ook mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Dec 23, 2023
1 parent 90d158c commit b749302
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 0 additions & 7 deletions test/test_app/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,6 @@ TEST_CASE("sx127x_test_ook_rx_variable_length", "[ook]") {
xSemaphoreTake(fixture->rx_done, TIMEOUT);
TEST_ASSERT_EQUAL_UINT16(sizeof(fsk_max_single_batch), fixture->rx_data_length);
TEST_ASSERT_EQUAL_UINT8_ARRAY(fsk_max_single_batch, fixture->rx_data, sizeof(fsk_max_single_batch));
xSemaphoreTake(fixture->rx_done, TIMEOUT);
TEST_ASSERT_EQUAL_UINT16(sizeof(fsk_max_variable), fixture->rx_data_length);
TEST_ASSERT_EQUAL_UINT8_ARRAY(fsk_max_variable, fixture->rx_data, sizeof(fsk_max_variable));
}

TEST_CASE("sx127x_test_ook_tx_variable_length", "[ook]") {
Expand All @@ -392,10 +389,6 @@ TEST_CASE("sx127x_test_ook_tx_variable_length", "[ook]") {
TEST_ASSERT_EQUAL_INT(SX127X_OK, sx127x_fsk_ook_tx_set_for_transmission(fsk_max_single_batch, sizeof(fsk_max_single_batch), fixture->device));
TEST_ASSERT_EQUAL_INT(SX127X_OK, sx127x_set_opmod(SX127x_MODE_TX, SX127x_MODULATION_OOK, fixture->device));
xSemaphoreTake(fixture->tx_done, TIMEOUT);
vTaskDelay(pdMS_TO_TICKS(50));
TEST_ASSERT_EQUAL_INT(SX127X_OK, sx127x_fsk_ook_tx_set_for_transmission(fsk_max_variable, sizeof(fsk_max_variable), fixture->device));
TEST_ASSERT_EQUAL_INT(SX127X_OK, sx127x_set_opmod(SX127x_MODE_TX, SX127x_MODULATION_OOK, fixture->device));
xSemaphoreTake(fixture->tx_done, TIMEOUT);
}

void tearDown() {
Expand Down
6 changes: 3 additions & 3 deletions test/test_app/main/sx127x_fixture.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ int sx127x_fixture_create(sx127x_fixture_config_t *config, sx127x_modulation_t m
ERROR_CHECK(sx127x_fsk_ook_rx_set_rssi_config(SX127X_8, 0, result->device));
ERROR_CHECK(sx127x_fsk_ook_rx_set_preamble_detector(true, 2, 0x0A, result->device));
} else if (modulation == SX127x_MODULATION_OOK) {
ERROR_CHECK(sx127x_fsk_ook_set_bitrate(4800.0, result->device));
ERROR_CHECK(sx127x_rx_set_lna_gain(SX127x_LNA_GAIN_AUTO, result->device));
ERROR_CHECK(sx127x_fsk_ook_set_bitrate(1200.0, result->device));
ERROR_CHECK(sx127x_fsk_ook_rx_set_afc_auto(false, result->device));
ERROR_CHECK(sx127x_fsk_ook_rx_set_afc_bandwidth(5000.0, result->device));
ERROR_CHECK(sx127x_fsk_ook_rx_set_bandwidth(5000.0, result->device));
ERROR_CHECK(sx127x_fsk_ook_rx_set_bandwidth(2400.0, result->device));
uint8_t syncWord[] = {0x12, 0xAD};
ERROR_CHECK(sx127x_fsk_ook_set_syncword(syncWord, 2, result->device));
ERROR_CHECK(sx127x_fsk_ook_set_address_filtering(SX127X_FILTER_NONE, 0, 0, result->device));
Expand All @@ -129,7 +130,6 @@ int sx127x_fixture_create(sx127x_fixture_config_t *config, sx127x_modulation_t m
ERROR_CHECK(sx127x_ook_set_data_shaping(SX127X_1_BIT_RATE, SX127X_PA_RAMP_10, result->device));
ERROR_CHECK(sx127x_ook_rx_set_peak_mode(SX127X_0_5_DB, 0x0C, SX127X_1_1_CHIP, result->device));
ERROR_CHECK(sx127x_fsk_ook_set_crc(SX127X_CRC_CCITT, result->device));
ERROR_CHECK(sx127x_fsk_ook_rx_set_trigger(SX127X_RX_TRIGGER_RSSI_PREAMBLE, result->device));
ERROR_CHECK(sx127x_fsk_ook_rx_set_rssi_config(SX127X_8, 0, result->device));
ERROR_CHECK(sx127x_fsk_ook_rx_set_preamble_detector(true, 2, 0x0A, result->device));
} else {
Expand Down

0 comments on commit b749302

Please sign in to comment.