This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
component:microcontroller:zh [2023/11/05 11:03] hfsr |
component:microcontroller:zh [2023/11/05 11:11] hfsr |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Component: Microcontroller | + | 组件:微控制器 |
=================== | =================== | ||
- | This is the component provided by the [[block:microcontroller|Microcontroller Case]]. | + | 此组件由[[block:microcontroller:zh|微控制器外壳]]提供。 |
- | These callbacks can only be called by the microcontroller itself, or its direct neighbors (i.e. other computers that share a face with the microcontroller). Note that since microcontrollers cannot access external components they cannot interact with each others microcontroller components, but a computer can access a neighbouring microcontroller. | + | 这些回调函数仅可被微控制器自身或其直接相邻者(即其他与微控制器共面的电脑)调用。请注意,由于微控制器不能访问外部组件,它们也不能访问其他微控制器的微控制器组件,但是电脑可以访问相邻的微控制器。 |
- | Component name: `microcontroller`. | + | 组件名:`microcontroller`。 |
- | Callbacks: | + | |
+ | 回调函数: | ||
- `setSideOpen(side: number, open: boolean): boolean` | - `setSideOpen(side: number, open: boolean): boolean` | ||
- | Set whether network messages are sent via the specified side. | + | 设定是否要通过给定面发送网络信息。 |
+ | \\ | ||
- `start(): boolean` | - `start(): boolean` | ||
- | Starts the microcontroller. Returns true if the state changed. | + | 启动微控制器。若其状态发生变化则返回`true`。 |
+ | \\ | ||
- `isRunning(): boolean` | - `isRunning(): boolean` | ||
- | Returns whether the microcontroller is running. | + | 返回微控制器是否正在运行。 |
+ | \\ | ||
- `isSideOpen(side: number): boolean` | - `isSideOpen(side: number): boolean` | ||
- | Get whether network messages are sent via the specified side. | + | 获取网络信息是否通过给定面发送。 |
+ | \\ | ||
- `lastError(): string` | - `lastError(): string` | ||
- | Returns the reason the microcontroller crashed, if applicable. Returns nil if no crash has occurred. | + | 若可行,返回微控制器崩溃的原因。若未发生崩溃则返回`nil`。 |
+ | \\ | ||
- `stop(): boolean` | - `stop(): boolean` | ||
- | Stops the microcontroller. Returns true if the state changed. | + | 停止微控制器的运行。若其状态发生变化则返回`true`。 |