Driver for the SX1280 RF Transceiver

Dependents:   SX1280PingPong RangignMaster RangingSlave MSNV2-Terminal_V1-6 ... more

Revision:
10:c1b368a5052f
Parent:
9:3e5535d2cc1c
Child:
11:d60df50e108f
--- a/sx1280.cpp	Thu Aug 17 10:14:28 2017 +0000
+++ b/sx1280.cpp	Mon Oct 09 11:59:51 2017 +0000
@@ -357,6 +357,12 @@
     {
         *rxPayloadLength = ReadRegister( REG_LR_PAYLOADLENGTH );
     }
+    else if( this -> GetPacketType( true ) == PACKET_TYPE_BLE )
+    {
+        // In the case of BLE, the size returned in status[0] do not include the 2-byte length PDU header
+        // so it is added there
+        *rxPayloadLength = status[0] + 2;
+    }
     else
     {
         *rxPayloadLength = status[0];
@@ -637,6 +643,19 @@
     return updated;
 }
 
+void SX1280::SetBleAccessAddress( uint32_t accessAddress )
+{
+    this->WriteRegister( REG_LR_BLE_ACCESS_ADDRESS, ( accessAddress >> 24 ) & 0x000000FF );
+    this->WriteRegister( REG_LR_BLE_ACCESS_ADDRESS + 1, ( accessAddress >> 16 ) & 0x000000FF );
+    this->WriteRegister( REG_LR_BLE_ACCESS_ADDRESS + 2, ( accessAddress >> 8 ) & 0x000000FF );
+    this->WriteRegister( REG_LR_BLE_ACCESS_ADDRESS + 3, accessAddress & 0x000000FF );
+}
+
+void SX1280::SetBleAdvertizerAccessAddress( void )
+{
+    this->SetBleAccessAddress( BLE_ADVERTIZER_ACCESS_ADDRESS );
+}
+
 void SX1280::SetCrcPolynomial( uint16_t polynomial )
 {
     uint8_t val[2];