Hi everyone,
I'm a bit puzzled about a few of the "read" API calls. For example, the documentation claims:
---------------------------
|
Name |
BT_hci_read_local_name(): To read the name of the local Bluetooth device |
|
Synopsis
|
#include “BT_hci_api.h”
API_RESULT BT_hci_read_local_name ( void );
|
|
Description |
This API reads the name set in the local Bluetooth device. |
|
IN Parameters |
None. |
|
OUT Parameters |
None. |
|
Function Return |
API_RESULT: API_SUCCESS or one of the error codes as defined in BT_error.h or Host Controller Error Codes section. |
|
Notes |
None. |
---------------------------
Note that the return value is not a string (char *) but instead is an API_RESULT, which appears to be a UINT16. I'm not sure what the point of this API call is, as returning an error code tells the user whether or not the name could be read but not what the name actually is.
As best I can tell, a basic local name is passed to the bluetooth_on function. Internally, this name appears to be appended with the last 4 digits of the BT address (BlueMSP430ABCD, for example). It seems that given this behavior there should be a way to read out the local device's bluetooth name without having to build it myself.
I basically have 2 questions:
1. What is the proper method of reading the bluetooth's local device name (the name we specify with SDK_CONFIG_NAME and the appended MAC address, all in the same string)?
2. What is the intended purpose of this read API call? If you search the part I documentation for "BT_hci_read", you'll find that there are several functions which have void arguments and return API_RESULT, which seems to be more of a "can I read this parameter" as opposed to an actual read of a given parameter. I get the feeling I'm misunderstanding the usage model. Could you please clarify?
Thanks
-Freddy