You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/QUICKSTART.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -310,13 +310,13 @@ If the LED is blinking, the app is running correctly. If you press the `SW2` but
310
310
## Expose public secure entry points to the secure box
311
311
[Go to top](#overview)
312
312
313
-
So far the code in the secure box cannot communicate to other boxes. To let other boxes call functions in our secure box you can define public secure entry points. These entry points can map to private functions within the context of a secure box, and the arguments and return values are automatically serialized using an RPC protocol to ensure no private memory can be leaked to external boxes.
313
+
So far, the code in the secure box cannot communicate to other boxes. To let other boxes call functions in our secure box, you can define public secure entry points. These entry points can map to private functions within the context of a secure box, and an RPC protocol automatically serializes the arguments and return values to ensure no private memory can leak to external boxes.
314
314
315
-
You can define a public secure entry point to retrieve the index value from the secure box. This index value is increased every time the `SW2` button is pressed.
315
+
You can define a public secure entry point to retrieve the index value from the secure box. This index value increases every time you press the `SW2` button.
316
316
317
317
### Defining a secure entry point
318
318
319
-
Create a new source file, `~/code/uvisor-example/source/secure_box.h`. In here we will define the functions that can be called through RPC.
319
+
Create a new source file, `~/code/uvisor-example/source/secure_box.h`, where you will define the functions that you can call through RPC.
320
320
321
321
```cpp
322
322
/* ~/code/uvisor-example/source/secure_box.h */
@@ -333,7 +333,7 @@ UVISOR_EXTERN int (*secure_get_index)(void);
333
333
334
334
### Implementing a secure entry point
335
335
336
-
Now that you have defined the secure entry point, you can map the entry point to a function running in the secure box. This is done through the `UVISOR_BOX_RPC_GATEWAY_SYNC` macro. Open `~/code/uvisor-example/source/secure_box.cpp`, and replace the line with `#define PRIVATE_BUTTON_BUFFER_COUNT 8` by:
336
+
Now that you have defined the secure entry point, you can map the entry point to a function running in the secure box. You can do this through the `UVISOR_BOX_RPC_GATEWAY_SYNC` macro. Open `~/code/uvisor-example/source/secure_box.cpp`, and replace the line with `#define PRIVATE_BUTTON_BUFFER_COUNT 8` by:
337
337
338
338
```cpp
339
339
/* ~/code/uvisor-example/source/secure_box.cpp */
@@ -351,7 +351,7 @@ UVISOR_BOX_RPC_GATEWAY_SYNC (private_button, secure_get_index, get_index, int, v
351
351
352
352
### Listening for RPC messages
353
353
354
-
To receive RPC messages you will need to spin up a new thread, running in the secure box context. You can do this in the main thread of the secure box. In `~/code/uvisor-example/source/secure_box.cpp`, replace the first five lines of `private_button_main_thread` with:
354
+
To receive RPC messages, you need to spin up a new thread, running in the secure box context. You can do this in the main thread of the secure box. In `~/code/uvisor-example/source/secure_box.cpp`, replace the first five lines of `private_button_main_thread` with:
To call the public secure entry point from any other box, you can use the `secure_get_index` function. It will automatically do an RPC call into the secure box and serialize the return value. You can try this out from the main box. In `~/code/uvisor-example/source/main.cpp`, first include the header file for the secure box:
392
+
To call the public secure entry point from any other box, you can use the `secure_get_index` function. It will automatically do an RPC call into the secure box and serialize the return value. You can try this from the main box. In `~/code/uvisor-example/source/main.cpp`, first include the header file for the secure box:
393
393
394
394
```cpp
395
395
/* ~/code/uvisor-example/source/main.cpp */
396
396
397
397
#include"secure-box.h"
398
398
```
399
399
400
-
And then replace the `main` function with:
400
+
Then replace the `main` function with:
401
401
402
402
```cpp
403
403
/* ~/code/uvisor-example/source/main.cpp */
@@ -412,7 +412,7 @@ int main(void)
412
412
}
413
413
```
414
414
415
-
You can observe the secure index by opening a serial port connection to the device, with a baud rate of 9600. When you press the `SW2` button the index will be increased.
415
+
You can observe the secure index by opening a serial port connection to the device with a baud rate of 9600. When you press the `SW2` button, the index will increase.
0 commit comments