source/libs/firefly_blecast/src/firefly_blecast.c
// Reads 17 bytes; 1 byte PDU type and the 16 byte BLE address (where BLECast transmits data)
Reads 17 bytes; 1 byte PDU type and the 16 byte BLE address (where BLECast transmits data)
Reads 17 bytes ; 1 byte PDU type and the 16 byte BLE address ( where BLECast transmits data )
static void radio_read_packet(BLECastMessage *message, uint8_t *buffer) {
    radio_beginTransaction(message);
    uint8_t status = spi_transfer(RadioCommandReadPayload);
    *buffer++ = spi_transfer(0xff);
    for (uint8_t i = 0; i < 12; i++) {
        spi_transfer(0xff);
    }
    for (uint8_t i = 0; i < 16; i++) {
        *buffer++ = spi_transfer(0xff);
    }
    for (uint8_t i = 0; i < 3; i++) {
        spi_transfer(0xff);
    }
    radio_endTransaction(message);
    radio_writeRegister(message, RadioRegisterStatus, NULL, 0x70);
}
static void radio_read_packet ( BLECastMessage * message , uint8_t * buffer ) { radio_beginTransaction ( message ) ; uint8_t status = spi_transfer ( RadioCommandReadPayload ) ; * buffer ++ = spi_transfer ( 0xff ) ; for ( uint8_t i = 0 ; i < 12 ; i ++ ) { spi_transfer ( 0xff ) ; } for ( uint8_t i = 0 ; i < 16 ; i ++ ) { * buffer ++ = spi_transfer ( 0xff ) ; } for ( uint8_t i = 0 ; i < 3 ; i ++ ) { spi_transfer ( 0xff ) ; } radio_endTransaction ( message ) ; radio_writeRegister ( message , RadioRegisterStatus , NULL , 0x70 ) ; }
Reads 17 bytes; 1 byte PDU type and the 16 byte BLE address (where BLECast transmits data)
Reads 17 bytes ; 1 byte PDU type and the 16 byte BLE address ( where BLECast transmits data )
// Read the first byte (for the BLE PDU_TYPE) // Skip 12 bytes (for BLECast stuff we do not need this BLE metadata) // The 16 bytes of BLECast data (BLE address) // Finish off the 32 byte of BLE_PACKET_SIZE (3 bytes remain) // Clear the data so we can get more