Hi Mario,
We just use "ps" and "top" command to get the cpu usage for the test process.
There is not too much test step since since we ran our own test application which linked to hsdk library.
Here is the main skeleton of our test application.
void ble_scan_test(void)
{
...
// Setting GAPStartScanningRequest_t ScanningParams
bistat = _btif->BleSetScanParams(g_scan_interval /*0xa0*/, g_scan_window/*0xa0*/, scan_dur/*1*/, g_one_scan_nb_devices/*200*/);
...
// start discovery scan
bistat = _btif->BleStartScan(); // Call GAPStartScanningRequest to start scan
...
// After scanned device exceeds 1500, the scan is aborted
}
void BtTestCback(int event, BI_EVENT *data)
{
// print the scan result
}
void BleFsciCallback(void * container)
{
bleEvtContainer_t * cntnr = (bleEvtContainer_t *)container;
...
switch (cntnr->id)
{
...
case GAPScanningEventDeviceScannedIndication_FSCI_ID:
{
GAPScanningEventDeviceScannedIndication_t * dev = &(cntnr->Data.GAPScanningEventDeviceScannedIndication);
...
_clientCback(event, &data);
break;
}
...
}
}
int iotInit()
{
int rc;
config = defaultConfigurationData();
setBaudrate(config, UART_BAUDRATE /*115200*/);
device = InitPhysicalDevice(UART, config, serial_port, GLOBAL);
rc = OpenPhysicalDevice(device); // Create DeviceThreadRoutine
framer = InitializeFramer(device, FSCI, LENGTH_FIELD_SIZE, CRC_FIELD_SIZE, _LITTLE_ENDIAN); // Create FramerThreadRoutine
/* Subscribe to incoming events with the callback */
AttachToFramer(framer, device, BleFsciCallback);
return BISTATUS_OK;
}
int btif_init()
{
...
int bistat = _btif->Open(BtTestCback); // register _clientcallback = BtTestCback and call iotInit
...
//Reset NXP Ble Chip
...
return BISTATUS_OK;
}
int main()
{
int bistat = btif_init();
if (bistat == STATUS_OK)
{
ble_scan_test();
}
return 0;
}