Skip to content

Commit

Permalink
AP_Scripting: docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Sep 29, 2024
1 parent eea4516 commit 1fdd577
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion libraries/AP_Scripting/docs/docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,20 @@ function motor_factor_table_ud:roll(index, value) end
local SocketAPM_ud = {}

-- Get a new socket
---@param datagram boolean
---@param datagram integer -- set to 1 for UDP, 0 for TCP
---@return SocketAPM_ud
function Socket(datagram) end

-- return an IPv4 address given a string
---@param str_address string -- ipv4 address as string
---@return uint32_t_ud -- ipv4 address
function string_to_ipv4_addr(str_address) end

-- return a string representation of ipv4 address
---@param uint32_t_ud addr -- ipv4 address
---@return string -- string representation of address
function ipv4_addr_to_string(addr) end

-- return true if a socket is connected
---@return boolean
function SocketAPM_ud:is_connected() end
Expand All @@ -541,6 +551,14 @@ function SocketAPM_ud:listen(backlog) end
---@return integer
function SocketAPM_ud:send(str, len) end

-- send a lua string to a specified address. May contain binary data
---@param str string
---@param len uint32_t_ud|integer|number
---@param ipaddr uint32_t_ud -- ipv4 address
---@param port integer -- ipv4 port
---@return integer
function SocketAPM_ud:sendto(str, len, ipaddr, port) end

-- bind to an address. Use "0.0.0.0" for wildcard bind
---@param IP_address string
---@param port integer
Expand All @@ -562,6 +580,8 @@ function SocketAPM_ud:accept() end
-- receive data from a socket
---@param length integer
---@return string|nil
---@return uint32_t_ud|nil -- source IP
---@return integer|nil -- source port
function SocketAPM_ud:recv(length) end

-- check for available input
Expand Down

0 comments on commit 1fdd577

Please sign in to comment.