1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00

apps.debug implement DebugLinkMemoryRead/Write

This commit is contained in:
Pavol Rusnak 2017-05-15 23:10:03 +02:00
parent 65ee44b636
commit ae0c5b3cbc
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -41,13 +41,18 @@ async def dispatch_DebugLinkStop(session_id, msg):
async def dispatch_DebugLinkMemoryRead(session_id, msg):
# TODO: return memaccess(msg.address, msg.length)
pass
from trezor.messages.DebugLinkMemory import DebugLinkMemory
from uctypes import bytes_at
m = DebugLinkMemory()
m.memory = bytes_at(msg.address, msg.length)
return m
async def dispatch_DebugLinkMemoryWrite(session_id, msg):
# TODO: memcpy((void *)msg.address, msg.memory, len(msg.memory))
pass
from uctypes import bytearray_at
l = len(msg.memory)
data = bytearray_at(msg.address, l)
data[0:l] = msg.memory
async def dispatch_DebugLinkFlashErase(session_id, msg):