Pulling in the latest SystemK (with new BLE). #2

Merged
Joe merged 16 commits from New_BLE into main 2025-06-08 22:05:06 +00:00
3 changed files with 28 additions and 6 deletions
Showing only changes of commit 4b8353193d - Show all commits

View file

@ -11,7 +11,8 @@
static const char *TAG = "BLE"; static const char *TAG = "BLE";
static bool Host_And_Controller_Synced = false; static bool Host_And_Controller_Synced = false;
static bool Is_Scanning_And_Advertising = false; static bool Is_Scanning = false;
static bool Is_Advertising = false;
static uint8_t Advertising_Data[BLE_KTAG_PACKET_TOTAL_SIZE] = {0x1E, 0xFF, 0xFF, 0xFF, 'K', 'T', 'a', 'g'}; static uint8_t Advertising_Data[BLE_KTAG_PACKET_TOTAL_SIZE] = {0x1E, 0xFF, 0xFF, 0xFF, 'K', 'T', 'a', 'g'};
@ -247,7 +248,7 @@ SystemKResult_T BLE_SetAdvertisingData(BLE_AdvertisingData_T *data)
memcpy(Advertising_Data, data, BLE_KTAG_PACKET_TOTAL_SIZE); memcpy(Advertising_Data, data, BLE_KTAG_PACKET_TOTAL_SIZE);
} }
if (Is_Scanning_And_Advertising == true) if (Is_Advertising == true)
{ {
// Restart advertising to put the new data into the advertisement. // Restart advertising to put the new data into the advertisement.
ble_gap_adv_stop(); ble_gap_adv_stop();
@ -263,11 +264,32 @@ SystemKResult_T BLE_ScanAndAdvertise(void)
if (Host_And_Controller_Synced == true) if (Host_And_Controller_Synced == true)
{ {
if (Is_Scanning_And_Advertising == false) if (Is_Scanning == false)
{ {
ble_scan(); ble_scan();
Is_Scanning = true;
}
if (Is_Advertising == false)
{
ble_advertise(); ble_advertise();
Is_Scanning_And_Advertising = true; Is_Advertising = true;
}
result = SYSTEMK_RESULT_SUCCESS;
}
return result;
}
SystemKResult_T BLE_StopAdvertising(void)
{
SystemKResult_T result = SYSTEMK_RESULT_NOT_READY;
if (Host_And_Controller_Synced == true)
{
if (Is_Advertising == true)
{
ble_gap_adv_stop();
Is_Advertising = false;
} }
result = SYSTEMK_RESULT_SUCCESS; result = SYSTEMK_RESULT_SUCCESS;
} }

@ -1 +1 @@
Subproject commit cb7204269140ba9c6dbe44ca5a5dbaf8c031f685 Subproject commit 63825263911578804866ec4b34310248b8074f17

View file

@ -24,7 +24,7 @@
#define VERSION_H #define VERSION_H
#define VERSION_MAJOR 00 #define VERSION_MAJOR 00
#define VERSION_MINOR 39 #define VERSION_MINOR 40
#define STRINGIFY(number) #number #define STRINGIFY(number) #number
#define VERSION_STRING(major, minor) STRINGIFY(major) "." STRINGIFY(minor) #define VERSION_STRING(major, minor) STRINGIFY(major) "." STRINGIFY(minor)