Answer
In order to pull the Device Name of the BL600 from the Ad Element you could use either the BleGetADByTag () function or the BleAdvRptAppendAD () function. For example to place the local name into a scan report use: rc=BleAdvRptAppendAD(scnRpt$,0x09,DeviceName$) The 0x09 argument is the "Data Type Value" of the Generic Access Profile Reference the Bluetooth SIG for the nTag argument values: https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-… ) Descriptions of the data types can be found in the "Supplement to the Bluetooth Core" Specification which can be downloaded from the Bluetooth SIG link below: https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=302735 An example of a script using the BleGetADByTag function is the adscan.advert.display.sb Sample App which is available from the GitHub - Laird BL620 Sample Apps folder: https://github.com/LairdCP/BL620-Applications/blob/master/adscan.advert… Notice how this script extracts each of the AD types and then prints the results to the UART In particular this part of the code pulls the data in 0x08 or 0x09 data types from the Ad Element. //Advert not seen before - get device name ? ? rc = BLEGETADBYTAG(advData$, 8, TmpStr$)?? ? ? if (rc == 0) then ? ? //Name found at index 0x08 ? ? PRINT TmpStr$;"
" ? ? else ? ? //Name not found at index 0x08, check 0x09 ? ? rc = BLEGETADBYTAG(advData$, 9, TmpStr$) ? ? if (rc == 0) then ? ? //Name found at index 0x09 ? ? PRINT TmpStr$;"
" ? ? else ? ? //Name not found ? ? PRINT "[Device Name Not Found]
" ? ? endif ? ? endif