/pps/services/tethering/control

The Tether Manager listens for commands on this object

Publishers
Any app
Subscribers
Tether Manager; any app
Note: This type of object is known as a server object, a special PPS object designed for point-to-point communication between a server and one or more clients. For details, see "Server objects" in the Persistent Publish/Subscribe Developer's Guide.

Message/response format

Commands sent to the /pps/services/tethering/control object are of the form:

msg::command_string\nid::ID_number\ndat::parameter_data

Responses always reflect the command_string and ID_number that were sent in the message, along with any errors:

res::command_string\nid::ID_number\nerr::error_description

Messages sent by the client

The control object accepts the following commands:

msg:: dat:: Description
disconnect_client {"mac":MAC_address} Disconnect from the specified client.
resume n/a Bring tetherman out of the suspended state while waiting for a confirmation from the user.
retrieve_profile "type":"lan" | "wan" Retrieve configuration values stored from previous tethering sessions for the specified interface type (lan | wan). If an error is in the response, this means the tethering session will have to be restarted. If the data field is empty in the response, this means that no value was stored from the previous session.
start The following fields are used:
  • "lantype":"lan_interface_type"
  • "lancfg":"{lancfg}"
  • "lanprofile":"{lanprofile}"
  • "wantype":"wan_interface_type"
where:
lan_interface_type
wifiap (Wi-Fi access point)
lancfg
  • gateway_address (IP address of the device on the LAN side)
  • gateway_subnet (subnet mask of the device on the LAN side)
  • dhcp_lease_time (DHCP server lease timer)
lanprofile
  • ssid (e.g., car_Hotspot)
  • security_type (e.g., wpa_mixed)
  • passphrase (e.g., testtest)
  • max_num_sta (e.g., 5)
wan_interface_type
bridge
Start the tethering session using the specified interface parameters.
stop n/a Stop the tethering session.
update_profile "type":"lan" | "wan" Update the profile for the specified interface type (lan | wan).  

Examples

If we want to observe responses from the tetherman service, we need to force the shell to keep the file descriptor open (because this is a server object). Here's an example start command:
# (exec 3<>/pps/services/tethering/control && cat >&3 && sleep 1
&& cat <&3)<<END
msg::start
id::123
dat::{"lantype":"wlanap","lancfg":{"gateway_address":"192.168.0.15","gateway_subnet":"255.255.255.0",
    "dhcp_lease_time":120},"wantype":"bridge","lanprofile":{"ssid":"car_Hotspot","security_type":"wpa_mixed",
    "passphrase":"openseseme","max_num_sta":5,"privacy":true,"block_conn":false}}
END