[ https://issues.apache.org/jira/browse/MYNEWT-707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16018617#comment-16018617 ]
ASF subversion and git services commented on MYNEWT-707: -------------------------------------------------------- Commit ee0f350e01b5239521f1d1338f062b8c62f3c9e0 in incubator-mynewt-core's branch refs/heads/bsnbranch from [~wes3] [ https://git-wip-us.apache.org/repos/asf?p=incubator-mynewt-core.git;h=ee0f350 ] MYNEWT-707: Add API to retrieve public and random static address Please read the Jira ticket for more information on how to use these API. The controller now calls ble_hw_get_public_addr() and will use that address for its public address. The global device address has not been hidden yet since some apps rely on the ability to modify it. > Add API to retrieve public and static random addresses from chip specific > locations > ----------------------------------------------------------------------------------- > > Key: MYNEWT-707 > URL: https://issues.apache.org/jira/browse/MYNEWT-707 > Project: Mynewt > Issue Type: New Feature > Components: Nimble > Affects Versions: v1_0_0_rel > Reporter: William San Filippo > Assignee: William San Filippo > Fix For: v1_1_0_rel > > > This ticket will add API to retrieve a public address and random static > address from "chip specific" locations. Here are the API and how they will > work for the nordic chips, which are currently the only supported BLE chips. > This ticket does not address storing/retrieving these values from flash or > configuration areas. > 1) The ble_hw_get_public_addr function will do the following: > * If the user has overridden the default public address (the syscfg variable) > with a non-zero public address, that address will be returned by this > function. > * If the default public address in the syscfg is all zero, the code will read > FICR and check if the device address type in the FICR is public. If so, it > means the nordic chip was factory programmed with a public address and this > will be used. > * If both of the above checks fail, the code will read UICR[0] and UICR[1] to > see if a public address has been programmed into the UICR. We are doing this > to make it easy for folks to program their development kits with public > addresses so they do not have to hardcode them. UICR[0] will contain the > least significant 4 bytes of the device address. UICR[1] will contain the > most significant two bytes. The upper 16 bits of this word should be set to > 0. The API will presume that this is a valid public device address as long as > the upper 16-bits of this 32-bit word are all zero. We will also check to see > if this is a valid public address (see below). If both UICR[0] and UICR[1] > are zero, this will not be considered a valid public address. > 2) The ble_hw_get_static_addr() will do the following: > * Read the FICR to see if there is a random address in the FICR. This is the > default programming of the nrf51dk and nrf52dk. Unless you have them program > a public device address in the FICR, it will have a random address. > * If the chip does not have a random address the API returns -1. > * If the chip has a random address the upper two bits will be set to 1 (which > denotes random static address). -- This message was sent by Atlassian JIRA (v6.3.15#6346)