Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
component:abstract_bus:zh [2023/10/21 15:56]
hfsr [Component: Abstract Bus]
component:abstract_bus:zh [2023/10/21 16:05]
hfsr [组件:抽象总线]
Line 1: Line 1:
-Component: Abstract Bus+组件:抽象总线
 ==================== ====================
-This card allows for interfacing with [Stargate Tech 2](http://​stargatetech.theender.net/​miscellaneous/​home.html)'s Abstract Bus system.+此扩展卡让你能够与[Stargate Tech 2](http://​stargatetech.theender.net/​miscellaneous/​home.html)的抽象总线系统交互。
  
-Component name: `abstract_bus`  +组件名:`abstract_bus`。 
-Callbacks:+   
 +回调函数:
  
 - `getEnabled():​ boolean`  ​ - `getEnabled():​ boolean`  ​
-  ​Returns whether the local bus interface is enabled.+  ​返回本地总线接口是否已启用。
 - `setEnabled(enabled:​ boolean)`  ​ - `setEnabled(enabled:​ boolean)`  ​
-  ​Sets whether the local bus interface should be enabled+  ​设定本地总线接口是否启用。
 - `getAddress():​ number`  ​ - `getAddress():​ number`  ​
-  ​Returns the local interface address. ​`number` ​is a 16 bit hexadecimal number (0xFFFF ​being a broadcast). +  ​返回本地接口的地址。`number`16位的16进制数(0xFFFF地址代表进行广播)。 
-  ​Returns ​`0` if an address has not yet been set.+  ​若地址尚未设定则返回`0`
 - `setAddress(address:​ number)`  ​ - `setAddress(address:​ number)`  ​
-  ​Sets the local interface address. ​`number` ​is a 16bit hexadecimal number.+  ​设定本地接口的地址。`number`为16位的16进制数。
 - `scan(mask: number): table`  ​ - `scan(mask: number): table`  ​
-  ​Scans the abstract bus for attached devices and returns them in a list.+  ​扫描连接到抽象总线上的设备,并将它们以列表的形式返回。
 - `send(address:​ number, data: table): boolean`  ​ - `send(address:​ number, data: table): boolean`  ​
-  ​Sends data across the abstract bus. The table `data` ​is in the form of key-value pairs, e.g.  ​+  ​通过抽象总线发送数据。表`data`的形式为键值对,例如:
   ```   ```
   lua> component.abstract_bus.send(0xFFFF,​ { ["​action"​]="​dial",​ ["​address"​]="​Losomdeh Salothirt Erpac" })   lua> component.abstract_bus.send(0xFFFF,​ { ["​action"​]="​dial",​ ["​address"​]="​Losomdeh Salothirt Erpac" })
   ```   ```
-  * See SGTech2 documentation for more info on the Abstract Bus.+  * 参阅Stargate Tech 2的官方文档以获取更多有关抽象总线的信息。
 - `maxPacketSize():​ number`  ​ - `maxPacketSize():​ number`  ​
-  ​Returns the maximum size a packet can be sent over the bus.+  ​返回可通过总线发送的最大数据包大小。
  
-The abstract bus generates a signal named `bus_message` ​if a message is received. See the [[conponent:​signals:​zh|signals reference]].+抽象总线会在收到信息时产生一个名为`bus_message`的信号。参见[[component:​signals:​zh|信号的参考内容]]
  
 目录 目录