Description
This card allows for interfacing with Stargate Tech 2's Abstract Bus system.
Component name: abstract_bus.
This card allows for interfacing with Stargate Tech 2's Abstract Bus system.
Component name: abstract_bus.
getEnabled(): boolean Returns whether the local bus interface is enabled.
setEnabled(enabled: boolean) Sets whether the local bus interface should be enabled
getAddress(): number 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.
setAddress(address: number) Sets the local interface address. number is a 16bit hexadecimal number.
scan(mask: number): table Scans the abstract bus for attached devices and returns them in a list.
send(address: number, data: table): boolean Sends data across the abstract bus. The table data is in the form of key-value pairs.
maxPacketSize(): number Returns the maximum size a packet can be sent over the bus.
bus_message(protocolId: number, senderAddress: number, targetAddress: number, data: table, metadata: table)
Triggered when a message is received on the abstract bus.
protocolId is the protocol version that was used.
senderAddress is the address of the sender.
targetAddress 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.