Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 2:5131512b4eb9
- Parent:
- 1:d95d135a4fb4
- Child:
- 3:cd312fc32558
--- a/main.cpp Mon Oct 16 11:20:25 2017 -0700
+++ b/main.cpp Fri Nov 10 17:42:50 2017 +0000
@@ -81,12 +81,10 @@
lora.start_tx(lora.RegPayloadLength); /* begin transmission */
- printf("tx-ack-start\r\n");
while (lora.service() != SERVICE_TX_DONE) /* wait for transmission to complete */
;
lora.start_rx(RF_OPMODE_RECEIVER);
- printf("tx-ack-end\r\n");
}
void radio_tx(uint8_t* payload, uint8_t payload_len)
@@ -123,14 +121,15 @@
while (t.read_us() < rx_timeout_at) {
if (lora.service() == SERVICE_READ_FIFO) {
uint16_t rx_crc;
+ printf("rssi:%ddBm snr:%.1fdB ", lora.get_pkt_rssi(), lora.RegPktSnrValue / 4.0);
rx_crc = radio.rx_buf[lora.RegRxNbBytes-2];
rx_crc |= radio.rx_buf[lora.RegRxNbBytes-1] << 8;
crc = crc16(radio.rx_buf, lora.RegRxNbBytes-2);
if (crc == rx_crc) {
printf("crcOk %u\r\n", i);
if (radio.rx_buf[0] == CMD_OUT_PIN_ACK) {
- uint16_t ain = radio.rx_buf[0];
- ain |= radio.rx_buf[1] << 8;
+ uint16_t ain = radio.rx_buf[1];
+ ain |= radio.rx_buf[2] << 8;
printf("ain %u\r\n", ain);
}
return;
@@ -228,7 +227,7 @@
for (i = 0; i < lora.RegRxNbBytes; i++) {
printf("%02x ", radio.rx_buf[i]);
}
- printf("\r\n");
+ printf(" rssi:%ddBm, snr:%.1fdB\r\n", lora.get_pkt_rssi(), lora.RegPktSnrValue / 4.0);
rx_crc = radio.rx_buf[lora.RegRxNbBytes-2];
rx_crc |= radio.rx_buf[lora.RegRxNbBytes-1] << 8;
crc = crc16(radio.rx_buf, lora.RegRxNbBytes-2);