Skip to content

Commit

Permalink
FW-882. mark MAX_PAYLOAD_SIZE to 127
Browse files Browse the repository at this point in the history
  • Loading branch information
changtengfei committed Aug 6, 2020
1 parent 0a1316b commit 6355c74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions bsp/boards/nrf52840/radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#define RADIO_CRCINIT_24BIT 0x555555
#define RADIO_CRCPOLY_24BIT 0x0000065B /// ref: https://devzone.nordicsemi.com/f/nordic-q-a/44111/crc-register-values-for-a-24-bit-crc

#define MAX_PAYLOAD_LENGTH (252)
#define MAX_PAYLOAD_LENGTH (127)
#define INTERFRAM_SPACING (150) // in us

#define BLE_ACCESS_ADDR 0x8E89BED6 // the actual address is 0xD6, 0xBE, 0x89, 0x8E
Expand Down Expand Up @@ -396,7 +396,7 @@ void radio_ble_getReceivedFrame(uint8_t* pBufRead,
}

// copy payload
memcpy(pBufRead, &radio_vars.payload[0], len+3);
memcpy(pBufRead, &radio_vars.payload[0], len+2);

// store other parameters
*pLenRead = len+2;
Expand Down
10 changes: 3 additions & 7 deletions projects/nrf52840/01bsp_radio_ble/01bsp_radio_ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ end of frame event), it will turn on its error LED.
#define LENGTH_PACKET 125+LENGTH_CRC ///< maximum length is 127 bytes
#define CHANNEL 38 ///< 0~39
#define TIMER_PERIOD (0xffff>>1) ///< 0xffff = 2s@32kHz
#define TXPOWER 0xE2 ///< 2's complement format, 0xE2 = -30dbm
#define TXPOWER 0xD5 ///< 2's complement format, 0xD8 = -40dbm

const static uint8_t ble_device_addr[6] = {
0xaa, 0xbb, 0xcc, 0xcc, 0xbb, 0xaa
Expand Down Expand Up @@ -244,19 +244,15 @@ void assemble_ibeacon_packet(void) {

memset( app_vars.packet, 0x00, sizeof(app_vars.packet) );

app_vars.packet[i++] = 0x42; // BLE ADV_SCAN_IND
app_vars.packet[i++] = 0x24; // Payload length
app_vars.packet[i++] = 0x42; // BLE ADV_NONCONN_IND (this is a must)
app_vars.packet[i++] = 0x21; // Payload length
app_vars.packet[i++] = ble_device_addr[0]; // BLE adv address byte 0
app_vars.packet[i++] = ble_device_addr[1]; // BLE adv address byte 1
app_vars.packet[i++] = ble_device_addr[2]; // BLE adv address byte 2
app_vars.packet[i++] = ble_device_addr[3]; // BLE adv address byte 3
app_vars.packet[i++] = ble_device_addr[4]; // BLE adv address byte 4
app_vars.packet[i++] = ble_device_addr[5]; // BLE adv address byte 5

app_vars.packet[i++] = 0x02;
app_vars.packet[i++] = 0x01;
app_vars.packet[i++] = 0x06;

app_vars.packet[i++] = 0x1a;
app_vars.packet[i++] = 0xff;
app_vars.packet[i++] = 0x4c;
Expand Down

0 comments on commit 6355c74

Please sign in to comment.