kopia lustrzana https://github.com/jgromes/RadioLib
[CC1101] Fixed known binary receive length
rodzic
f3de4602e6
commit
90b9bd02fb
|
@ -335,9 +335,10 @@ int16_t CC1101::startReceive() {
|
||||||
|
|
||||||
int16_t CC1101::readData(uint8_t* data, size_t len) {
|
int16_t CC1101::readData(uint8_t* data, size_t len) {
|
||||||
// get packet length
|
// get packet length
|
||||||
size_t length = len;
|
size_t length = getPacketLength();
|
||||||
if (len == RADIOLIB_CC1101_MAX_PACKET_LENGTH) {
|
if((len != 0) && (len < length)) {
|
||||||
length = getPacketLength(true);
|
// user requested less data than we got, only return what was requested
|
||||||
|
length = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check address filtering
|
// check address filtering
|
||||||
|
|
|
@ -652,7 +652,8 @@ class CC1101: public PhysicalLayer {
|
||||||
|
|
||||||
\param data Pointer to array to save the received binary data.
|
\param data Pointer to array to save the received binary data.
|
||||||
|
|
||||||
\param len Number of bytes that will be received. Must be known in advance for binary transmissions.
|
\param len Number of bytes that will be read. When set to 0, the packet length will be retreived automatically.
|
||||||
|
When more bytes than received are requested, only the number of bytes requested will be returned.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
|
|
Ładowanie…
Reference in New Issue