module documentation

Network tools for the agent.

Function network_get_info Get network information about the device.
Function network_scan_ble Scan for nearby Bluetooth devices.
Function network_scan_wifi Scan for available Wi-Fi networks.
Function network_send_request Send an HTTP request and return error status. The response is saved to the specified path.
Constant TOOL_NETWORK_GET_INFO Undocumented
Constant TOOL_NETWORK_SCAN_BLE Undocumented
Constant TOOL_NETWORK_SCAN_WIFI Undocumented
Constant TOOL_NETWORK_SEND_REQUEST Undocumented
def network_get_info(view_manager) -> dict:

Get network information about the device.

Parameters
view_manager:ViewManagerThe view manager for system access.
Returns
dictA dict of device and network info.
def network_scan_ble(view_manager, timeout_ms: int = 3000) -> list:

Scan for nearby Bluetooth devices.

Parameters
view_manager:ViewManagerThe view manager for system access.
timeout_ms:intScan duration in milliseconds. Defaults to 3000.
Returns
listA list of device name and address strings.
def network_scan_wifi(view_manager) -> list:

Scan for available Wi-Fi networks.

Parameters
view_manager:ViewManagerThe view manager for Wi-Fi access.
Returns
listA list of SSID strings with signal strength.
def network_send_request(view_manager, url, path: str, method: str = 'GET', headers=None, data=None) -> str:

Send an HTTP request and return error status. The response is saved to the specified path.

Parameters
view_manager:ViewManagerThe view manager for thread access.
url:strThe URL to send the request to.
path:strThe file path to save the response to.
method:strThe HTTP method. Defaults to "GET".
headers:dict or NoneOptional request headers. Defaults to None.
data:str or NoneOptional request body data. Defaults to None.
Returns
str"OK" if the request was successful, otherwise an error message.
TOOL_NETWORK_GET_INFO =

Undocumented

Value
Tool(name='network_get_info',
     description='Get network information',
     parameters=Parameters(properties=[]))
TOOL_NETWORK_SCAN_BLE =

Undocumented

Value
Tool(name='network_scan_ble',
     description='Scan for nearby Bluetooth devices and return a list of device ↵
names and addresses.',
     parameters=Parameters(properties=[Property(name='timeout_ms',
                                                type='integer',
                                                description='The duration to sca↵
n for Bluetooth devices in milliseconds (default: 3000).')]))
TOOL_NETWORK_SCAN_WIFI =

Undocumented

Value
Tool(name='network_scan_wifi',
     description='Scan for available Wi-Fi networks and return a list of SSIDs.'↵
,
     parameters=Parameters(properties=[]))
TOOL_NETWORK_SEND_REQUEST =

Undocumented

Value
Tool(name='network_send_request',
     description='Send an HTTP request and return \'OK\' if successful, otherwis↵
e an error message. The response is saved to the specified path.',
     parameters=Parameters(properties=[Property(name='url',
                                                type='string',
                                                description='The URL to send the↵
 request to. It must contain the protocol (http:// or https://) and www if appli↵
...