mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 23:48:12 +00:00
protob: update messages_map.py script
This commit is contained in:
parent
8fa71c0837
commit
34c0b93d54
@ -1,33 +1,36 @@
|
||||
// This file is automatically generated by messages_map.py -- DO NOT EDIT!
|
||||
|
||||
// in messages
|
||||
|
||||
{ 'n', 'i', MessageType_MessageType_Initialize, Initialize_fields, (void (*)(void *)) fsm_msgInitialize },
|
||||
{ 'n', 'i', MessageType_MessageType_Ping, Ping_fields, (void (*)(void *)) fsm_msgPing },
|
||||
{ 'n', 'i', MessageType_MessageType_ChangePin, ChangePin_fields, (void (*)(void *)) fsm_msgChangePin },
|
||||
{ 'n', 'i', MessageType_MessageType_WipeDevice, WipeDevice_fields, (void (*)(void *)) fsm_msgWipeDevice },
|
||||
// { 'n', 'i', MessageType_MessageType_FirmwareErase, FirmwareErase_fields, (void (*)(void *)) fsm_msgFirmwareErase }, // BOOTLOADER
|
||||
// { 'n', 'i', MessageType_MessageType_FirmwareUpload, FirmwareUpload_fields, (void (*)(void *)) fsm_msgFirmwareUpload }, // BOOTLOADER
|
||||
// Message FirmwareErase is used in bootloader mode only
|
||||
// Message FirmwareUpload is used in bootloader mode only
|
||||
{ 'n', 'i', MessageType_MessageType_GetEntropy, GetEntropy_fields, (void (*)(void *)) fsm_msgGetEntropy },
|
||||
{ 'n', 'i', MessageType_MessageType_GetPublicKey, GetPublicKey_fields, (void (*)(void *)) fsm_msgGetPublicKey },
|
||||
{ 'n', 'i', MessageType_MessageType_LoadDevice, LoadDevice_fields, (void (*)(void *)) fsm_msgLoadDevice },
|
||||
{ 'n', 'i', MessageType_MessageType_ResetDevice, ResetDevice_fields, (void (*)(void *)) fsm_msgResetDevice },
|
||||
{ 'n', 'i', MessageType_MessageType_SignTx, SignTx_fields, (void (*)(void *)) fsm_msgSignTx },
|
||||
// { 'n', 'i', MessageType_MessageType_SimpleSignTx, SimpleSignTx_fields, (void (*)(void *)) fsm_msgSimpleSignTx }, // DEPRECATED
|
||||
// { 'n', 'i', MessageType_MessageType_PinMatrixAck, PinMatrixAck_fields, (void (*)(void *)) fsm_msgPinMatrixAck },
|
||||
// Message SimpleSignTx is deprecated
|
||||
// Message PinMatrixAck is used in tiny mode
|
||||
{ 'n', 'i', MessageType_MessageType_Cancel, Cancel_fields, (void (*)(void *)) fsm_msgCancel },
|
||||
{ 'n', 'i', MessageType_MessageType_TxAck, TxAck_fields, (void (*)(void *)) fsm_msgTxAck },
|
||||
{ 'n', 'i', MessageType_MessageType_CipherKeyValue, CipherKeyValue_fields, (void (*)(void *)) fsm_msgCipherKeyValue },
|
||||
{ 'n', 'i', MessageType_MessageType_ClearSession, ClearSession_fields, (void (*)(void *)) fsm_msgClearSession },
|
||||
{ 'n', 'i', MessageType_MessageType_ApplySettings, ApplySettings_fields, (void (*)(void *)) fsm_msgApplySettings },
|
||||
// { 'n', 'i', MessageType_MessageType_ButtonAck, ButtonAck_fields, (void (*)(void *)) fsm_msgButtonAck },
|
||||
// Message ButtonAck is used in tiny mode
|
||||
{ 'n', 'i', MessageType_MessageType_GetAddress, GetAddress_fields, (void (*)(void *)) fsm_msgGetAddress },
|
||||
{ 'n', 'i', MessageType_MessageType_EntropyAck, EntropyAck_fields, (void (*)(void *)) fsm_msgEntropyAck },
|
||||
{ 'n', 'i', MessageType_MessageType_SignMessage, SignMessage_fields, (void (*)(void *)) fsm_msgSignMessage },
|
||||
{ 'n', 'i', MessageType_MessageType_VerifyMessage, VerifyMessage_fields, (void (*)(void *)) fsm_msgVerifyMessage },
|
||||
// { 'n', 'i', MessageType_MessageType_PassphraseAck, PassphraseAck_fields, (void (*)(void *)) fsm_msgPassphraseAck },
|
||||
// Message PassphraseAck is used in tiny mode
|
||||
{ 'n', 'i', MessageType_MessageType_EstimateTxSize, EstimateTxSize_fields, (void (*)(void *)) fsm_msgEstimateTxSize },
|
||||
{ 'n', 'i', MessageType_MessageType_RecoveryDevice, RecoveryDevice_fields, (void (*)(void *)) fsm_msgRecoveryDevice },
|
||||
{ 'n', 'i', MessageType_MessageType_WordAck, WordAck_fields, (void (*)(void *)) fsm_msgWordAck },
|
||||
// { 'n', 'i', MessageType_MessageType_EncryptMessage, EncryptMessage_fields, (void (*)(void *)) fsm_msgEncryptMessage }, // DEPRECATED
|
||||
// { 'n', 'i', MessageType_MessageType_DecryptMessage, DecryptMessage_fields, (void (*)(void *)) fsm_msgDecryptMessage }, // DEPRECATED
|
||||
// Message EncryptMessage is deprecated
|
||||
// Message DecryptMessage is deprecated
|
||||
{ 'n', 'i', MessageType_MessageType_SignIdentity, SignIdentity_fields, (void (*)(void *)) fsm_msgSignIdentity },
|
||||
{ 'n', 'i', MessageType_MessageType_GetFeatures, GetFeatures_fields, (void (*)(void *)) fsm_msgGetFeatures },
|
||||
{ 'n', 'i', MessageType_MessageType_EthereumGetAddress, EthereumGetAddress_fields, (void (*)(void *)) fsm_msgEthereumGetAddress },
|
||||
@ -35,10 +38,12 @@
|
||||
{ 'n', 'i', MessageType_MessageType_EthereumTxAck, EthereumTxAck_fields, (void (*)(void *)) fsm_msgEthereumTxAck },
|
||||
{ 'n', 'i', MessageType_MessageType_GetECDHSessionKey, GetECDHSessionKey_fields, (void (*)(void *)) fsm_msgGetECDHSessionKey },
|
||||
{ 'n', 'i', MessageType_MessageType_SetU2FCounter, SetU2FCounter_fields, (void (*)(void *)) fsm_msgSetU2FCounter },
|
||||
|
||||
// out messages
|
||||
|
||||
{ 'n', 'o', MessageType_MessageType_Success, Success_fields, 0 },
|
||||
{ 'n', 'o', MessageType_MessageType_Failure, Failure_fields, 0 },
|
||||
// { 'n', 'o', MessageType_MessageType_FirmwareRequest, FirmwareRequest_fields, 0 }, // BOOTLOADER
|
||||
// Message FirmwareRequest is used in bootloader mode only
|
||||
{ 'n', 'o', MessageType_MessageType_Entropy, Entropy_fields, 0 },
|
||||
{ 'n', 'o', MessageType_MessageType_PublicKey, PublicKey_fields, 0 },
|
||||
{ 'n', 'o', MessageType_MessageType_Features, Features_fields, 0 },
|
||||
@ -52,22 +57,28 @@
|
||||
{ 'n', 'o', MessageType_MessageType_TxSize, TxSize_fields, 0 },
|
||||
{ 'n', 'o', MessageType_MessageType_WordRequest, WordRequest_fields, 0 },
|
||||
{ 'n', 'o', MessageType_MessageType_CipheredKeyValue, CipheredKeyValue_fields, 0 },
|
||||
// { 'n', 'o', MessageType_MessageType_EncryptedMessage, EncryptedMessage_fields, 0 }, // DEPRECATED
|
||||
// { 'n', 'o', MessageType_MessageType_DecryptedMessage, DecryptedMessage_fields, 0 }, // DEPRECATED
|
||||
// Message EncryptedMessage is deprecated
|
||||
// Message DecryptedMessage is deprecated
|
||||
{ 'n', 'o', MessageType_MessageType_SignedIdentity, SignedIdentity_fields, 0 },
|
||||
{ 'n', 'o', MessageType_MessageType_EthereumAddress, EthereumAddress_fields, 0 },
|
||||
{ 'n', 'o', MessageType_MessageType_EthereumTxRequest, EthereumTxRequest_fields, 0 },
|
||||
{ 'n', 'o', MessageType_MessageType_ECDHSessionKey, ECDHSessionKey_fields, 0 },
|
||||
|
||||
#if DEBUG_LINK
|
||||
|
||||
// debug in messages
|
||||
// { 'd', 'i', MessageType_MessageType_DebugLinkDecision, DebugLinkDecision_fields, (void (*)(void *)) fsm_msgDebugLinkDecision },
|
||||
|
||||
// Message DebugLinkDecision is used in tiny mode
|
||||
{ 'd', 'i', MessageType_MessageType_DebugLinkGetState, DebugLinkGetState_fields, (void (*)(void *)) fsm_msgDebugLinkGetState },
|
||||
{ 'd', 'i', MessageType_MessageType_DebugLinkStop, DebugLinkStop_fields, (void (*)(void *)) fsm_msgDebugLinkStop },
|
||||
{ 'd', 'i', MessageType_MessageType_DebugLinkMemoryRead, DebugLinkMemoryRead_fields, (void (*)(void *)) fsm_msgDebugLinkMemoryRead },
|
||||
{ 'd', 'i', MessageType_MessageType_DebugLinkMemoryWrite, DebugLinkMemoryWrite_fields, (void (*)(void *)) fsm_msgDebugLinkMemoryWrite },
|
||||
{ 'd', 'i', MessageType_MessageType_DebugLinkFlashErase, DebugLinkFlashErase_fields, (void (*)(void *)) fsm_msgDebugLinkFlashErase },
|
||||
|
||||
// debug out messages
|
||||
|
||||
{ 'd', 'o', MessageType_MessageType_DebugLinkState, DebugLinkState_fields, 0 },
|
||||
{ 'd', 'o', MessageType_MessageType_DebugLinkLog, DebugLinkLog_fields, 0 },
|
||||
{ 'd', 'o', MessageType_MessageType_DebugLinkMemory, DebugLinkMemory_fields, 0 },
|
||||
|
||||
#endif
|
||||
|
@ -25,12 +25,14 @@ def handle_message(message, extension):
|
||||
bootloader = options.Extensions[wire_bootloader]
|
||||
tiny = options.Extensions[wire_tiny] and direction == "i"
|
||||
|
||||
if options.deprecated or bootloader or tiny:
|
||||
line = "// "
|
||||
else:
|
||||
line = ""
|
||||
if options.deprecated:
|
||||
return '\t// Message %s is deprecated' % short_name
|
||||
if bootloader:
|
||||
return '\t// Message %s is used in bootloader mode only' % short_name
|
||||
if tiny:
|
||||
return '\t// Message %s is used in tiny mode' % short_name
|
||||
|
||||
line += TEMPLATE.format(
|
||||
return TEMPLATE.format(
|
||||
type="'%c'," % interface,
|
||||
dir="'%c'," % direction,
|
||||
msg_id="MessageType_%s," % name,
|
||||
@ -38,12 +40,7 @@ def handle_message(message, extension):
|
||||
process_func = "(void (*)(void *)) fsm_msg%s" % short_name if direction == "i" else "0"
|
||||
)
|
||||
|
||||
if options.deprecated:
|
||||
line += " // DEPRECATED"
|
||||
elif bootloader:
|
||||
line += " // BOOTLOADER"
|
||||
|
||||
return line
|
||||
print('\t// This file is automatically generated by messages_map.py -- DO NOT EDIT!')
|
||||
|
||||
messages = defaultdict(list)
|
||||
|
||||
@ -56,13 +53,12 @@ for message in MessageType.DESCRIPTOR.values:
|
||||
|
||||
for extension in (wire_in, wire_out, wire_debug_in, wire_debug_out):
|
||||
if extension == wire_debug_in:
|
||||
print("#if DEBUG_LINK")
|
||||
print("\n#if DEBUG_LINK")
|
||||
|
||||
print("\t// {label}".format(label=LABELS[extension]))
|
||||
print("\n\t// {label}\n".format(label=LABELS[extension]))
|
||||
|
||||
for message in messages[extension]:
|
||||
print(handle_message(message, extension))
|
||||
|
||||
if extension == wire_debug_out:
|
||||
print("#endif")
|
||||
|
||||
print("\n#endif")
|
||||
|
2
vendor/trezor-common
vendored
2
vendor/trezor-common
vendored
@ -1 +1 @@
|
||||
Subproject commit 4fd03dcc955cbcd28a70a81dbcc0d597bad9dac4
|
||||
Subproject commit e7322269092e0253b0cb1a9c18ba84fd5cd75f91
|
Loading…
Reference in New Issue
Block a user