Skip to content

Commit

Permalink
Print firmware SHA1. Intel Read Version event contains a TLV(0x32) ha…
Browse files Browse the repository at this point in the history
…ving firmware sha1 in operational image.
  • Loading branch information
zxystd committed Feb 6, 2024
1 parent 00e061c commit 4863a3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions IntelBluetoothFirmware/BtIntel.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ typedef struct __attribute__((packed)) {
uint8_t min_fw_build_yy;
uint8_t limited_cce;
uint8_t sbe_type;
uint32_t git_sha1;
bdaddr_t otp_bd_addr;
} IntelVersionTLV;

Expand Down
6 changes: 6 additions & 0 deletions IntelBluetoothFirmware/IntelBluetoothOpsGen3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,9 @@ parseVersionTLV(IntelVersionTLV *version, const uint8_t *versionDataPtr, int len
case INTEL_TLV_OTP_BDADDR:
memcpy(&version->otp_bd_addr, tlv->val, tlv->len);
break;
case INTEL_TLV_GIT_SHA1:
version->git_sha1 = get_unaligned_le32(tlv->val);
break;
default:
/* Ignore rest of information */
break;
Expand Down Expand Up @@ -680,6 +683,9 @@ versionInfoTLV(IntelVersionTLV *version)
2000 + (version->timestamp >> 8), version->timestamp & 0xff,
version->build_type, version->build_num);

if (version->img_type == 0x03)
XYLog("Firmware SHA1: 0x%8.8x\n", version->git_sha1);

return true;
}

Expand Down
3 changes: 2 additions & 1 deletion IntelBluetoothFirmware/IntelBluetoothOpsGen3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ enum {
INTEL_TLV_LIMITED_CCE,
INTEL_TLV_SBE_TYPE,
INTEL_TLV_OTP_BDADDR,
INTEL_TLV_UNLOCKED_STATE
INTEL_TLV_UNLOCKED_STATE,
INTEL_TLV_GIT_SHA1
};

class IntelBluetoothOpsGen3 : public IntelBluetoothOpsGen2 {
Expand Down

0 comments on commit 4863a3b

Please sign in to comment.