trace
Behaviour
Section titled “Behaviour”- Write a buffer from inside the Hook to the trace log along with a message (if any)
Definition
Section titled “Definition”int64_t trace ( uint32_t mread_ptr, uint32_t mread_len, uint32_t dread_ptr, uint32_t dread_len, uint32_t as_hex);function trace( message: string | null, data: any, hex: boolean | 0 | 1 ): ErrorCodeExample
Section titled “Example”#define SBUF(str) (uint32_t)(str), sizeof(str)trace(SBUF("Buffer conatained"), SBUF(some_buffer), 1);trace("Buffer conatained", some_buffer, 1);Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| mread_ptr | uint32_t | Pointer to a message to output before the buffer. May be null. |
| mread_len | uint32_t | Length of the message. May be null. |
| dread_ptr | uint32_t | Pointer to the buffer to output. |
| dread_len | uint32_t | Length of the buffer to output. |
| as_hex | uint32_t | If |
| Name | Type | Description |
|---|---|---|
| message | string | The ‘logging key’, message to output before the buffer (can be null) |
| data | any | The data to log |
| hex | boolean | Should it log formatted in HEX? |
Return Code
Section titled “Return Code”| Type | Description |
|---|---|
| int64_t |
|
| Type | Description |
|---|---|
| ErrorCode | int64_t, value is 0 if successful If negative, an error: OUT_OF_BOUNDS |