I try to retrieve the current device's MAC address and print it through RTT so that it can be recognized automatically in the manufacturer's test. The weird thing is... the MAC address never matches the real MAC address. Here's what I do in my code:
char * macaddr( void ) { static char _str[BLE_GAP_ADDR_LEN * 3] = ""; char * p = _str; ble_gap_addr_t mac; if ( !_str[0] ) { pm_id_addr_get( &mac ); for ( int i = BLE_GAP_ADDR_LEN; i; ) { if ( i-- != BLE_GAP_ADDR_LEN ) *p++ = ':'; p += sprintf( p, "%02X", mac.addr[i] ); } } return _str; }
I have a device with address F5:B8:BC:C3:99:C5. But the above code reports F5:B8:BC:C3:99:C4. It's always the LSB that is wrong. Same thing with all the other samples I have.
Software: SDK15, hardware nRF52832