OP-TEE / optee_docs

This git contains the official documentation for the OP-TEE project
BSD 2-Clause "Simplified" License
58 stars 96 forks source link

TA UUID generation example: output syntax is broken. #206

Closed 37eex9 closed 1 year ago

37eex9 commented 1 year ago

Hello everyone, I just tried to create a first example TA and used the python snippet defined in the documentation to generate a UUID. The snippet given as "Note" says:

python -c "import uuid; u=uuid.uuid4(); print(u); \
   n = [', 0x'] * 11; \
   n[::2] = ['{:12x}'.format(u.node)[i:i + 2] for i in range(0, 12, 2)]; \
   print('\n' + '#define TA_UUID\n\t{ ' + \
         '0x{:08x}'.format(u.time_low) + ', ' + \
         '0x{:04x}'.format(u.time_mid) + ', ' + \
         '0x{:04x}'.format(u.time_hi_version) + ', \\ \n\n\t\t{ ' + \
         '0x{:02x}'.format(u.clock_seq_hi_variant) + ', ' + \
         '0x{:02x}'.format(u.clock_seq_low) + ', ' + \
         '0x' + ''.join(n) + '} }')"

But in the output there is one newline ("\n") and one [space] (" ") too much. I suggest changing this line '0x{:04x}'.format(u.time_hi_version) + ', \\ \n\n\t\t{ ' + \ to '0x{:04x}'.format(u.time_hi_version) + ', \x5c\n\t\t{ ' + \.

Thanks for all the great work and the good documentation.

jbech-linaro commented 1 year ago

Hi @37eex9 , agree, your proposal produces a better looking line. Do you think you can send it as a pull request?