kopia lustrzana https://github.com/jgromes/RadioLib
[LR11x0] Remove setSyncBits method
rodzic
e6de3e284b
commit
e6dcb46de3
|
|
@ -70,13 +70,6 @@ void setup() {
|
|||
while (true) { delay(10); }
|
||||
}
|
||||
|
||||
// GFSK modem on LR11x0 can handle the sync word setting in bits, not just
|
||||
// whole bytes. The value used is left-justified.
|
||||
// This makes same result as radio.setSyncWord(syncWord, 8):
|
||||
state = radio.setSyncBits(syncWord, 64);
|
||||
// This will use 0x012 as sync word (12 bits only):
|
||||
state = radio.setSyncBits(syncWord, 12);
|
||||
|
||||
// GFSK modem allows advanced CRC configuration
|
||||
// Default is CCIT CRC16 (2 bytes, initial 0x1D0F, polynomial 0x1021, inverted)
|
||||
// Set CRC to IBM CRC (2 bytes, initial 0xFFFF, polynomial 0x8005, non-inverted)
|
||||
|
|
|
|||
|
|
@ -835,27 +835,6 @@ int16_t LR11x0::setSyncWord(uint8_t* syncWord, size_t len) {
|
|||
return(RADIOLIB_ERR_WRONG_MODEM);
|
||||
}
|
||||
|
||||
int16_t LR11x0::setSyncBits(uint8_t *syncWord, uint8_t bitsLen) {
|
||||
if((!syncWord) || (!bitsLen) || (bitsLen > 8*RADIOLIB_LR11X0_GFSK_SYNC_WORD_LEN)) {
|
||||
return(RADIOLIB_ERR_INVALID_SYNC_WORD);
|
||||
}
|
||||
|
||||
// check active modem
|
||||
uint8_t type = RADIOLIB_LR11X0_PACKET_TYPE_NONE;
|
||||
int16_t state = getPacketType(&type);
|
||||
RADIOLIB_ASSERT(state);
|
||||
if(type != RADIOLIB_LR11X0_PACKET_TYPE_GFSK) {
|
||||
return(RADIOLIB_ERR_WRONG_MODEM);
|
||||
}
|
||||
|
||||
uint8_t bytesLen = bitsLen / 8;
|
||||
if ((bitsLen % 8) != 0) {
|
||||
bytesLen++;
|
||||
}
|
||||
|
||||
return(setSyncWord(syncWord, bytesLen));
|
||||
}
|
||||
|
||||
int16_t LR11x0::setNodeAddress(uint8_t nodeAddr) {
|
||||
// check active modem
|
||||
uint8_t type = RADIOLIB_LR11X0_PACKET_TYPE_NONE;
|
||||
|
|
|
|||
|
|
@ -353,15 +353,6 @@ class LR11x0: public PhysicalLayer {
|
|||
*/
|
||||
int16_t setSyncWord(uint8_t* syncWord, size_t len) override;
|
||||
|
||||
/*!
|
||||
\brief Sets GFSK sync word in the form of array of up to 8 bytes.
|
||||
\param syncWord GFSK sync word to be set.
|
||||
\param bitsLen GFSK sync word length in bits. If length is not divisible by 8,
|
||||
least significant bits of syncWord will be ignored.
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t setSyncBits(uint8_t *syncWord, uint8_t bitsLen);
|
||||
|
||||
/*!
|
||||
\brief Sets node address. Calling this method will also enable address filtering for node address only.
|
||||
\param nodeAddr Node address to be set.
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue