Component: Modem

This component is provided by network cards. Wireless network cards behave much like normal network cards, but additionally send the message as a wireless “packet” when a strength is set. The modem's address must be used for networking. It can be found through component.modem.address.

Component name: modem.
Callbacks:

This component generates a signal named modem_message if a message from another network card is received.
It has the signature localAddress: string, remoteAddress: string, port: number, distance: number, ....

Example use:

snippet.lua
local component = require("component")
local event = require("event")
local m = component.modem -- get primary modem component
m.open(123)
print(m.isOpen(123)) -- true
-- Send some message.
m.broadcast(123, "this is a test")
-- Wait for a message from another network card.
local _, _, from, port, _, message = event.pull("modem_message")
print("Got a message from " .. from .. " on port " .. port .. ": " .. tostring(message))