■ ■ ■ ■ ■ ■
firmware/CatSniffer_LoRa/catSniffer_LoRa.ino
| skipped 42 lines |
43 | 43 | | Serial.print(F("[SX1262] Initializing ... ")); |
44 | 44 | | //debing(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO) |
45 | 45 | | int state = radio.begin(915.0, 250, 7, 5, 0x34, 20, 10, 0, false); |
46 | | - | if (state == ERR_NONE) { |
| 46 | + | if (state == RADIOLIB_ERR_NONE) { |
47 | 47 | | Serial.println(F("success!")); |
48 | 48 | | } else { |
49 | 49 | | Serial.print(F("failed, code ")); |
| skipped 28 lines |
78 | 78 | | int state = radio.transmit(byteArr, 8); |
79 | 79 | | */ |
80 | 80 | | |
81 | | - | if (state == ERR_NONE) { |
| 81 | + | if (state == RADIOLIB_ERR_NONE) { |
82 | 82 | | // the packet was successfully transmitted |
83 | 83 | | Serial.println(F("success!")); |
84 | 84 | | |
| skipped 2 lines |
87 | 87 | | Serial.print(radio.getDataRate()); |
88 | 88 | | Serial.println(F(" bps")); |
89 | 89 | | |
90 | | - | } else if (state == ERR_PACKET_TOO_LONG) { |
| 90 | + | } else if (state == RADIOLIB_ERR_PACKET_TOO_LONG) { |
91 | 91 | | // the supplied packet was longer than 256 bytes |
92 | 92 | | Serial.println(F("too long!")); |
93 | 93 | | |
94 | | - | } else if (state == ERR_TX_TIMEOUT) { |
| 94 | + | } else if (state == RADIOLIB_ERR_RX_TIMEOUT) { |
95 | 95 | | // timeout occured while transmitting packet |
96 | 96 | | Serial.println(F("timeout!")); |
97 | 97 | | |
| skipped 11 lines |