mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-08-04 03:27:19 -04:00
line breaks, moved signal to signals page and linked it
parent
73127b5dd8
commit
437a9e28ce
@ -1,27 +1,23 @@
|
|||||||
This card allows for interfacing with Stargate Tech 2's Abstract Bus system.
|
This card allows for interfacing with [Stargate Tech 2](http://mod-stargatetech.com/)'s Abstract Bus system.
|
||||||
|
|
||||||
Component name: `abstract_bus`.
|
Component name: `abstract_bus`.
|
||||||
Callbacks:
|
Callbacks:
|
||||||
- `getEnabled(): boolean`
|
- `getEnabled(): boolean`
|
||||||
Returns whether the local bus interface is enabled.
|
Returns whether the local bus interface is enabled.
|
||||||
- `setEnabled(enabled: boolean)`
|
- `setEnabled(enabled: boolean)`
|
||||||
Sets whether the local bus interface should be enabled
|
Sets whether the local bus interface should be enabled
|
||||||
- `getAddress(): number`
|
- `getAddress(): number`
|
||||||
Returns the local interface address. `number` is a 16bit hexadecimal number (0xFFFF being a broadcast).
|
Returns the local interface address. `number` is a 16 bit hexadecimal number (0xFFFF being a broadcast).
|
||||||
Returns `0` if an address has not yet been set.
|
Returns `0` if an address has not yet been set.
|
||||||
- `setAddress(address: number)`
|
- `setAddress(address: number)`
|
||||||
Sets the local interface address. `number` is a 16bit hexadecimal number.
|
Sets the local interface address. `number` is a 16bit hexadecimal number.
|
||||||
- `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, i.e
|
Sends data across the abstract bus. The table `data` is in the form of key-value pairs, e.g.
|
||||||
```lua abstract_bus.send(0xFFF, { ["action"]="dial", ["address"]="Losomdeh Salothirt Erpac" })```
|
```
|
||||||
* See SGTech2 documentation for more info on the Abstract Bus
|
lua> component.abstract_bus.send(0xFFF, { action="dial", address="Losomdeh Salothirt Erpac" })
|
||||||
- `maxPacketSize(): number`
|
```
|
||||||
|
* See SGTech2 documentation for more info on the Abstract Bus.
|
||||||
|
- `maxPacketSize(): number`
|
||||||
Returns the maximum size a packet can be sent over the bus.
|
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.
|
The abstract bus generates a signal named `bus_message` if a message is received. See the [signals reference](https://github.com/MightyPirates/OpenComputers/wiki/_preview#abstract-bus-card).
|
||||||
The values are: `protocol id: number, sender address: number, target address: number, data: table, metadata: table`
|
|
||||||
- `protocol id` is the protocol version that was used.
|
|
||||||
- `sender address` is the address of the device sending the message
|
|
||||||
- `target address` is the address of the device that the messages was intended for (-1 for network broadcasts)
|
|
||||||
- `data` is a table of the data that was sent
|
|
||||||
- `metadata` is a table of data that are unique to the device that send the address
|
|
Loading…
x
Reference in New Issue
Block a user