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
Most functions return status codes from the `ocre_sensors_status_t` enumeration. Check the return value to determine if an operation succeeded or failed.
Copy file name to clipboardExpand all lines: docs/reference/container-api/timers.md
+30-31Lines changed: 30 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,21 +79,21 @@ int ocre_timer_create(int id);
79
79
80
80
**Parameters**:
81
81
82
-
|Value| Description |
83
-
| ------ | -----------|
84
-
|`id`| Timer identifier (must be between `1` and `MAX_TIMERS`) |
82
+
|Name | Type| Description |
83
+
| ------ | ------|----------- |
84
+
|`id`|*int*|Timer identifier (must be between `1` and `MAX_TIMERS`) |
85
85
86
86
**Returns**:
87
87
88
88
| Value | Description |
89
-
| ------ | -----------|
89
+
| ------ | -----------|
90
90
|`0`| on success |
91
91
|`-1`| on error with errno set |
92
92
93
93
**Errors**:
94
94
95
95
| Value | Description |
96
-
| ------ | -----------|
96
+
| ------ | -----------|
97
97
|`EINVAL`| Invalid timer ID or timer system not initialized |
98
98
|`EEXIST`| Timer ID already in use |
99
99
@@ -107,23 +107,23 @@ int ocre_timer_start(ocre_timer_t id, int interval, int is_periodic);
107
107
108
108
**Parameters**:
109
109
110
-
| Value | Description |
111
-
| ------ | -----------|
112
-
| `id` | Timer identifier |
113
-
| `interval` | Timer interval in milliseconds |
114
-
| `is_periodic`| `1` for periodic timer, `0` for one-shot
110
+
| Name | Type | Description |
111
+
| ------ | ------ | ----------- |
112
+
| `id` | *ocre_timer_t* | Timer identifier |
113
+
| `interval` | *int* | Timer interval in milliseconds |
114
+
| `is_periodic` | *int* | `1` for periodic timer, `0` for one-shot |
115
115
116
116
**Returns**:
117
117
118
118
| Value | Description |
119
-
| ------ | -----------|
119
+
| ------ | -----------|
120
120
| `0` | on success |
121
121
| `-1` | on error with errno set |
122
122
123
123
**Errors**:
124
124
125
125
| Value | Description |
126
-
| ------ | -----------|
126
+
| ------ | -----------|
127
127
| `EINVAL` | Invalid timer ID, timer not found, or invalid interval |
128
128
129
129
### Stop Timer
@@ -136,21 +136,21 @@ int ocre_timer_stop(ocre_timer_t id);
136
136
137
137
**Parameters**:
138
138
139
-
|Value| Description |
140
-
| ------ | -----------|
141
-
|`id`| Timer identifier |
139
+
|Name | Type| Description |
140
+
| ------ | ------|----------- |
141
+
|`id`|*ocre_timer_t*|Timer identifier |
142
142
143
143
**Returns**:
144
144
145
145
| Value | Description |
146
-
| ------ | -----------|
146
+
| ------ | -----------|
147
147
|`0`| on success |
148
148
|`-1`| on error with errno set |
149
149
150
150
**Errors**:
151
151
152
152
| Value | Description |
153
-
| ------ | -----------|
153
+
| ------ | -----------|
154
154
|`EINVAL`| Invalid timer ID, timer not found, or invalid interval |
155
155
156
156
### Get Remaining Time
@@ -163,21 +163,21 @@ int ocre_timer_get_remaining(ocre_timer_t id);
163
163
164
164
**Parameters**:
165
165
166
-
| Value | Description |
167
-
| ------ | -----------|
168
-
| `id` | Timer identifier |
166
+
| Name | Type | Description |
167
+
| ------ | ------ | ----------- |
168
+
| `id` | *ocre_timer_t* | Timer identifier |
169
169
170
170
**Returns**:
171
171
172
172
| Value | Description |
173
-
| ------ | -----------|
174
-
| `>= 0` | Remaining time in milliseconds|
173
+
| ------ | -----------|
174
+
| `>= 0` | Remaining time in milliseconds|
175
175
| `-1` | Error occurred (check errno) |
176
176
177
177
**Errors**:
178
178
179
179
| Value | Description |
180
-
| ------ | -----------|
180
+
| ------ | -----------|
181
181
| `EINVAL` | Invalid timer ID, timer not found, or invalid interval |
182
182
183
183
### Delete Timer
@@ -190,21 +190,21 @@ int ocre_timer_delete(ocre_timer_t id);
190
190
191
191
**Parameters**:
192
192
193
-
|Value| Description |
194
-
| ------ | -----------|
195
-
|`id`| Timer identifier |
193
+
|Name | Type| Description |
194
+
| ------ | ------|----------- |
195
+
|`id`|*ocre_timer_t*|Timer identifier |
196
196
197
197
**Returns**:
198
198
199
199
| Value | Description |
200
-
| ------ | -----------|
200
+
| ------ | -----------|
201
201
|`0`| on success |
202
202
|`-1`| on error with errno set |
203
203
204
204
**Errors**:
205
205
206
206
| Value | Description |
207
-
| ------ | -----------|
207
+
| ------ | -----------|
208
208
|`EINVAL`| Invalid timer ID, timer not found, or invalid interval |
209
209
210
210
@@ -216,9 +216,8 @@ Sets the WASM dispatcher function for timer callbacks. This function is used int
216
216
voidocre_timer_set_dispatcher(void);
217
217
```
218
218
219
-
:::info
219
+
{: .note }
220
220
This function is handled automatically by the Ocre runtime and is included here for completeness. Container applications should not call this function directly.
221
-
:::
222
221
223
222
---
224
223
## Error Handling
@@ -228,7 +227,7 @@ All functions, except `ocre_timer_set_module_inst` and `ocre_timer_set_dispatche
228
227
**Errors:**
229
228
230
229
| Value | Description |
231
-
| ------ | -----------|
230
+
| ------ | -----------|
232
231
| `EINVAL` | Invalid timer ID or timer system not initialized |
0 commit comments