Added BLE_UpdateEventPacket().
This commit is contained in:
parent
2b31cc45e1
commit
bb915121e8
2 changed files with 49 additions and 0 deletions
|
@ -147,6 +147,54 @@ void BLE_UpdateInstigationPacket(uint32_t Game_Length_in_ms, uint32_t Time_Remai
|
|||
}
|
||||
}
|
||||
|
||||
void BLE_UpdateEventPacket(uint8_t target_BD_ADDR[BD_ADDR_SIZE], BLE_EventID_T event_ID, uint32_t event_data)
|
||||
{
|
||||
static uint8_t EventNumber = 0;
|
||||
|
||||
Advertising_Data.length = BLE_KTAG_PACKET_TOTAL_SIZE;
|
||||
|
||||
// Manufacturer Specific Data
|
||||
Advertising_Data.data[0] = 0x1E;
|
||||
Advertising_Data.data[1] = 0xFF;
|
||||
Advertising_Data.data[2] = 0xFF;
|
||||
Advertising_Data.data[3] = 0xFF;
|
||||
Advertising_Data.data[4] = 'K';
|
||||
Advertising_Data.data[5] = 'T';
|
||||
Advertising_Data.data[6] = 'a';
|
||||
Advertising_Data.data[7] = 'g';
|
||||
Advertising_Data.data[8] = BLE_PACKET_TYPE_EVENT;
|
||||
Advertising_Data.data[9] = EventNumber++;
|
||||
Advertising_Data.data[10] = target_BD_ADDR[0];
|
||||
Advertising_Data.data[11] = target_BD_ADDR[1];
|
||||
Advertising_Data.data[12] = target_BD_ADDR[2];
|
||||
Advertising_Data.data[13] = target_BD_ADDR[3];
|
||||
Advertising_Data.data[14] = target_BD_ADDR[4];
|
||||
Advertising_Data.data[15] = target_BD_ADDR[5];
|
||||
Advertising_Data.data[16] = (event_ID >> 0) & 0xFF;
|
||||
Advertising_Data.data[17] = (event_ID >> 8) & 0xFF;
|
||||
Advertising_Data.data[18] = (event_ID >> 16) & 0xFF;
|
||||
Advertising_Data.data[19] = (event_ID >> 24) & 0xFF;
|
||||
Advertising_Data.data[20] = (event_data >> 0) & 0xFF;
|
||||
Advertising_Data.data[21] = (event_data >> 8) & 0xFF;
|
||||
Advertising_Data.data[22] = (event_data >> 16) & 0xFF;
|
||||
Advertising_Data.data[23] = (event_data >> 24) & 0xFF;
|
||||
Advertising_Data.data[24] = 0xFF;
|
||||
Advertising_Data.data[25] = 0xFF;
|
||||
Advertising_Data.data[26] = 0xFF;
|
||||
Advertising_Data.data[27] = 0xFF;
|
||||
Advertising_Data.data[28] = 0xFF;
|
||||
Advertising_Data.data[29] = 0xFF;
|
||||
Advertising_Data.data[30] = 0xFF;
|
||||
|
||||
|
||||
SystemKResult_T result = BLE_SetAdvertisingData(&Advertising_Data);
|
||||
|
||||
if (result != SYSTEMK_RESULT_SUCCESS)
|
||||
{
|
||||
KLOG_ERROR(KLOG_TAG, "Error updating event packet!");
|
||||
}
|
||||
}
|
||||
|
||||
void BLE_UpdateStatusPacket(uint8_t current_state)
|
||||
{
|
||||
static uint8_t EventNumber = 0;
|
||||
|
|
|
@ -295,6 +295,7 @@ void BLE_InitPacketBuffers(void);
|
|||
|
||||
BLE_Packet_T *BLE_DecodeKTagPacket(const uint8_t *received_data, uint8_t received_data_length, uint8_t peer_BD_ADDR[BD_ADDR_SIZE], int8_t rssi_in_dBm);
|
||||
void BLE_UpdateInstigationPacket(uint32_t Game_Length_in_ms, uint32_t Time_Remaining_Until_Countdown_in_ms);
|
||||
void BLE_UpdateEventPacket(uint8_t target_BD_ADDR[BD_ADDR_SIZE], BLE_EventID_T event, uint32_t data);
|
||||
void BLE_UpdateStatusPacket(uint8_t current_state);
|
||||
void BLE_UpdateTagPacket(int16_t damage, color_t color, uint8_t target_BD_ADDR[BD_ADDR_SIZE]);
|
||||
void BLE_RespondToConfigurationPacket(const BLE_ParametersPacket_T *const packet, BLE_ParametersSubtype_T response);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue